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

Open
nicolasveilleux wants to merge 1 commit from upstream-pr/1220 into main
nicolasveilleux commented 2026-11-26 00:28:56 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by nicolasveilleux on 2026-11-26T00:28:56Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6616679706 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1220). Originally posted by [nicolasveilleux](https://github.com/nicolasveilleux) on 2026-11-26T00:28:56Z. --- 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.
UwUCammie commented 2026-11-26 01:06:18 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-26T01:04:27Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7179405283 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1220#issuecomment-7179405283). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-26T01:04:27Z. --- 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)
KainanP commented 2026-11-26 14:03:29 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by KainanP on 2026-11-26T13:08:12Z.


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://github.com/fxceless/victory-fork/pull/1293#issuecomment-7192923419

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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7192924528 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1220#issuecomment-7192924528). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-26T13:08:12Z. --- 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://github.com/fxceless/victory-fork/pull/1293#issuecomment-7192923419 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 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/1220:upstream-pr/1220'
git switch 'upstream-pr/1220'

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