Repository navigation
Shadows & watch: fused AVX2 word_runs_and_update, linear stale_pages_in, and sorted Journal::ahead - #1637
Shadows & watch: fused AVX2 word_runs_and_update, linear stale_pages_in, and sorted Journal::ahead#1637Bazovsky wants to merge 1 commit into
Conversation
|
@Bazovsky — ran a 20-minute gameplay A/B of the Verification
20-minute A/B (with draw-bucket & copy-throughput normalization)
(Note: overall unweighted |
|
Tested this part (sorted, disjoint GPU and profile: NVIDIA RTX 5070 12 GB, AMD Ryzen 9 9950X3D, 31 GB RAM, Windows 11 26300; Series X profile, 2560x1440, release builds, steady-window medians. |
…in, and sorted Journal::ahead
b366bb9 to
03d5f57
Compare
|
Thanks @POMXARK for the 20-minute Rebased onto |
|
@Bazovsky — quick follow-up data point on
Clean-room writeup & standalone repro suite: https://github.com/POMXARK/bcpack-gpu-hlsl/blob/main/docs/PERF_REPRO_AND_TUNING.md |
The pass over the textures picked by index walked a placed view's pages (VirtualQuery, whole textures at a time) before it asked whether the card's fullness holds the slot: held ones threw the answer away. The held decision is made first now, and held ones are counted where they skip the walk (HEAP_TEXTURES_HELD_SKIP, in the 5 s line). What changes besides the order: a held slot that streamed out is told Held without the walk (it was told Away), and its host copy is not let go until a pass with room walks it again — about four seconds, or as soon as the card has room. Point 4 of trustno1-coder#1521; the issue's other three are covered by 0174844 (the shadow copy state lock, merged) and the open trustno1-coder#614, trustno1-coder#1133, trustno1-coder#1556, trustno1-coder#1637. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Thanks @POMXARK for the |
|
Tested on 9800X3D (AVX2) + RTX 5070 Ti 16 GB in a combined perf stack across 20+ min sessions. Zero shadow/watch regressions; combined stack cut write-watch time from ~4.5 ms to ~1.9-2.3 ms/frame. |
Fixes #
What it changes
Cuts CPU work in shadow CPU-side diff/copy (
under) and write-watch / stale-page lookups (ref):word_runs_and_update(crates/victory-gpu/src/shadow.rs): when updating card-backed shadow copies inShadow::take, comparestitleagainstheldand writes updated 32-byte vectors toheldin one AVX2 pass instead of runningword_runsand then re-scanning withcopy_from_slice. Falls back todword_runs+copy_from_sliceon unaligned or non-AVX2 paths.stale_pages_in(crates/victory-gpu/src/shadow.rs): advances a single linear cursor over the sortedwrittenslice after one initialpartition_pointinstead of binary-searchingwrittenfor every page inlo..hi.Journal::ahead+ahead_containsbinary search (crates/victory-gpu/src/watch.rs): keepsJournal::aheadsorted and non-touching acrossask_aheadandask_rest, usesahead_contains(linear for<= 8entries,partition_pointabove), and inask_resttries mergedkernel_writtenfirst with a per-piece fallback so a touching unwatched or separate reservation never prevents caching its watched neighbour.word_runs_and_update_matches_word_runs_and_copies_exactly(aligned random, unaligned/odd fallback, all-differ, none-differ), expandedpages_never_taken_are_stale_written_or_not(cursor skips belowlo, gaps, and pasthi), and addedask_rest_falls_back_per_piece_when_touching_unwatched_neighbourandahead_contains_matches_linear_over_binary_threshold.How it was tested
RUSTFLAGS="-C target-cpu=znver5") on cleanorigin/main(d4b5d51), 90 s same-session A/B runs (aligned steady window DLSS frames 100..1800, 0 D3D12 errors).d4b5d51): median 26.80 ms (37.3 fps), p95 36.30 ms, Prep 26.05 ms (ref=7.50 ms,under=2.05 ms), GPU busy 63%, 1,839 DLSS frames in 90 s.pr/shadow-watch-fused,b366bb9): median 25.40 ms (39.4 fps, +2.1 fps / +5.6%), p95 32.55 ms (-3.75 ms), Prep 24.40 ms (-1.65 ms) (ref=6.95 ms (-7.3%),under=1.45 ms (-29.3%)), GPU busy 67%, 1,908 DLSS frames (+69) in 90 s.cargo testpassed for the crates it touches: yes (victory-gpu: 553 passed, 0 failed — 514 non-watch + 39watch::testsserial;clippy+--features diagnosticscheck clean with 0 new warnings).Checked for overlap
Journal::aheadinwatch.rs; no open PR touches fused AVX2word_runs_and_updateor linearstale_pages_ininshadow.rs).