GPU: index recorded steps for submission prechecks #3309

Open
spk-c wants to merge 1 commit from upstream-pr/3309 into main
spk-c commented 2026-11-29 21:35:54 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by spk-c on 2026-11-29T21:35:54Z.


What it changes

The submission prechecks repeatedly walk all recorded steps, including refresh-heavy lists, even when they only need blocking steps or shader write declarations.

  • Index those two sparse subsets as steps are recorded and remember whether the recording contains a Copy or Run.
  • Use the original indices in blocked_with, the flag in joinable and the write subset in declared_writes; ordering, hazard checks and deduplication are unchanged.
  • Keep the full ordered vector as the source of truth. Shift indices when late heap refreshes are inserted and clear them on reset. Only existing Copy lengths and Fill metadata can be edited in place. No additional resource references are retained.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Ryzen 9 9950X3D / RTX 4090, Windows. Synthetic CPU tests and preliminary in-title diagnostics builds tested; Series X, 2560x1440 native, DLSS and frame generation off, RT on. Both local diagnostics builds include the same build fix from #3086.
  • Before / After: debug-profile synthetic stress test, 100 recordings of 20,000 refresh steps plus sparse writes and fills, median of three runs. Each pass performs both precheck scans; recording and index-maintenance costs are included. Checksums match.
    • 1 pass: 70.17 ms -> 55.40 ms.
    • 3 passes: 109.24 ms -> 56.28 ms.
    • 6 passes: 167.66 ms -> 57.52 ms.
  • Optimized release-profile benchmark on the same machine and synthetic workload, median of three runs (100 recordings):
    • 1 pass: 23.85 ms -> 16.97 ms (-28.8% elapsed).
    • 3 passes: 27.15 ms -> 17.32 ms (-36.2% elapsed).
    • 6 passes: 31.89 ms -> 16.92 ms (-46.9% elapsed).
    • These are synthetic CPU timings, not frame times or FPS. The workload intentionally stresses sparse prechecks; real list distributions and gameplay impact still need validation.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A.
  • cargo test passed for the crates it touches: yes, targeted tests only: cargo test -p victory-gpu --lib --locked recorded_steps_tests -- --include-ignored --nocapture --test-threads=1: 2 passed (equivalence and synthetic benchmark). The same two tests also passed with --release (2 passed). Full crate/workspace suite not run.
  • cargo clippy -p victory-gpu --lib --tests --no-deps --locked: exit 0; existing warnings outside the changed hunks, none in the new code. This is not a clean workspace -D warnings run.
  • git diff --check: clean.
  • Preliminary gameplay A/B (90 s measurement, 30 s warmup, same seed and route): baseline median 12.9 FPS, candidate 13.5 FPS; median CPU preparation 36.5 vs 36.3 ms; p99 872.1 vs 350.8 ms. Not a controlled performance result: median pipelines still compiling 291 vs 0, and draw loads differed. In the 7,000+ draws band the medians were 12.9 vs 10.5 FPS. A second candidate run ended with DXGI device removed (0x887A0005 / 0x887A0004), cause not established; no breadcrumbs were available. No FPS improvement or stability claim is made from these runs.
  • Follow-up stability: the baseline (without the indexed-step change, with the same #3086 diagnostics build fix) also reproduced a device removal during warmup, with zero pipelines being compiled, around 17.2 GB VRAM and a matching Windows nvlddmkm event ID 153. Thus device removal is not exclusive to the candidate; the underlying trigger and any difference in crash frequency are not established. A dedicated baseline DRED-light/debug-layer diagnostic run was launched separately.
  • Follow-up A/B: separate warmups for both builds, snapshot their common warmed cache, restore identical copies before each measured run, 60 s warmup and 90 s measurement from the same save with no scripted movement. Alternate builds, reject incomplete/cold-cache/crashed runs, record failures separately; additional D3D12 diagnostic run if needed.

Checked for overlap

  • I searched open pull requests for the same issue and touched files. Related: #2587 (submission allocations and grouping), #2647 (fused prechecks and planning), #1561 (Batch GPU-write accumulation), #3109 (step execution and refresh trims), #3069 (split submission). This indexes the original recorded sequence, rather than fusing scans or accumulating writes while executing a batch. There is related work in host.rs; #1561 and #2647 in particular may require reconciliation if merged first.

AI assistance

Prepared with AI assistance. Draft pending controlled gameplay validation. No FPS gain claimed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5555370929 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3309). Originally posted by [spk-c](https://github.com/spk-c) on 2026-11-29T21:35:54Z. --- ## What it changes The submission prechecks repeatedly walk all recorded steps, including refresh-heavy lists, even when they only need blocking steps or shader write declarations. - Index those two sparse subsets as steps are recorded and remember whether the recording contains a Copy or Run. - Use the original indices in blocked_with, the flag in joinable and the write subset in declared_writes; ordering, hazard checks and deduplication are unchanged. - Keep the full ordered vector as the source of truth. Shift indices when late heap refreshes are inserted and clear them on reset. Only existing Copy lengths and Fill metadata can be edited in place. No additional resource references are retained. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): Ryzen 9 9950X3D / RTX 4090, Windows. Synthetic CPU tests and preliminary in-title diagnostics builds tested; Series X, 2560x1440 native, DLSS and frame generation off, RT on. Both local diagnostics builds include the same build fix from #3086. - Before / After: debug-profile synthetic stress test, 100 recordings of 20,000 refresh steps plus sparse writes and fills, median of three runs. Each pass performs both precheck scans; recording and index-maintenance costs are included. Checksums match. - 1 pass: 70.17 ms -> 55.40 ms. - 3 passes: 109.24 ms -> 56.28 ms. - 6 passes: 167.66 ms -> 57.52 ms. - Optimized release-profile benchmark on the same machine and synthetic workload, median of three runs (100 recordings): - 1 pass: 23.85 ms -> 16.97 ms (-28.8% elapsed). - 3 passes: 27.15 ms -> 17.32 ms (-36.2% elapsed). - 6 passes: 31.89 ms -> 16.92 ms (-46.9% elapsed). - These are synthetic CPU timings, not frame times or FPS. The workload intentionally stresses sparse prechecks; real list distributions and gameplay impact still need validation. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A. - `cargo test` passed for the crates it touches: yes, targeted tests only: `cargo test -p victory-gpu --lib --locked recorded_steps_tests -- --include-ignored --nocapture --test-threads=1`: 2 passed (equivalence and synthetic benchmark). The same two tests also passed with `--release` (2 passed). Full crate/workspace suite not run. - `cargo clippy -p victory-gpu --lib --tests --no-deps --locked`: exit 0; existing warnings outside the changed hunks, none in the new code. This is not a clean workspace `-D warnings` run. - `git diff --check`: clean. - Preliminary gameplay A/B (90 s measurement, 30 s warmup, same seed and route): baseline median 12.9 FPS, candidate 13.5 FPS; median CPU preparation 36.5 vs 36.3 ms; p99 872.1 vs 350.8 ms. **Not a controlled performance result:** median pipelines still compiling 291 vs 0, and draw loads differed. In the 7,000+ draws band the medians were 12.9 vs 10.5 FPS. A second candidate run ended with DXGI device removed (0x887A0005 / 0x887A0004), cause not established; no breadcrumbs were available. No FPS improvement or stability claim is made from these runs. - Follow-up stability: the baseline (without the indexed-step change, with the same #3086 diagnostics build fix) also reproduced a device removal during warmup, with zero pipelines being compiled, around 17.2 GB VRAM and a matching Windows nvlddmkm event ID 153. Thus device removal is not exclusive to the candidate; the underlying trigger and any difference in crash frequency are not established. A dedicated baseline DRED-light/debug-layer diagnostic run was launched separately. - Follow-up A/B: separate warmups for both builds, snapshot their common warmed cache, restore identical copies before each measured run, 60 s warmup and 90 s measurement from the same save with no scripted movement. Alternate builds, reject incomplete/cold-cache/crashed runs, record failures separately; additional D3D12 diagnostic run if needed. ## Checked for overlap - [x] I searched open pull requests for the same issue and touched files. Related: #2587 (submission allocations and grouping), #2647 (fused prechecks and planning), #1561 (Batch GPU-write accumulation), #3109 (step execution and refresh trims), #3069 (split submission). This indexes the original recorded sequence, rather than fusing scans or accumulating writes while executing a batch. There is related work in host.rs; #1561 and #2647 in particular may require reconciliation if merged first. ## AI assistance Prepared with AI assistance. Draft pending controlled gameplay validation. No FPS gain claimed.
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/3309:upstream-pr/3309'
git switch 'upstream-pr/3309'

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