Reduce CPU work preparing GPU constant buffers #175

Open
github-bot wants to merge 3 commits from github-bot/gh-175 into main AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-27 06:09 UTC · original
TaynanGT:perf/card-fill-planning → main · +228 −73 · 4 files · 3 commits · draft

Most GPU-assisted steps on Series S are constant-buffer fills. The fill-only path uses a single dependency level and still checks the ordering of positioned copies. The complete dependency planner handles batches with writes.

Collect fill destinations while scanning the recorded list, index the in-flight ranges for fill-only batches, and group descriptor writes in their original order by worker. Claim adjacent small shadow refreshes together and accumulate their counters locally.

Both Clippy configurations and the focused card-step and worker tests passed. A standalone fixture with 7,488 fills in 36 groups measured the planner at 0.528 ms before and 0.075 ms after. The old and new planners agreed on 14,000 mixed inputs. The Series S playtest and video comparison are pending.

**@⁠TaynanGT** on GitHub · 2026-11-27 06:09 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/175) `TaynanGT:perf/card-fill-planning` → `main` · +228 −73 · 4 files · 3 commits · draft Most GPU-assisted steps on Series S are constant-buffer fills. The fill-only path uses a single dependency level and still checks the ordering of positioned copies. The complete dependency planner handles batches with writes. Collect fill destinations while scanning the recorded list, index the in-flight ranges for fill-only batches, and group descriptor writes in their original order by worker. Claim adjacent small shadow refreshes together and accumulate their counters locally. Both Clippy configurations and the focused card-step and worker tests passed. A standalone fixture with 7,488 fills in 36 groups measured the planner at 0.528 ms before and 0.075 ms after. The old and new planners agreed on 14,000 mixed inputs. The Series S playtest and video comparison are pending.
Plan fill-only batches at one level. Keep placed-copy ordering checks and index the in-flight write ranges before looking up their backing buffers.

Collect the fill destinations with the deferred steps and group slot updates once before distributing them across worker threads.
Claim adjacent refresh ranges in small groups and publish their accumulated timing and unchanged counts together. Keep the single-job path for the uneven workloads.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:09:27 +00:00
Author
Owner

@⁠NotADonky43 on GitHub · 2026-11-27 07:26 UTC · original

Independent RTX 5070 Ti / Series X check

Compared stock bcbb7959 with the two commits from dfcddbbe applied to the same tree (bd12c469 locally). Both used the same saved-profile copy, stock placement and worker settings, 25,692 offline DXIL cache entries, and the same loaded D3D12 host library with 1,625 early keys. Both rendered heavy workloads and closed with exit 0 after their 240-second watchdog requested close; neither logged device loss or a refused host PSO.

Medians of heavy telemetry windows (>1,000 draws/frame) with no in-process PSOs pending:

Stock (14 windows) #175 (16 windows)
Frame (ms) 438.2 293.9
CPU preparation (ms/frame) 198.4 125.6
Buffer refresh (ms/frame) 47.6 36.2
Card-step planning (ms/frame) 12.5 10.0
Waiting for earlier flights (ms/frame) 3.5 20.9
Fills routed through the card per frame 5,987 7,332
Draws/frame 3,373 3,641

This is directional: the windows aren't scene-matched and no visual comparison was performed. The larger preparation improvement cannot be assigned to the fill planner alone, and the flight wait moved in the opposite direction. Peak shared/private memory was essentially unchanged in this pair.

The focused planner/host/recipe tests passed on both sides. In the documented relay test mode, the held-flight fixture checks the final bytes and completed 48/48 GPU copies on both builds; the PR's grouped-refresh test also passed. With GPU-based validation added, the stock fixture hit its scheduling-coverage assertion (5/48 went through the card, but its byte assertions passed), so that extra configuration does not demonstrate full relay-path coverage.

**@⁠NotADonky43** on GitHub · 2026-11-27 07:26 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/175#issuecomment-7212480873) <!-- independent-5070ti-bcbb795-dfcddbbe --> ### Independent RTX 5070 Ti / Series X check Compared stock `bcbb7959` with the two commits from `dfcddbbe` applied to the same tree (`bd12c469` locally). Both used the same saved-profile copy, stock placement and worker settings, 25,692 offline DXIL cache entries, and the same loaded D3D12 host library with 1,625 early keys. Both rendered heavy workloads and closed with exit 0 after their 240-second watchdog requested close; neither logged device loss or a refused host PSO. Medians of heavy telemetry windows (>1,000 draws/frame) with no in-process PSOs pending: | | Stock (14 windows) | #175 (16 windows) | |---|---:|---:| | Frame (ms) | 438.2 | 293.9 | | CPU preparation (ms/frame) | 198.4 | 125.6 | | Buffer refresh (ms/frame) | 47.6 | 36.2 | | Card-step planning (ms/frame) | 12.5 | 10.0 | | Waiting for earlier flights (ms/frame) | 3.5 | 20.9 | | Fills routed through the card per frame | 5,987 | 7,332 | | Draws/frame | 3,373 | 3,641 | This is directional: the windows aren't scene-matched and no visual comparison was performed. The larger preparation improvement cannot be assigned to the fill planner alone, and the flight wait moved in the opposite direction. Peak shared/private memory was essentially unchanged in this pair. The focused planner/host/recipe tests passed on both sides. In the documented relay test mode, the held-flight fixture checks the final bytes and completed 48/48 GPU copies on both builds; the PR's grouped-refresh test also passed. With GPU-based validation added, the stock fixture hit its scheduling-coverage assertion (5/48 went through the card, but its byte assertions passed), so that extra configuration does not demonstrate full relay-path coverage.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 07:41 UTC · original

@⁠NotADonky43 Thanks for pinning the revisions and cache. The 48/48 held-flight copies give us a useful check on the bytes, and CPU prep fell from 198.4 ms to 125.6 ms in those heavy windows. Waiting for flights grew in the same pair. The next gameplay comparison should use a matched scene and recording so we can check the end-to-end gain and image together.

**@⁠TaynanGT** on GitHub · 2026-11-27 07:41 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/175#issuecomment-7212724214) @⁠NotADonky43 Thanks for pinning the revisions and cache. The 48/48 held-flight copies give us a useful check on the bytes, and CPU prep fell from 198.4 ms to 125.6 ms in those heavy windows. Waiting for flights grew in the same pair. The next gameplay comparison should use a matched scene and recording so we can check the end-to-end gain and image together.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/victory-gpu/src/host/card_steps.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/175/head:github-bot/gh-175'
git switch 'github-bot/gh-175'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-175'
git switch 'github-bot/gh-175'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-175'
git switch 'github-bot/gh-175'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-175'
git switch 'main'
git merge --squash 'github-bot/gh-175'
git switch 'main'
git merge --ff-only 'github-bot/gh-175'
git switch 'main'
git merge 'github-bot/gh-175'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.