Reuse changed-byte runs across shadow pages #925
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!925
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-925"
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?
@alpz1000 on GitHub · 2026-11-25 13:01 UTC · original
alpz1000:perf/reuse-shadow-change-runs→main· +75 −30 · 1 files · 3 commits · openShadow::merge_under_writesbuilds a new vector of changed-byte runs for every stale page. The optional gap pass can allocate a second vector, and the diagnostic counters take two atomic updates for every run.This patch reuses one run vector across pages, joins optional gaps in place, and updates the run and byte counters once per page. It preserves both upstream scan implementations, including the newer SIMD path. The default gap of zero still sends the exact changed bytes. The per-submission run cap is checked before modifying the card-backed page.
Validation on Windows with an i5-8400
9c184b3and rancargo test --profile diag --locked -p victory-gpu --features diagnostics --lib merge_tests. All seven matching tests passed, including upstream’s byte-by-byte reference test for the SIMD scan and the test that reuses one scratch buffer across joined, exact, and unchanged pages.-C opt-level=2, medians of 17 alternating batches went from 368 to 322 ns per unchanged page, 414 to 365 ns per sparse page, 1,412 to 1,156 ns per fragmented page, and 548 to 475 ns per dense page. Gap was zero. The benchmark covers scanning and allocation.AI-assisted with OpenAI Codex.
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.