Cores: VICTORY_SPLIT_CCD, the title on one CCD and the layer on the other (two-CCD Ryzens, opt-in) #3513

Open
autogenes-sudo wants to merge 2 commits from upstream-pr/3513 into main
autogenes-sudo commented 2026-11-30 00:18:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by autogenes-sudo on 2026-11-30T00:18:14Z.


What it changes

VICTORY_SPLIT_CCD=1 (off unless asked for; VICTORY_AB can flip it while the title runs). On a Ryzen with two CCDs of the same L3 size and six cores or more each (no V-Cache), a watcher thread (victory-ccd) re-applies SetThreadSelectedCpuSets every second, by thread name:

  • the title's threads (no name, or title-main) go on the first CCD, which holds processor 0 and is where the title's own hard affinities pin most of them;
  • the layer's threads (victory-*, dstorage*) go on the second.

The runtime's "D3D Background Thread"s are left alone. With the switch off, or on other CPUs, nothing changes. It acts only where place_process does not place the process already: VICTORY_CACHE_CORES keeps covering parts with V-Cache on one half.

Why: on the PC below, a samply profile had 63 % of the title's threads' time in the title's own code and only ~9 of 24 logical processors busy. The layer's ~70 threads (copies, list translation, landings) shared the title's cores (SMT) and its L3.

How it was tested

  • GPU and profile: RTX 5060 8 GB (driver 621.40), Ryzen 9 5900X (two CCDs, 32 MB L3 each), 32 GB DDR4-3600 in one stick. Series S, --res 1080to1440, DLSS Performance, no frame generation, ray tracing off.
  • Method: VICTORY_AB with 15 s phases, run unattended with a VICTORY_INPUT_REPLAY pad tape (the character stands in the world, so phases are much steadier than play). Frame-time medians per phase, with the draw count regressed out; ± is one standard error.
  • Before / after:
Run Effect Phases
The switch alone (v2026.11.29.05) -3.7 ms ± 0.6 a frame (-5 %) 64
With VICTORY_HEAP_LOOK_QUIET and helpers at THREAD_PRIORITY_HIGHEST, both neutral on their own (v2026.11.29.03) -4.3 ms ± 1.0, median 72.5 -> 68.4 ms 63 neighbouring pairs
The same three (v2026.11.29.05) -3.3 ms ± 1.3, median 70.8 -> 67.5 ms 63 pairs
The title on the second CCD instead +9.7 ms ± 1.1, median 67.0 -> 76.7 ms 63 pairs
Variant: the layer apart, the title left free -2.0 ms ± 2.6 against this switch (no clear effect) 64
Variant: the submitting thread and the relay with the title +4.9 ms ± 2.6 against this switch (worse) 64

Correction (after opening this PR). The +9.7 ms row is not about the second die being slower. The title sets hard affinities by processor number. Checked live on this 5900X: 8 workers pinned to 0-7, title-main and 10 others to 8-12, one thread to 13 alone, 11 to 0-13. A hard affinity wins over selected CPU sets that do not meet it. Checked with a test thread: pinned to 0-7 and given the sets of 12-23, it still runs on 0-7; given 4-11, it runs on 4-7. So "title on the second CCD" left the title's threads where they were and moved the layer onto the cores they are pinned to. That is why the first CCD, the one that holds processor 0, is the title's, and the doc comment now says so. The gain this PR measures comes from keeping the layer off the title's cores.

No hang or picture fault occurred in any run, about 5 hours of unattended runs in all.

  • cargo test for the crate it touches: the new split_tests passes. cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without --features ab: nothing in cores.rs.

Only one PC was measured, which is why the switch is opt-in.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #730, which keeps the layer's frame threads on the preferred cores' die and leaves the title on both, for 9900X/9950X-class parts. This PR does the reverse, and this branch did not measure #730's variant. Measurements from this PC are also in a comment there.

🤖 Generated with Claude Code

https://claude.ai/code/session_017NVS1VxsF6w81wrbirH3yK

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5556727282 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3513). Originally posted by [autogenes-sudo](https://github.com/autogenes-sudo) on 2026-11-30T00:18:14Z. --- ## What it changes `VICTORY_SPLIT_CCD=1` (off unless asked for; `VICTORY_AB` can flip it while the title runs). On a Ryzen with two CCDs of the same L3 size and six cores or more each (no V-Cache), a watcher thread (`victory-ccd`) re-applies `SetThreadSelectedCpuSets` every second, by thread name: - the title's threads (no name, or `title-main`) go on the first CCD, which holds processor 0 and is where the title's own hard affinities pin most of them; - the layer's threads (`victory-*`, `dstorage*`) go on the second. The runtime's "D3D Background Thread"s are left alone. With the switch off, or on other CPUs, nothing changes. It acts only where `place_process` does not place the process already: `VICTORY_CACHE_CORES` keeps covering parts with V-Cache on one half. Why: on the PC below, a samply profile had 63 % of the title's threads' time in the title's own code and only ~9 of 24 logical processors busy. The layer's ~70 threads (copies, list translation, landings) shared the title's cores (SMT) and its L3. ## How it was tested - **GPU and profile:** RTX 5060 8 GB (driver 621.40), Ryzen 9 5900X (two CCDs, 32 MB L3 each), 32 GB DDR4-3600 in one stick. Series S, `--res 1080to1440`, DLSS Performance, no frame generation, ray tracing off. - **Method:** `VICTORY_AB` with 15 s phases, run unattended with a `VICTORY_INPUT_REPLAY` pad tape (the character stands in the world, so phases are much steadier than play). Frame-time medians per phase, with the draw count regressed out; ± is one standard error. - **Before / after:** | Run | Effect | Phases | |---|---|---| | The switch alone (v2026.11.29.05) | **-3.7 ms ± 0.6** a frame (-5 %) | 64 | | With `VICTORY_HEAP_LOOK_QUIET` and helpers at `THREAD_PRIORITY_HIGHEST`, both neutral on their own (v2026.11.29.03) | -4.3 ms ± 1.0, median 72.5 -> 68.4 ms | 63 neighbouring pairs | | The same three (v2026.11.29.05) | -3.3 ms ± 1.3, median 70.8 -> 67.5 ms | 63 pairs | | The title on the **second** CCD instead | **+9.7 ms ± 1.1**, median 67.0 -> 76.7 ms | 63 pairs | | Variant: the layer apart, the title left free | -2.0 ms ± 2.6 against this switch (no clear effect) | 64 | | Variant: the submitting thread and the relay with the title | +4.9 ms ± 2.6 against this switch (worse) | 64 | **Correction (after opening this PR).** The +9.7 ms row is not about the second die being slower. The title sets hard affinities by processor number. Checked live on this 5900X: 8 workers pinned to 0-7, `title-main` and 10 others to 8-12, one thread to 13 alone, 11 to 0-13. A hard affinity wins over selected CPU sets that do not meet it. Checked with a test thread: pinned to 0-7 and given the sets of 12-23, it still runs on 0-7; given 4-11, it runs on 4-7. So "title on the second CCD" left the title's threads where they were and moved the layer onto the cores they are pinned to. That is why the first CCD, the one that holds processor 0, is the title's, and the doc comment now says so. The gain this PR measures comes from keeping the layer off the title's cores. No hang or picture fault occurred in any run, about 5 hours of unattended runs in all. - `cargo test` for the crate it touches: the new `split_tests` passes. `cargo clippy -p victory-gpu --all-targets -- -D warnings`, with and without `--features ab`: nothing in `cores.rs`. Only one PC was measured, which is why the switch is opt-in. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #730, which keeps the layer's frame threads on the preferred cores' die and leaves the title on both, for 9900X/9950X-class parts. This PR does the reverse, and this branch did not measure #730's variant. Measurements from this PC are also in a comment there. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017NVS1VxsF6w81wrbirH3yK
meonline42 commented 2026-11-30 05:27:48 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by meonline42 on 2026-11-30T05:27:48Z.


A second Ryzen 9 5900X, with two DDR4-3200 sticks (dual channel) and an RTX 3090, for comparison with your single-stick numbers. The result is inconclusive here, which may itself be useful.

bcfd94e9 (this PR on 41adb551), Series X, 1080p to 1440p, DLSS Performance, frame generation off. Separate runs of 240 s, the same save restored before each, VICTORY_SPLIT_CCD=0 and =1 alternating, two rounds. Medians of the 5 s host lines over 3,000 draws. The log confirms it was on in both "on" runs (VICTORY_SPLIT_CCD: the title's threads on the first CCD, the layer's on the second on=true title_threads=12 layer_threads=3).

draws frame preparing copying back
off, r1 6,196 57.3 ms 45.9 ms 18.7 ms
on, r1 6,017 64.1 ms 45.9 ms 17.5 ms
off, r2 7,283 87.8 ms 52.9 ms 28.9 ms
on, r2 7,269 66.9 ms 49.8 ms 23.2 ms

Preparing is the same or a little lower with it on (45.9 / 45.9, 52.9 / 49.8 ms), but the frame medians go both ways, and the spread between runs at this scene (traffic differs even with the same save) is larger than the ~4 ms you measured. Your in-run VICTORY_AB phases with draws regressed out are the better method for an effect this size. I can't do that here yet with my bench setup, so read this as "no contradiction, no confirmation" on dual-channel memory.

Measured and posted by Claude Code on behalf of the machine's owner.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269691575 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3513#issuecomment-7269691575). Originally posted by [meonline42](https://github.com/meonline42) on 2026-11-30T05:27:48Z. --- A second Ryzen 9 5900X, with two DDR4-3200 sticks (dual channel) and an RTX 3090, for comparison with your single-stick numbers. The result is inconclusive here, which may itself be useful. `bcfd94e9` (this PR on `41adb551`), Series X, 1080p to 1440p, DLSS Performance, frame generation off. Separate runs of 240 s, the same save restored before each, `VICTORY_SPLIT_CCD=0` and `=1` alternating, two rounds. Medians of the 5 s host lines over 3,000 draws. The log confirms it was on in both "on" runs (`VICTORY_SPLIT_CCD: the title's threads on the first CCD, the layer's on the second on=true title_threads=12 layer_threads=3`). | | draws | frame | preparing | copying back | |---|---|---|---|---| | off, r1 | 6,196 | 57.3 ms | 45.9 ms | 18.7 ms | | on, r1 | 6,017 | 64.1 ms | 45.9 ms | 17.5 ms | | off, r2 | 7,283 | 87.8 ms | 52.9 ms | 28.9 ms | | on, r2 | 7,269 | 66.9 ms | 49.8 ms | 23.2 ms | Preparing is the same or a little lower with it on (45.9 / 45.9, 52.9 / 49.8 ms), but the frame medians go both ways, and the spread between runs at this scene (traffic differs even with the same save) is larger than the ~4 ms you measured. Your in-run `VICTORY_AB` phases with draws regressed out are the better method for an effect this size. I can't do that here yet with my bench setup, so read this as "no contradiction, no confirmation" on dual-channel memory. Measured and posted by Claude Code on behalf of the machine's owner.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3513:upstream-pr/3513'
git switch 'upstream-pr/3513'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3513'
git switch 'upstream-pr/3513'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3513'
git switch 'upstream-pr/3513'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3513'
git switch 'main'
git merge --squash 'upstream-pr/3513'
git switch 'main'
git merge --ff-only 'upstream-pr/3513'
git switch 'main'
git merge 'upstream-pr/3513'
git push origin 'main'
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!3513
No description provided.