Copy-back: look for changed runs a word at a time (same output, 4-6x faster search) #26
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from PastiiJay/klbf-lab. Originally posted by spy0eye-beep on 2026-11-25T17:24:07Z.
What
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
Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T18:38:10Z.
Thanks a lot @spy0eye-beep! Noted. It goes into tonight's RX 9070 XT test queue and I'll report the result here.
Imported from PastiiJay/klbf-lab. Originally posted by gmankab on 2026-11-25T19:20:29Z.
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
Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T19:21:57Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.