Title threads: a pool of slow cores for the title's slow processors (VICTORY_TITLE_SLOW_SPREAD) #2803

Merged
Demos974 merged 1 commit from upstream-pr/2803 into main 2026-11-30 14:12:02 +00:00
Demos974 commented 2026-11-29 17:30:43 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Demos974 on 2026-11-29T17:30:43Z.


What it changes

The fast title affinity maps the title's processors 0-7 onto the fast cores and the rest onto slow cores one to one. The title asks for these masks (logged once each by this change): 0xff, 0x1f00, 0x3f00, 0x2000, 0x3fff. Its worker pools at 8-12 and 8-13 therefore share five or six slow cores.

A kernel trace of thread switches and wakes (CSwitch and ReadyThread, 6 s in the opening's house) showed five of those workers runnable but put aside 130-145 ms a second each, by our list translators that roam the slow cores at a higher priority, while the slow cores were 27-45 % idle; the title thread that waits for them waited 340 ms a second.

With VICTORY_TITLE_SLOW_SPREAD=1 a pool (more than one processor) that lands on slow cores may run on any slow core. A thread pinned to one processor keeps its one core: a first version that let the title's time-critical thread (0x2000) roam too came with all five 130-140 ms-a-frame phases of two A/B runs. The fast cores and hosts whose cores are all alike are unchanged. Off by default.

So that it can be measured in one run, the switch can be flipped while the title runs in A/B builds: victory-gpu's A/B module now tells hooks of other crates when a switch changes (ab_on_change, ab_pick), and the title's threads are placed again.

How it was tested

  • GPU and profile: RTX 5070 Ti 16 GB (driver 621.40), Core Ultra 7 265KF (8 fast + 12 slow cores), 64 GB; Series S, 720p, DLSS Quality, DLSS frame generation x4, no ray tracing
  • Before / after: two in-run A/B runs of 5 minutes (VICTORY_AB=10,VICTORY_TITLE_SLOW_SPREAD, the opening's house, nobody playing). Each phase with the switch against the mean of the two phases around it: frame time -5.3 % in the median of 20 pairs (14 of 20 faster); p90 -9 % and -16 % in the two runs; no phase over 110 ms with the switch on (two with it off).
  • A later run of four combinations with a scripted walk (#2805) was noisier: this switch alone +3 % against the cycle's mean, nothing on +8 %.
  • For shader changes, the wave sizes tested: not a shader change
  • cargo test passed for the crates it touches: yes (victory-hle 424 passed, victory-gpu 915 passed; xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it fails about 3 runs in 5 on main too, without this change). Clippy: nothing in the changed lines (main's own errors aside, see #2682).

Checked for overlap

  • I searched the open pull requests for affinity and slow cores. Related: #2039 (fast cores under Wine), #730 (two-die Ryzens)

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5553254773 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2803). Originally posted by [Demos974](https://github.com/Demos974) on 2026-11-29T17:30:43Z. --- ## What it changes The `fast` title affinity maps the title's processors 0-7 onto the fast cores and the rest onto slow cores one to one. The title asks for these masks (logged once each by this change): `0xff`, `0x1f00`, `0x3f00`, `0x2000`, `0x3fff`. Its worker pools at 8-12 and 8-13 therefore share five or six slow cores. A kernel trace of thread switches and wakes (CSwitch and ReadyThread, 6 s in the opening's house) showed five of those workers runnable but put aside 130-145 ms a second each, by our list translators that roam the slow cores at a higher priority, while the slow cores were 27-45 % idle; the title thread that waits for them waited 340 ms a second. With `VICTORY_TITLE_SLOW_SPREAD=1` a pool (more than one processor) that lands on slow cores may run on any slow core. A thread pinned to one processor keeps its one core: a first version that let the title's time-critical thread (`0x2000`) roam too came with all five 130-140 ms-a-frame phases of two A/B runs. The fast cores and hosts whose cores are all alike are unchanged. Off by default. So that it can be measured in one run, the switch can be flipped while the title runs in A/B builds: victory-gpu's A/B module now tells hooks of other crates when a switch changes (`ab_on_change`, `ab_pick`), and the title's threads are placed again. ## How it was tested - GPU and profile: RTX 5070 Ti 16 GB (driver 621.40), Core Ultra 7 265KF (8 fast + 12 slow cores), 64 GB; Series S, 720p, DLSS Quality, DLSS frame generation x4, no ray tracing - Before / after: two in-run A/B runs of 5 minutes (`VICTORY_AB=10,VICTORY_TITLE_SLOW_SPREAD`, the opening's house, nobody playing). Each phase with the switch against the mean of the two phases around it: frame time -5.3 % in the median of 20 pairs (14 of 20 faster); p90 -9 % and -16 % in the two runs; no phase over 110 ms with the switch on (two with it off). - A later run of four combinations with a scripted walk (#2805) was noisier: this switch alone +3 % against the cycle's mean, nothing on +8 %. - For shader changes, the wave sizes tested: not a shader change - `cargo test` passed for the crates it touches: yes (victory-hle 424 passed, victory-gpu 915 passed; `xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it` fails about 3 runs in 5 on `main` too, without this change). Clippy: nothing in the changed lines (`main`'s own errors aside, see #2682). ## Checked for overlap - [x] I searched the open pull requests for affinity and slow cores. Related: #2039 (fast cores under Wine), #730 (two-die Ryzens) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!2803
No description provided.