Repository navigation
GPU: Speed up shadow buffer writeback merging - #2054
GaussianGuaicai wants to merge 1 commit into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Shadow buffer writeback merging sped up — perf work on the writeback path; benchmark evidence would help but the change is plausible.
Keep bytewise guest/GPU reconciliation semantics unchanged. Verified the source oracle with exact extracted code, measured sparse and dense synthetic merges, and cross-checked all workspace tests/features for Windows. Native source GPU test results report the same single unrelated failure on their baseline.
|
The 64 KiB piece size used in
Each row processes 1 MiB total, split into equal spans. Windows/MSVC, rustc 1.98.1 The four-byte row deliberately calls the merge on every span, including unchanged ones. The saved-page path does that after clipping; the other caller first checks |
|
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at AI-assisted (Claude Code). |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib shadow::— 5 passed, 0 failed (includingwriteback_merge_matches_bytewise_oracle)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean fast-path shadow-buffer writeback merging verified against a bytewise oracle. Looks good.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. In Overlap: #1867 does the same merge with AVX2, CI: passing ( Recommending a look, not approving. Generated by Claude Code |
Xvania7
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, head 857f630, Windows 10 x64 19045, NVIDIA GeForce RTX 5060, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib -- --test-threads=1 shadow::tests::— 4 passed, 0 failedcargo test -p victory-gpu --lib -- --test-threads=1 host::tests::— all 6host::tests::*passed (1 unrelated baseline failure on NVIDIA indescriptor::host::tests::dynamic_slots_are_held_until_releaseddue to #1835)cargo clippy -p victory-gpu --all-targets -- -D warnings— 0 warningscargo xtask policy— 182 files ok
Clean optimization to shadow buffer writeback merging.
Share a branch-free byte merge between the two shadow-buffer writeback paths so the compiler can vectorize the loop. The GPU byte still wins only when it differs from the saved byte; otherwise the guest byte is preserved. The helper reports whether guest memory needs to be written, as before.
Validation
cargo test --locked -p victory-gpu --lib --features diagnostics: 146 passed, 1 failed, 2 ignored. Unmodified base940d32f: 145 passed, 1 failed, 2 ignored. Both failed the same assertion indraw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view.git diff --checkpassed.An earlier diagnostic comparison measured merge cost of 0.392 vs. 0.088 ms/MB. The workloads differed; this measures only the merge step and does not establish an end-to-end frame-time improvement.
Prepared with assistance from GitHub Copilot.