GPU: skip untouched zero runs during descriptor page sync #1220

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

@⁠nicolasveilleux on GitHub · 2026-11-26 00:28 UTC · original
nicolasveilleux:perf/skip-cold-zero-descriptor-runs → main · +119 −2 · 2 files · 1 commits · open

Skip groups of eight descriptor slots during the existing serial page-batched scan, but only when the copied-cache entries are all cold and the complete corresponding records are exactly zero. The existing per-record path handles cached, populated, or clipped records. Keeps the publish order and does not add workers. Independent of #1202; not stacked on #1043. Off by default; opt in with VICTORY_HEAP_SYNC_ZERO_RUNS=1.

Validation

Native Windows 11 / i7-10700F / RTX 2070 Super: 30 targeted tests passed, plus the isolated native A/B benchmark (12 measured pairs per workload).

  • Sparse synthetic placed heap, two toggled records per page, median ms: 4 pages 0.2255 -> 0.0595; 40 pages 2.0683 -> 0.4298; 200 pages 10.4618 -> 2.4501; 300 pages 16.2841 -> 3.8183.
  • Dense 40-page case, same two toggled records on each page with the other records populated: 0.6109 -> 0.6314 ms. This slight regression is why the change stays opt-in.
  • Regression covers clipped ranges, the end of the fingerprint cache, previously seen slots, and a nonzero byte at the edge of a candidate run. The native test checks occupied and cleared slots on every pass.

Synthetic timings only; no measured gameplay FPS change.

**@⁠nicolasveilleux** on GitHub · 2026-11-26 00:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/1220) `nicolasveilleux:perf/skip-cold-zero-descriptor-runs` → `main` · +119 −2 · 2 files · 1 commits · open Skip groups of eight descriptor slots during the existing serial page-batched scan, but only when the copied-cache entries are all cold and the complete corresponding records are exactly zero. The existing per-record path handles cached, populated, or clipped records. Keeps the publish order and does not add workers. Independent of #1202; not stacked on #1043. Off by default; opt in with VICTORY_HEAP_SYNC_ZERO_RUNS=1. ## Validation Native Windows 11 / i7-10700F / RTX 2070 Super: 30 targeted tests passed, plus the isolated native A/B benchmark (12 measured pairs per workload). - Sparse synthetic placed heap, two toggled records per page, median ms: 4 pages 0.2255 -> 0.0595; 40 pages 2.0683 -> 0.4298; 200 pages 10.4618 -> 2.4501; 300 pages 16.2841 -> 3.8183. - Dense 40-page case, same two toggled records on each page with the other records populated: 0.6109 -> 0.6314 ms. This slight regression is why the change stays opt-in. - Regression covers clipped ranges, the end of the fingerprint cache, previously seen slots, and a nonzero byte at the edge of a candidate run. The native test checks occupied and cleared slots on every pass. Synthetic timings only; no measured gameplay FPS change.
Use exact byte and cache comparisons in groups of eight. Keep the existing record path for populated ranges and rewritten slots; no added worker threads and independent of parallel scanning.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:47 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 01:04 UTC · original

On the RX 7900 XT (Wine 11.22, RADV 26.3.1), the cold scan skipped 1,747,928 slots in the first room. I measured 5.73 FPS on and 5.95 off over about 78 seconds per setting. All four adjacent pairs favored off by 0.12–0.39 FPS. Separate-process controls agreed on the direction (5.68 on, 6.03 off). The sparse synthetic placed-heap test still showed a substantial CPU-time reduction. I’d keep this opt-in here.

The counterbalanced run gave me the full comparison in 286 seconds versus 458 seconds with two launches. The scan predicate also has a native Linux test now. Measurements and method · Portable fixture PR

**@⁠UwUCammie** on GitHub · 2026-11-26 01:04 UTC · [original](https://github.com/fxceless/victory-fork/pull/1220#issuecomment-7179405283) On the RX 7900 XT (Wine 11.22, RADV 26.3.1), the cold scan skipped 1,747,928 slots in the first room. I measured 5.73 FPS on and 5.95 off over about 78 seconds per setting. All four adjacent pairs favored off by 0.12–0.39 FPS. Separate-process controls agreed on the direction (5.68 on, 6.03 off). The sparse synthetic placed-heap test still showed a substantial CPU-time reduction. I’d keep this opt-in here. The counterbalanced run gave me the full comparison in 286 seconds versus 458 seconds with two launches. The scan predicate also has a native Linux test now. [Measurements and method](https://github.com/UwUCammie/victory-amd/blob/de7726f/benchmarks/README.md#time-to-compare-the-cold-descriptor-scan) · [Portable fixture PR](https://github.com/nicolasveilleux/victory-fork/pull/2)
Author
Owner

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

I benchmarked this PR next to #1293 and #1202, 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_ZERO_RUNS=1: 5.44 → 5.32 ms per frame on the RTX 4060 Laptop and 4.77 → 4.66 ms on the Intel UHD, which is within noise. That is expected: every record in this heap is non-zero, and the sparse case this PR targets is not modelled. 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/1220#issuecomment-7192924528) I benchmarked this PR next to #1293 and #1202, 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_ZERO_RUNS=1`: 5.44 → 5.32 ms per frame on the RTX 4060 Laptop and 4.77 → 4.66 ms on the Intel UHD, which is within noise. That is expected: every record in this heap is non-zero, and the sparse case this PR targets is not modelled. 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/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/1220/head:github-bot/gh-1220'
git switch 'github-bot/gh-1220'

Merge

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