Follow-ups to the affinity apply fix, from a second review pass.
CpuSetMapping.ResolveCpuSetIds trusted the raw CpuSetIds stored with a saved
rule ahead of the selection's logical processors. Those IDs are opaque and can
name a different processor after a topology change, while GetProcessDefaultCpuSets
still verifies them, so a stale rule silently pinned the wrong CPUs. Coordinates
are now resolved against the current mapping whenever they exist, and every one
must resolve - a partial match surfaces as InvalidTopology instead.
Automatic mode attempted CPU Sets even when the process already had a hard
affinity mask excluding the requested CPUs. Windows will not schedule outside
that mask whatever default CPU Sets are installed, yet the read-back still
verifies, so ThreadPilot reported success for an assignment that could not take
effect. It now goes straight to the hard affinity path in that case, which
actually replaces the restriction. Verified end to end: a process pinned to
0x3 targeting CPUs 4-5 now moves to 0x30 instead of silently staying at 0x3.
Affinity masks are 64-bit patterns, not magnitudes: a mask including CPU 63 is
a negative long, and the "> 0" comparisons discarded it. Replaced with
comparisons against zero so 64-CPU single-group systems are handled.
The per-CPU checkboxes stay read-only by design, but nothing said so, and the
hint first landed in the Grid.Column="2" pane that has been Visibility="Collapsed"
since 91287c9. The hint and tooltips now sit in the visible Advanced Affinity
Picker expander. Context menu rule items explain that saved rules are re-applied
automatically on process start and are separate from the Rules tab.
Also removes ApplyCoreMaskToProcessAsync, which had no RelayCommand attribute
and no callers, corrects an audit message that claimed CPU Sets had failed when
they were deliberately skipped, and fixes "core mask" mistranslations in the
Italian, Spanish, French and Russian locales plus German phrasing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhS1xyuMPFvxrojERQ4NuY
Make CPU Sets mapping group-aware
Replace legacy LogicalProcessorIndex-based CPU Set mapping with ProcessorRef-based mapping that preserves processor group and group-relative logical processor identity.
- Add CpuSetMapping with ProcessorRef -> CpuSetId and reverse lookup
- Add fakeable ProcessCpuSet native API seam
- Add ApplyCpuSelection for topology-aware CPU Set assignment
- Keep legacy ApplyCpuSetMask path for single-group <=64 compatibility
- Prevent CPU64 / Group 1 CPU0 from aliasing CPU0
- Add tests for group-aware mapping, explicit CpuSetIds, selection clearing and legacy behavior
No ProcessService wiring, UI, preset generator or profile migration changes.