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

Open
github-bot wants to merge 2 commits from github-bot/gh-3513 into main AGit
Owner

@⁠autogenes-sudo on GitHub · 2026-11-30 00:18 UTC · original
autogenes-sudo:split-ccd → main · +195 −0 · 1 files · 2 commits · open

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

**@⁠autogenes-sudo** on GitHub · 2026-11-30 00:18 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3513) `autogenes-sudo:split-ccd` → `main` · +195 −0 · 1 files · 2 commits · open ## 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
On a Ryzen 9 5900X (one memory channel, RTX 5060 8 GB, Series S, DLSS
Performance), unattended VICTORY_AB runs with 15 s phases and the draw count
regressed out: -3.7 ms +- 0.6 a frame on its own over 64 phases; with two
switches that turned out to do nothing, -4.3 +- 1.0 and -3.3 +- 1.3 ms over
63 neighbouring pairs each. The title on the second CCD instead: +9.7 +- 1.1 ms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017NVS1VxsF6w81wrbirH3yK
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 00:22:51 +00:00
The title pins its threads by processor number (checked live on a 5900X:
workers to 0-7, title-main and others to 8-12, one thread to 13 alone), and
a hard affinity wins over selected CPU sets that do not meet it (checked: a
thread pinned to 0-7 given the sets of 12-23 still runs on 0-7). So giving
the title the second CCD moved the layer onto the cores it is pinned to,
which is what the +9.7 ms measured, not the die's own speed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017NVS1VxsF6w81wrbirH3yK
Author
Owner

@⁠meonline42 on GitHub · 2026-11-30 05:27 UTC · original

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.

**@⁠meonline42** on GitHub · 2026-11-30 05:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3513#issuecomment-7269691575) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3513/head:github-bot/gh-3513'
git switch 'github-bot/gh-3513'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3513'
git switch 'github-bot/gh-3513'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3513'
git switch 'github-bot/gh-3513'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3513'
git switch 'main'
git merge --squash 'github-bot/gh-3513'
git switch 'main'
git merge --ff-only 'github-bot/gh-3513'
git switch 'main'
git merge 'github-bot/gh-3513'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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