Our threads prefer the big-cache cores on dual-CCD X3D Ryzens (VICTORY_CACHE_CORES) #147

Merged
Jrjy3 merged 1 commit from upstream-pr/147 into main 2026-11-26 08:17:49 +00:00
Jrjy3 commented 2026-11-26 07:30:34 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Jrjy3 on 2026-11-26T07:30:34Z.


On a Ryzen with two core complexes of which only one has the stacked cache (7900X3D, 7950X3D, 9900X3D, 9950X3D), every core reports the same efficiency class. So cores::fast_of finds no fast cores, and none of our threads (submit, relay, late wait, landing helpers) asks for any: they run on either complex, and Windows moves them between the two. AMD's V-Cache service only steers games it recognises, and victory.exe isn't one.

What it does

  • Where all cores have one class but the last-level caches differ in size, the sets on the largest L3 count as the fast ones (if there are at least 8 of them). The existing VICTORY_FAST_CORES stages then apply as they do on Intel hybrids. It is still a soft preference (SetThreadSelectedCpuSets), and the title's own threads are not asked for.
  • Cache sizes come from GetLogicalProcessorInformationEx(RelationCache), mapped to CPU set ids.
  • VICTORY_CACHE_CORES=0 turns it off. In diagnostics builds, VICTORY_AB=…,VICTORY_CACHE_CORES switches it while the title runs (frame_ends settles again on each change, as for VICTORY_LANE_CORE).
  • Threads register whenever cache cores could apply (fast_sets(.., false)), so a later switch reaches threads that started during an off phase.

Where it does nothing

Processor Result
Two kinds of cores (Intel hybrid) unchanged: the class decides, whatever the caches say (test)
One L3 (7800X3D, 9800X3D, Intel) unchanged (test)
Two equal L3s (9950X, 7950X) unchanged (test)
Cache sizes unknown, or the larger L3 serves under 8 sets unchanged (test)
Two unequal L3s (dual-CCD X3D) the big-cache complex is preferred

Measured

Ryzen 9 9950X3D (96 MB L3 on processors 0-15, 32 MB on 16-31) + Radeon AI PRO R9700, Windows 11 26300. Diagnostics build of this branch, scripts\play.ps1 settings plus VICTORY_AB=20,VICTORY_CACHE_CORES, 10 minutes into the first boat mission. Pairs are phases next to each other whose draws are within 15 %:

10 matched pairs change with it on
median frame -1.3 % (noise), faster in 7 of 10
p90 frame -12.2 %, better in 8 of 10

In the steady part (phases 18-29, about 3,900-4,000 draws), every phase with it on had a lower p90 (69.0-78.7 ms) than every phase without it (80.9-86.2 ms), at the same medians (66-70 ms). So it does not raise the average frame rate, but it makes the long frames shorter.

For comparison, pinning the whole process to the cache complex (an affinity mask, title threads included) cut our preparing from 22.6 to 19.4 ms, but the frame got slower (67.5 to 71.8 ms, separate runs). That is why only our threads are asked for, and softly.

One machine only. A run on another dual-CCD X3D part would be the most useful check: VICTORY_AB=20,VICTORY_CACHE_CORES in a diagnostics build, standing still somewhere, then compare the A/B phase lines.

Checks

  • cargo test -p victory-gpu --lib cores, with and without diagnostics: 3 passed (2 new tests with synthetic topologies for the table above).
  • cargo clippy -p victory-gpu --lib --tests -- -D warnings: no finding in the changed code. The ones it reports are already on main (for example queue.rs:1277, texture.rs:2067, and victory-formats texture.rs:1346, which stops the workspace run).
  • cargo xtask policy: 251 files ok.

This change was made with AI assistance (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6621742503 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/147). Originally posted by [Jrjy3](https://github.com/Jrjy3) on 2026-11-26T07:30:34Z. --- On a Ryzen with two core complexes of which only one has the stacked cache (7900X3D, 7950X3D, 9900X3D, 9950X3D), every core reports the same efficiency class. So `cores::fast_of` finds no fast cores, and none of our threads (submit, relay, late wait, landing helpers) asks for any: they run on either complex, and Windows moves them between the two. AMD's V-Cache service only steers games it recognises, and `victory.exe` isn't one. ## What it does - Where all cores have one class but the last-level caches differ in size, the sets on the **largest L3** count as the fast ones (if there are at least 8 of them). The existing `VICTORY_FAST_CORES` stages then apply as they do on Intel hybrids. It is still a soft preference (`SetThreadSelectedCpuSets`), and the title's own threads are not asked for. - Cache sizes come from `GetLogicalProcessorInformationEx(RelationCache)`, mapped to CPU set ids. - `VICTORY_CACHE_CORES=0` turns it off. In diagnostics builds, `VICTORY_AB=…,VICTORY_CACHE_CORES` switches it while the title runs (`frame_ends` settles again on each change, as for `VICTORY_LANE_CORE`). - Threads register whenever cache cores could apply (`fast_sets(.., false)`), so a later switch reaches threads that started during an off phase. ## Where it does nothing | Processor | Result | |---|---| | Two kinds of cores (Intel hybrid) | unchanged: the class decides, whatever the caches say (test) | | One L3 (7800X3D, 9800X3D, Intel) | unchanged (test) | | Two equal L3s (9950X, 7950X) | unchanged (test) | | Cache sizes unknown, or the larger L3 serves under 8 sets | unchanged (test) | | Two unequal L3s (dual-CCD X3D) | the big-cache complex is preferred | ## Measured Ryzen 9 9950X3D (96 MB L3 on processors 0-15, 32 MB on 16-31) + Radeon AI PRO R9700, Windows 11 26300. Diagnostics build of this branch, `scripts\play.ps1` settings plus `VICTORY_AB=20,VICTORY_CACHE_CORES`, 10 minutes into the first boat mission. Pairs are phases next to each other whose draws are within 15 %: | 10 matched pairs | change with it on | |---|---| | median frame | -1.3 % (noise), faster in 7 of 10 | | p90 frame | **-12.2 %**, better in 8 of 10 | In the steady part (phases 18-29, about 3,900-4,000 draws), every phase with it on had a lower p90 (69.0-78.7 ms) than every phase without it (80.9-86.2 ms), at the same medians (66-70 ms). So it does not raise the average frame rate, but it makes the long frames shorter. For comparison, pinning the **whole process** to the cache complex (an affinity mask, title threads included) cut our preparing from 22.6 to 19.4 ms, but the frame got slower (67.5 to 71.8 ms, separate runs). That is why only our threads are asked for, and softly. One machine only. **A run on another dual-CCD X3D part would be the most useful check:** `VICTORY_AB=20,VICTORY_CACHE_CORES` in a diagnostics build, standing still somewhere, then compare the `A/B phase` lines. ## Checks - `cargo test -p victory-gpu --lib cores`, with and without `diagnostics`: 3 passed (2 new tests with synthetic topologies for the table above). - `cargo clippy -p victory-gpu --lib --tests -- -D warnings`: no finding in the changed code. The ones it reports are already on `main` (for example `queue.rs:1277`, `texture.rs:2067`, and `victory-formats` `texture.rs:1346`, which stops the workspace run). - `cargo xtask policy`: 251 files ok. This change was made with AI assistance (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
avatarmanz commented 2026-11-26 07:56:39 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:56:39Z.


Merged into main in the next push (tests pass); thanks.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7186006712 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/147#issuecomment-7186006712). Originally posted by [avatarmanz](https://github.com/avatarmanz) on 2026-11-26T07:56:39Z. --- Merged into main in the next push (tests pass); thanks.
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
avatarmanz/VIctory-7900XTX!147
No description provided.