Coalesce changed buffer bytes directly for the 64-byte merge gap #1158
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1158
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1158"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@BradRoland on GitHub · 2026-11-25 22:02 UTC · original
BradRoland:codex/coalesce-shadow-merge-gaps→main· +147 −3 · 1 files · 1 commits · openThe run 219 notes describe about 38,000 changed byte ranges across roughly 100 pages per frame. With
VICTORY_MERGE_GAP=64, the card-buffer path built a vector of every exact range and then walked it again to join nearby ranges. This patch joins them as the SIMD comparison produces each 64-byte difference mask. Any two set bits in one mask are at most 62 equal bytes apart, so its first and last set bits suffice. The existing gap rule applies across masks and to the tail.The fast path runs on x86-64 when the wide comparison is active and the gap is 64. The default gap, the scalar comparison, and the existing run budget keep their behavior.
Synthetic benchmark on an i9-12900K, 4 MiB in 64 KiB pages. Times are median microseconds across seven release processes. Each process measured 15 alternating before/after pairs after warm-up. The benchmark checks the returned ranges before timing.
The clustered case took 43% less time. The all-changed case took 21% more. These timings cover the changed-range scan. Gameplay frame time remains unmeasured.
cargo test --release --locked -p victory-gpu --lib joined_page_runs_bench -- --ignored --nocapture.VICTORY_CHANGED_RUNS=0,1, andalt.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.