Opt-in Ryzen descriptor and snapshot optimizations with per-frame CSV capture #1560

Manually merged
github merged 1 commit from github-bot/gh-1560 into main 2026-11-29 08:21:59 +00:00 AGit
Owner

@⁠biega-dev on GitHub · 2026-11-28 21:44 UTC · original
biega-dev:pr/ryzen-descriptors-snapshots-frame-log → main · +245 −9 · 4 files · 1 commits · merged 2026-11-29 08:16 UTC

What it changes

On a Ryzen 7 3700X and an RTX 3070, the opening cutscene can leave the GPU waiting while the CPU prepares submissions. This PR ports two CPU-side experiments to current main and adds per-present data to help reviewers compare frames with similar draw counts. Both optimizations are opt-in through VICTORY_RYZEN_PREP=1.

  • Buffer descriptors. For power-of-two partition counts up to 64, mask each 64-slot word before enumerating its occupied slots. Each partition preserves slot order. Other partition counts use the existing modulo predicate.
  • Upload snapshots. For batches of at least 10 MiB, workers on AVX-capable x86-64 CPUs use non-temporal stores on pieces of at least 64 KiB. Ordinary copies handle the edges and smaller pieces. Each worker fences its streaming stores before it returns. Other buffer copies keep their existing policy.
  • Frame capture. Set VICTORY_BENCH_CSV to a new file path to record one row per presentation with elapsed time, interval and draw-count delta. This works independently of the optimization switch. An existing capture is preserved.

How it was tested

Hardware and profile. Ryzen 7 3700X, RTX 3070 8 GB, Windows 10 22H2. The game measurements below used the Series S profile, DLSS Quality from 1280 × 720 to 1920 × 1080 and frame generation off.

Component benchmarks on this PR. Each benchmark alternates the order of the two paths, discards the first round and reports the median of 11 measured rounds.

Workload Existing path Proposed path
One of eight descriptor partitions, 1,048,576 slots with every 13th occupied 66.64 µs 33.44 µs
144 MiB of snapshots submitted as 1 MiB ranges 34.43 ms 23.17 ms

Reproduce both measurements with cargo test --release --locked -p victory-gpu --lib bench_ryzen_ -- --ignored --nocapture --test-threads=1.

What the two days of game testing showed. Earlier integrated builds had mixed results. In one comparison the corridor improved from 10.79 to 11.72 rendered FPS while the cell fell from 10.43 to 9.66 FPS. A later opening-cutscene trace recorded 80.9 ms per frame on CPU submission preparation, including 54.8 ms inside the command-list steps. The RTX had no work queued for 38.5 ms per frame while the submitting thread was active. Those builds included additional changes and the scene varied between runs. The numbers above establish the cost of two operations on this PR. A matched cutscene A/B on this exact commit is still needed to establish the effect on rendered FPS and image completeness. The 30 FPS target remains open.

Correctness. The three new regression tests passed on the PR head. They cover equivalence with the full descriptor scan, unaligned snapshot copies and guard bytes, and CSV timing, draw deltas and preservation of an existing capture.

  • The release build passed with cargo build --release --locked -p victory.
  • The full victory-gpu library suite ran twice, once with VICTORY_RYZEN_PREP=0 and once with VICTORY_RYZEN_PREP=1. 553 passed, 0 failed, 45 ignored in each run. The two opt-in benchmarks above were run separately.
  • On this Windows 10 machine, the ordinary test executable loads the system D3D12 runtime and stops in ambient::tests::the_passes_build at Shader Model 6.5. The same stop reproduced on unmodified d4b5d51. For the full runs, the test executable exported the Agility SDK version and path and loaded the app-local Agility 614 runtime.

Checked for overlap

  • Searched open PRs for the affected files, switch names, descriptor partitioning and snapshot stores, and checked the project triage map in #1138.
  • #1003 also proposes non-temporal snapshot stores. This implementation adds a whole-batch threshold and uses an AVX path with ordinary copies at cache-line edges. The descriptor and CSV changes can be reviewed independently of that overlap.
  • Current main already handles Direct3D 12 Agility selection on Windows 10. This PR uses that implementation.
**@⁠biega-dev** on GitHub · 2026-11-28 21:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1560) `biega-dev:pr/ryzen-descriptors-snapshots-frame-log` → `main` · +245 −9 · 4 files · 1 commits · merged 2026-11-29 08:16 UTC ## What it changes On a Ryzen 7 3700X and an RTX 3070, the opening cutscene can leave the GPU waiting while the CPU prepares submissions. This PR ports two CPU-side experiments to current `main` and adds per-present data to help reviewers compare frames with similar draw counts. Both optimizations are opt-in through `VICTORY_RYZEN_PREP=1`. - **Buffer descriptors.** For power-of-two partition counts up to 64, mask each 64-slot word before enumerating its occupied slots. Each partition preserves slot order. Other partition counts use the existing modulo predicate. - **Upload snapshots.** For batches of at least 10 MiB, workers on AVX-capable x86-64 CPUs use non-temporal stores on pieces of at least 64 KiB. Ordinary copies handle the edges and smaller pieces. Each worker fences its streaming stores before it returns. Other buffer copies keep their existing policy. - **Frame capture.** Set `VICTORY_BENCH_CSV` to a new file path to record one row per presentation with elapsed time, interval and draw-count delta. This works independently of the optimization switch. An existing capture is preserved. ## How it was tested **Hardware and profile.** Ryzen 7 3700X, RTX 3070 8 GB, Windows 10 22H2. The game measurements below used the Series S profile, DLSS Quality from 1280 × 720 to 1920 × 1080 and frame generation off. **Component benchmarks on this PR.** Each benchmark alternates the order of the two paths, discards the first round and reports the median of 11 measured rounds. | Workload | Existing path | Proposed path | | --- | ---: | ---: | | One of eight descriptor partitions, 1,048,576 slots with every 13th occupied | 66.64 µs | 33.44 µs | | 144 MiB of snapshots submitted as 1 MiB ranges | 34.43 ms | 23.17 ms | Reproduce both measurements with `cargo test --release --locked -p victory-gpu --lib bench_ryzen_ -- --ignored --nocapture --test-threads=1`. **What the two days of game testing showed.** Earlier integrated builds had mixed results. In one comparison the corridor improved from 10.79 to 11.72 rendered FPS while the cell fell from 10.43 to 9.66 FPS. A later opening-cutscene trace recorded 80.9 ms per frame on CPU submission preparation, including 54.8 ms inside the command-list steps. The RTX had no work queued for 38.5 ms per frame while the submitting thread was active. Those builds included additional changes and the scene varied between runs. The numbers above establish the cost of two operations on this PR. A matched cutscene A/B on this exact commit is still needed to establish the effect on rendered FPS and image completeness. The 30 FPS target remains open. **Correctness.** The three new regression tests passed on the PR head. They cover equivalence with the full descriptor scan, unaligned snapshot copies and guard bytes, and CSV timing, draw deltas and preservation of an existing capture. - The release build passed with `cargo build --release --locked -p victory`. - The full `victory-gpu` library suite ran twice, once with `VICTORY_RYZEN_PREP=0` and once with `VICTORY_RYZEN_PREP=1`. **553 passed, 0 failed, 45 ignored** in each run. The two opt-in benchmarks above were run separately. - On this Windows 10 machine, the ordinary test executable loads the system D3D12 runtime and stops in `ambient::tests::the_passes_build` at Shader Model 6.5. The same stop reproduced on unmodified `d4b5d51`. For the full runs, the test executable exported the Agility SDK version and path and loaded the app-local Agility 614 runtime. ## Checked for overlap - [x] Searched open PRs for the affected files, switch names, descriptor partitioning and snapshot stores, and checked the project triage map in #1138. - #1003 also proposes non-temporal snapshot stores. This implementation adds a whole-batch threshold and uses an AVX path with ordinary copies at cache-line edges. The descriptor and CSV changes can be reviewed independently of that overlap. - Current `main` already handles Direct3D 12 Agility selection on Windows 10. This PR uses that implementation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:48:38 +00:00
github manually merged commit 6124bb1ca4 into main 2026-11-29 08:21:59 +00:00
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!1560
No description provided.