Copy-back: look for changed runs a word at a time (same output, 4-6x faster search) #26
No reviewers
Labels
No labels
accessibility
bench-bm-v1
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/PastiiJay--klbf-lab!26
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-26"
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?
@spy0eye-beep on GitHub · 2026-11-25 17:24 UTC · original
spy0eye-beep:klbf-fast-copyback→beta· +102 −1 · 1 files · 1 commits · openWhat
A CPU-only speed-up in copy-back (
shadow.rsback_piece), with the same result byte for byte: nothing about what is drawn changes.After the merge,
back_piecelooks for the runs of changed bytes in each 64 KiB piece's mask, one byte at a time. Where a shader wrote here and there in a piece, the mask is mostly zeros, and that search ran at 2-4 GB/s. It now passes over zero words 8 bytes at a time (mask_runs), then finishes byte by byte as before.cargo test --release -p victory-gpu --lib mask_runs_speed -- --ignored --nocapture, i7-13620H:Same output
word_search_finds_the_byte_runs: random masks of every length 0-40 and 63, 64, 65, 4095, 4096, 65536 bytes, at five densities (dense to one byte per 4 KiB), runs touching word edges and the end. The runs equal those of the old byte-by-byte search, kept in the test as the reference.write_mapped) are unchanged, so title bytes between runs are still not written (upstream VIctory #2009).Testing
cargo test -p victory-gpu --all-featureson the RTX 4060 Laptop: 163 passed, 0 failed (shadowtests: 29 passed).beta(draw.rssort_unstable_by_key,indirect.rsdepth_written), none new. rustfmt: no new differences.AI-assisted (Claude).
🤖 Generated with Claude Code
@PastiiJay on GitHub · 2026-11-25 18:38 UTC · original
Thanks a lot @spy0eye-beep! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here.
@gmankab on GitHub · 2026-11-25 19:20 UTC · original
I ran
word_search_finds_the_byte_runsandmask_runs_speedon the exact PR head. The correctness test passed. On the Xeon E5-2670 v3, the dense mask was 1.69 → 1.68 GB/s, one changed byte per 64 bytes was 1.16 → 4.03 GB/s, and one per 4 KiB was 1.64 → 9.48 GB/s.I also ported the commit to FX with Rayane’s authorship preserved. All 30 of its shadow tests passed, and the mask scan showed a similar gain on sparse inputs. FX draft PR
Tested-on: Fedora Linux 45 x86_64, Wine in the Victory Flatpak with DRM hidden
Assisted-by: gpt-6.2 sol xhigh
@PastiiJay on GitHub · 2026-11-25 19:21 UTC · original
Thanks a lot @gmankab for measuring it, those are great numbers (up to ~6x on sparse changes), and for porting it to fxceless with Rayane's authorship kept. It's already in our next test build, and the results will be posted here.
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.