Skip to content

Commit 57676ae

Browse files
CPU topology v2 phase 5: add topology-aware preset generator foundation (#11)
Add topology-aware CPU preset generator foundation Introduce a topology-derived preset generator for safe default CPU affinity suggestions without relying on CPU SKU hardcoding. - Add CpuPreset, ICpuPresetGenerator and CpuPresetGenerationOptions - Generate deterministic presets for all cores, physical/no-SMT, all except CPU0, P/E cores, L3 group physical cores, best gaming and safe compatibility - Add SourcePresetId for best-gaming while keeping Reason user-facing - Use CpuTopologySnapshot metadata such as CoreIndex, EfficiencyClass, L3/cache groups and SMT siblings - Avoid X3D/3D V-Cache preset generation until reliable detection is available - Register the generator for future UI/profile phases - Add tests for SMT, hybrid P/E cores, dual CCD, >64 logical processors, deleted presets and missing CoreIndex No UI, profile migration, runtime affinity apply, ProcessService, registry/IFEO, version or tag changes.
1 parent 0895100 commit 57676ae

6 files changed

Lines changed: 801 additions & 1 deletion

File tree

‎Models/CpuPreset.cs‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3+
* Copyright (C) 2025 Prime Build
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, version 3 only.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
namespace ThreadPilot.Models
18+
{
19+
/// <summary>
20+
/// Topology-aware CPU affinity preset generated from a CPU topology snapshot.
21+
/// </summary>
22+
public sealed record CpuPreset
23+
{
24+
public string PresetId { get; init; } = string.Empty;
25+
26+
public string Name { get; init; } = string.Empty;
27+
28+
public string Description { get; init; } = string.Empty;
29+
30+
public CpuSelection Selection { get; init; } = new();
31+
32+
public string Reason { get; init; } = string.Empty;
33+
34+
public string? SourcePresetId { get; init; }
35+
36+
public string? Warning { get; init; }
37+
38+
public CpuTopologySignature? GeneratedByTopologySignature { get; init; }
39+
40+
public bool IsUserEditable { get; init; } = true;
41+
42+
public bool IsGenerated { get; init; } = true;
43+
44+
public bool ReviewRequired { get; init; }
45+
}
46+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* ThreadPilot - Advanced Windows Process and Power Plan Manager
3+
* Copyright (C) 2025 Prime Build
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU Affero General Public License as published by
7+
* the Free Software Foundation, version 3 only.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
namespace ThreadPilot.Services
18+
{
19+
public sealed record CpuPresetGenerationOptions
20+
{
21+
public bool ExcludeCpu0ForGaming { get; init; } = true;
22+
23+
public IReadOnlySet<string> DeletedGeneratedPresetIds { get; init; } =
24+
new HashSet<string>(StringComparer.Ordinal);
25+
26+
public bool IncludeExperimentalPresets { get; init; }
27+
}
28+
}

0 commit comments

Comments
 (0)