Reduce CPU work preparing GPU submissions #1800

Open
github-bot wants to merge 4 commits from github-bot/gh-1800 into main AGit
Owner

@⁠t90 on GitHub · 2026-11-29 00:07 UTC · original
t90:contribute/stutter-fixes-main → main · +611 −154 · 5 files · 4 commits · open

Supersedes #850, which was closed with a request to rebase on current main and open a replacement. Based on d4b5d51702db615bd0aec74a35b042f60ba4cf62.

What it changes

Draw submission allocates a descriptor-heap vector, fill planning repeats work and target lookups, small refresh jobs contend on shared accounting, and independent title-buffer backing allocations serialize unrelated lookups under the registration lock.

Four separate commits:

  • Bind descriptor heaps from stack storage, preserving view/sampler order and resource ownership.
  • Reduce fill-only planning allocations, index writer candidates, capture fill targets during recording, and partition descriptor updates. Preserve current main's placed-fill serving, including its ordering guards; bypass the fill-only fast path when serving can change the selected fills.
  • Claim small refresh work in groups and aggregate its accounting. Preserve upstream's explicit wide-chunk controls.
  • Allocate independent backing outside the global title-buffer registration lock. Revalidate registration identity before publishing, retain retry behavior, and preserve upstream's Card::before OnceLock. Imported/placed-memory paths keep their existing transaction.

This excludes launcher/configuration changes, lighting, facial-data changes, early command-list recycling, and unrelated texture experiments.

How it was tested

  • GPU/profile: RTX 5070, Series S, saved 720p Series S picture mode, DLSS Quality, 4x DLSS frame generation. No new ray-tracing configuration was introduced.
  • Before: #850's earlier combined build had a user-reported reduction in stutter; that was not an isolated or controlled measurement.
  • After: @⁠t90 reports that this rebased combined RC looks good on startup. This is initial gameplay feedback, not full-mission stability validation or a measured FPS gain. No individual commit's performance benefit is claimed.
  • The contribution's five source/test files are byte-identical to the locally built and tested RC files.
  • Optimized diagnostics build passed; CLI help passed.
  • Focused cargo test -p victory-gpu --profile rc --features diagnostics --locked --offline runs: 16 passed, 0 failed, 1 existing test ignored. Filters: host::card_steps::tests, shadow::wide_range_tests, shadow::title_allocation_tests, descriptor_bindings_omit_empty_slots (one test thread).
  • Coverage includes placed-fill serving, copy/fill dependency ordering, actual GPU copies, nested writer ranges, grouped-work exactly-once coverage, unrelated concurrent lookup, replacement of a pending registration, allocation failure/retry, and descriptor ordering.
  • The ignored copy-behind-flight test requires an isolated process and specific relay/card-step settings. The full crate/workspace suites were not run.
  • Shader changes/wave sizes: not applicable; no shader translator changes.

Known baseline checks: unchanged upstream emits five compiler warnings; the asset-policy command fails because unchanged crates/victory-shader/src/emit/lower.rs exceeds its 655360-byte source-file limit. Strict CI is not claimed green. No source/CI lint allowances or policy exemptions were added.

Checked for overlap

  • Searched open PRs for these files/topics and read #1138 (its old-main inventory is now dated).
  • Related: #1279 overlaps fill planning and writer searches; #1133 overlaps no-op refresh filtering/chunking; #1298 spans refresh/planner work plus broader copy/list changes; #1556 adds journal-amortized refresh batching; #1561 addresses shadow/refresh/card-sync contention. These are alternatives/overlapping work, not prerequisites. This replacement retains the smaller previously tested #850 approach, adapted to current main; it does not incorporate those PRs or claim to supersede their results.

AI-assisted implementation and validation; gameplay feedback from @⁠t90.

**@⁠t90** on GitHub · 2026-11-29 00:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1800) `t90:contribute/stutter-fixes-main` → `main` · +611 −154 · 5 files · 4 commits · open Supersedes #850, which was closed with a request to rebase on current main and open a replacement. Based on `d4b5d51702db615bd0aec74a35b042f60ba4cf62`. ## What it changes Draw submission allocates a descriptor-heap vector, fill planning repeats work and target lookups, small refresh jobs contend on shared accounting, and independent title-buffer backing allocations serialize unrelated lookups under the registration lock. Four separate commits: - Bind descriptor heaps from stack storage, preserving view/sampler order and resource ownership. - Reduce fill-only planning allocations, index writer candidates, capture fill targets during recording, and partition descriptor updates. Preserve current main's placed-fill serving, including its ordering guards; bypass the fill-only fast path when serving can change the selected fills. - Claim small refresh work in groups and aggregate its accounting. Preserve upstream's explicit wide-chunk controls. - Allocate independent backing outside the global title-buffer registration lock. Revalidate registration identity before publishing, retain retry behavior, and preserve upstream's Card::before OnceLock. Imported/placed-memory paths keep their existing transaction. This excludes launcher/configuration changes, lighting, facial-data changes, early command-list recycling, and unrelated texture experiments. ## How it was tested - GPU/profile: RTX 5070, Series S, saved 720p Series S picture mode, DLSS Quality, 4x DLSS frame generation. No new ray-tracing configuration was introduced. - Before: #850's earlier combined build had a user-reported reduction in stutter; that was not an isolated or controlled measurement. - After: @⁠t90 reports that this rebased combined RC looks good on startup. This is initial gameplay feedback, not full-mission stability validation or a measured FPS gain. No individual commit's performance benefit is claimed. - The contribution's five source/test files are byte-identical to the locally built and tested RC files. - Optimized diagnostics build passed; CLI help passed. - Focused `cargo test -p victory-gpu --profile rc --features diagnostics --locked --offline` runs: **16 passed, 0 failed, 1 existing test ignored**. Filters: `host::card_steps::tests`, `shadow::wide_range_tests`, `shadow::title_allocation_tests`, `descriptor_bindings_omit_empty_slots` (one test thread). - Coverage includes placed-fill serving, copy/fill dependency ordering, actual GPU copies, nested writer ranges, grouped-work exactly-once coverage, unrelated concurrent lookup, replacement of a pending registration, allocation failure/retry, and descriptor ordering. - The ignored copy-behind-flight test requires an isolated process and specific relay/card-step settings. The full crate/workspace suites were **not** run. - Shader changes/wave sizes: not applicable; no shader translator changes. Known baseline checks: unchanged upstream emits five compiler warnings; the asset-policy command fails because unchanged `crates/victory-shader/src/emit/lower.rs` exceeds its 655360-byte source-file limit. Strict CI is not claimed green. No source/CI lint allowances or policy exemptions were added. ## Checked for overlap - [x] Searched open PRs for these files/topics and read #1138 (its old-main inventory is now dated). - Related: #1279 overlaps fill planning and writer searches; #1133 overlaps no-op refresh filtering/chunking; #1298 spans refresh/planner work plus broader copy/list changes; #1556 adds journal-amortized refresh batching; #1561 addresses shadow/refresh/card-sync contention. These are alternatives/overlapping work, not prerequisites. This replacement retains the smaller previously tested #850 approach, adapted to current main; it does not incorporate those PRs or claim to supersede their results. AI-assisted implementation and validation; gameplay feedback from @⁠t90.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 00:10:37 +00:00
Author
Owner

@⁠POMXARK on GitHub · 2026-11-29 00:45 UTC · original

@⁠t90 — ran a full 20-minute gameplay A/B on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches with VICTORY_FILL_TITLE=1, VICTORY_PLACED_READS=1, VICTORY_CARD_STEPS=2):

Verification

  • Unit tests: title_allocation_tests 3/3 PASS (0.35s), card_steps 10/10 PASS (0.22s).
  • Stability & Visuals: 0 errors over 20 minutes, refused=2, clean visuals across all 16 captured screenshots.

20-minute A/B (matched draw buckets)

Metric Baseline (#1637 + #1633) + PR #1800 Delta
1k–4k draws p50 17.10 FPS (58.5 ms) 17.30 FPS (57.7 ms) +1.2% (-0.8 ms)
4k–7k draws p50 13.60 FPS (73.6 ms) 13.70 FPS (73.1 ms) +0.7% (-0.5 ms)
7k–10k draws p50 10.45 FPS (95.6 ms, 85.8 MB) 9.75 FPS (102.3 ms, 86.7 MB) -6.7% (+6.7 ms)
ALL 3D p50 14.20 FPS (70.3 ms) 14.10 FPS (71.0 ms) -0.7%
Submitting thread med 63.6 ms (plan 1.5, steps 35.6) 67.0 ms (plan 1.8, steps 37.5) +3.4 ms
Frame p95 / >100ms (5s bins) 135.4 ms / 36 135.8 ms / 53 +17 >100ms bins
Peak Shared / WS / Commit 9,723 / 22,518 / 30,886 MB 9,531 / 22,240 / 30,642 MB -244 MB commit

Takeaway

  • In light/mid scenes (1k–4k, 4k–7k), PR #1800 was slightly ahead (+0.7% to +1.2%) and trimmed peak Commit by -244 MB with 0 errors.
  • In heavier 7k–10k scenes (at identical ~86 MB/f copy volume), plan (1.5 -> 1.8 ms) and steps (35.6 -> 37.5 ms) were slightly slower (-6.7% FPS, +420 total CPU-seconds) — likely from the per-submission WriterIndex build and 8-way Vec<&Op> bucket allocations in card_steps::take_steps when plan is already fast (~1.5 ms). Reusing scratch buffers for WriterIndex / parts (or gating WriterIndex to higher writer counts) may keep the draw.rs + shadow.rs wins without the heavy-scene regression.
**@⁠POMXARK** on GitHub · 2026-11-29 00:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1800#issuecomment-7248329908) @⁠t90 — ran a full 20-minute gameplay A/B on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches with `VICTORY_FILL_TITLE=1`, `VICTORY_PLACED_READS=1`, `VICTORY_CARD_STEPS=2`): ### Verification - **Unit tests:** `title_allocation_tests` **3/3 PASS** (`0.35s`), `card_steps` **10/10 PASS** (`0.22s`). - **Stability & Visuals:** `0` errors over 20 minutes, `refused=2`, clean visuals across all 16 captured screenshots. ### 20-minute A/B (matched draw buckets) | Metric | Baseline (`#1637 + #1633`) | + PR #1800 | Delta | |---|---:|---:|---:| | **1k–4k draws p50** | 17.10 FPS (`58.5 ms`) | **17.30 FPS** (`57.7 ms`) | **+1.2% (`-0.8 ms`)** | | **4k–7k draws p50** | 13.60 FPS (`73.6 ms`) | **13.70 FPS** (`73.1 ms`) | **+0.7% (`-0.5 ms`)** | | **7k–10k draws p50** | **10.45 FPS** (`95.6 ms`, `85.8 MB`) | 9.75 FPS (`102.3 ms`, `86.7 MB`) | -6.7% (`+6.7 ms`) | | **ALL 3D p50** | **14.20 FPS** (`70.3 ms`) | 14.10 FPS (`71.0 ms`) | -0.7% | | Submitting thread med | **63.6 ms** (`plan 1.5`, `steps 35.6`) | 67.0 ms (`plan 1.8`, `steps 37.5`) | +3.4 ms | | Frame p95 / `>100ms` (5s bins) | **135.4 ms / 36** | 135.8 ms / 53 | +17 `>100ms` bins | | Peak Shared / WS / Commit | 9,723 / 22,518 / 30,886 MB | **9,531 / 22,240 / 30,642 MB** | **-244 MB commit** | ### Takeaway - In light/mid scenes (`1k–4k`, `4k–7k`), PR #1800 was slightly ahead (`+0.7%` to `+1.2%`) and trimmed peak Commit by `-244 MB` with `0` errors. - In heavier `7k–10k` scenes (at identical `~86 MB/f` copy volume), `plan` (`1.5 -> 1.8 ms`) and `steps` (`35.6 -> 37.5 ms`) were slightly slower (`-6.7%` FPS, `+420` total CPU-seconds) — likely from the per-submission `WriterIndex` build and `8`-way `Vec<&Op>` bucket allocations in `card_steps::take_steps` when `plan` is already fast (`~1.5 ms`). Reusing scratch buffers for `WriterIndex` / `parts` (or gating `WriterIndex` to higher writer counts) may keep the `draw.rs` + `shadow.rs` wins without the heavy-scene regression.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/host/card_steps.rs
  • crates/victory-gpu/src/shadow.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1800'
git switch 'github-bot/gh-1800'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1800'
git switch 'github-bot/gh-1800'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1800'
git switch 'main'
git merge --squash 'github-bot/gh-1800'
git switch 'main'
git merge --ff-only 'github-bot/gh-1800'
git switch 'main'
git merge 'github-bot/gh-1800'
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!1800
No description provided.