CPU topology v2 phase 6: migrate profiles and core masks to CpuSelection#12
Conversation
|
Codecov Reportβ Patch coverage is π’ Thoughts on this report? Let us know! |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f06031f59
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return false; | ||
| } |
There was a problem hiding this comment.
Surface CpuSelection apply failures as exceptions
When CPU-selection application fails, this branch now returns false instead of throwing, which changes error signaling for profile loads. In the existing UI path (ProcessViewModel.LoadProfile), the return value is ignored and only exceptions trigger an error status, so protected/denied affinity applies can silently fail while the user sees a successful load. This regression is triggered whenever SetProcessorAffinity(process, profile.CpuSelection) returns a failed AffinityApplyResult.
Useful? React with πΒ / π.
| if (mask.CpuSelection != null) | ||
| { | ||
| mask.ProfileSchemaVersion = CpuAffinityProfileSchemaVersions.CpuSelection; | ||
| continue; |
There was a problem hiding this comment.
Recompute CpuSelection after BoolMask edits
This guard skips migration whenever CpuSelection is already set, so later edits to BoolMask (saved via UpdateMaskAsync -> SaveMasksAsync) do not refresh the persisted CpuSelection. After any mask edit, the file can contain a boolMask and cpuSelection that describe different CPU sets, which will produce incorrect behavior once CpuSelection-based mask application is used.
Useful? React with πΒ / π.
Summary
Adds a conservative CpuSelection migration and compatibility layer for persisted profiles and core masks.
CpuSelectionMigrationMetadatafor affinity/core-mask migration provenance, confidence, topology signature, review state, and source legacy mask.ProcessProfileSnapshotmodel with legacyProcessorAffinityretained alongside optionalCpuSelectionand migration metadata.ProfileModelandCoreMaskwith optional CpuSelection fields without removing existing legacy fields.CpuSelectionMigrationServicefor testable migration from legacy affinity masks and bool core masks, plus safe legacy-mask build-back only when representable.ProcessorAffinityfor compatibility.BoolMaskand leaving runtime core-mask apply unchanged.Out of scope
Tests
dotnet test "ThreadPilot_1.sln" --configuration Release --no-restoreExisting warnings remain in unrelated test files: CS1998 in
RetryPolicyServiceTestsand CS0067 inProcessMonitorManagerServiceTests.