GPU: optionally scan large dirty descriptor batches in parallel #1202

Open
github-bot wants to merge 1 commit from github-bot/gh-1202 into main AGit
Owner

@⁠nicolasveilleux on GitHub · 2026-11-25 23:52 UTC · original
nicolasveilleux:perf/parallel-descriptor-page-read → main · +217 −3 · 2 files · 1 commits · draft

An opt-in experiment inspired by avatarmanz/VIctory-7900XTX 44629de. Four workers read and fingerprint page snapshots in sufficiently large batches. Only the calling thread updates the fingerprint cache and mirrors descriptors, in the existing page order. No change to table deferral or the per-record fallback. Small heaps still use the existing serial path. Enable with VICTORY_HEAP_SYNC_PARALLEL=1.

Standalone and integrated synthetic data only. Windows 11 / RTX 2070 Super / i7-10700F. On a real write-watched D3D12 placed heap, median sync time in ms with two edited descriptors per page (12 measured pairs, rotating first variant):

  • 4 pages: 0.197 -> 0.198 (serial fallback)
  • 40: 1.820 -> 1.040
  • 200: 9.451 -> 3.081
  • 300: 14.365 -> 4.760

29 descriptor tests passed, plus the isolated placed-heap A/B test run explicitly. Includes sequential/parallel prepared-record equivalence across clipped ranges and the host slot cap. This preserves the existing handling of partial records; it does not replace #802. Draft and off by default pending review and real workload validation. No gameplay FPS claim.

**@⁠nicolasveilleux** on GitHub · 2026-11-25 23:52 UTC · [original](https://github.com/fxceless/victory-fork/pull/1202) `nicolasveilleux:perf/parallel-descriptor-page-read` → `main` · +217 −3 · 2 files · 1 commits · draft An opt-in experiment inspired by [avatarmanz/VIctory-7900XTX 44629de](https://github.com/avatarmanz/VIctory-7900XTX/commit/44629de2e648a5f2e205050864286bb2fa1590bf). Four workers read and fingerprint page snapshots in sufficiently large batches. Only the calling thread updates the fingerprint cache and mirrors descriptors, in the existing page order. No change to table deferral or the per-record fallback. Small heaps still use the existing serial path. Enable with VICTORY_HEAP_SYNC_PARALLEL=1. Standalone and integrated synthetic data only. Windows 11 / RTX 2070 Super / i7-10700F. On a real write-watched D3D12 placed heap, median sync time in ms with two edited descriptors per page (12 measured pairs, rotating first variant): - 4 pages: 0.197 -> 0.198 (serial fallback) - 40: 1.820 -> 1.040 - 200: 9.451 -> 3.081 - 300: 14.365 -> 4.760 29 descriptor tests passed, plus the isolated placed-heap A/B test run explicitly. Includes sequential/parallel prepared-record equivalence across clipped ranges and the host slot cap. This preserves the existing handling of partial records; it does not replace #802. Draft and off by default pending review and real workload validation. No gameplay FPS claim.
Inspired by avatarmanz/VIctory-7900XTX 44629de2e648a5f2e205050864286bb2fa1590bf. Workers read and fingerprint privately owned page snapshots; the main thread alone updates cached fingerprints and publishes descriptors in the original page order.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:25 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 00:28 UTC · original

I ran the serial and parallel paths in the same first-room scene on an RX 7900 XT, Ryzen 7 9700X, Wine 11.22 and RADV 26.3.1. Same release executable and settings, changing only VICTORY_HEAP_SYNC_PARALLEL. The serial run counted 450 accepted presents in 73.64 s (6.11 FPS), and the parallel run counted 461 in 73.97 s (6.23 FPS). Median reported descriptor-sync time was 42.67 and 40.03 ms/frame respectively. Both runs reached the character and courtyard. One pair on a shared desktop is too close to establish a gameplay speedup.

Both page paths also needed the captured header fix from the single-record path. Before that change the fenced sampler test read wrap where the snapshot specified clamp. The fix and the two pixel regressions are in the follow-up to your branch. Exact gameplay build.

**@⁠UwUCammie** on GitHub · 2026-11-26 00:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/1202#issuecomment-7178790298) I ran the serial and parallel paths in the same first-room scene on an RX 7900 XT, Ryzen 7 9700X, Wine 11.22 and RADV 26.3.1. Same release executable and settings, changing only `VICTORY_HEAP_SYNC_PARALLEL`. The serial run counted 450 accepted presents in 73.64 s (6.11 FPS), and the parallel run counted 461 in 73.97 s (6.23 FPS). Median reported descriptor-sync time was 42.67 and 40.03 ms/frame respectively. Both runs reached the character and courtyard. One pair on a shared desktop is too close to establish a gameplay speedup. Both page paths also needed the captured header fix from the single-record path. Before that change the fenced sampler test read wrap where the snapshot specified clamp. The fix and the two pixel regressions are in [the follow-up to your branch](https://github.com/nicolasveilleux/victory-fork/pull/1). [Exact gameplay build](https://github.com/UwUCammie/victory-amd/tree/bench/fx-parallel-snapshots-radv).
Author
Owner

@⁠KainanP on GitHub · 2026-11-26 13:08 UTC · original

I benchmarked this PR next to #1293 and #1220, each against its own base, with one black-box sync_heaps benchmark: about 196 changed pages, 401,408 slots looked at and 9,298 mirrored per frame. Full table and method: #1293

Result for this PR with VICTORY_HEAP_SYNC_PARALLEL=1: 5.42 → 4.00 ms per frame on the RTX 4060 Laptop and 4.84 → 3.29 ms on the Intel UHD. The counts match the base.

AI use: Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

**@⁠KainanP** on GitHub · 2026-11-26 13:08 UTC · [original](https://github.com/fxceless/victory-fork/pull/1202#issuecomment-7192924005) I benchmarked this PR next to #1293 and #1220, each against its own base, with one black-box `sync_heaps` benchmark: about 196 changed pages, 401,408 slots looked at and 9,298 mirrored per frame. Full table and method: https://git.gtahub.st/github/fxceless--victory-fork/pulls/1293 Result for this PR with `VICTORY_HEAP_SYNC_PARALLEL=1`: **5.42 → 4.00 ms** per frame on the RTX 4060 Laptop and **4.84 → 3.29 ms** on the Intel UHD. The counts match the base. _AI use: Claude Code (Claude Opus 5.5)._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor.rs
  • crates/victory-gpu/src/descriptor/host.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/1202/head:github-bot/gh-1202'
git switch 'github-bot/gh-1202'

Merge

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