perf(gpu): batch scattered indirect clamps and coalesce ready queue parts #43
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/43"
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 Vladimir-Human on 2026-11-25T21:05:50Z.
AI-assisted clean-room contribution (
victory-gpu, D3D12 unit/WARP/hardware tests + synthetic indirect & ready-queue benchmarks only — no title files used).Summary
Combines scattered indirect argument clamping (
VICTORY_INDIRECT_GATHER, on by default, off via=0) and ready-queue adjacent part coalescing (VICTORY_JOIN_PARTS, on by default, off via=0) acrosscrates/victory-gpu/src/{draw.rs, host.rs, indirect.rs, list.rs, queue.rs}while integratingklbf-lab's existingBufferStates(ae89047) and compute group diagnostics (015af28):indirect.rs,draw.rs,list.rs,host.rs):GATHER_PASS1_CS -> GATHER_PASS2_CS) with batched mid-pass UAV barriers acrosscosts_res,budget_res, and distinct destination chunks.record_pending_scalarfalls back under allocation failure, caps rawByteAddressBufferelement counts at(1 << 30) - 1(4 GiB - 4 B), and callssources_read(clamps, ...)forBufferStates.queue.rs,host.rs):Partsubmissions underVICTORY_JOIN_PARTS, blocking coalescing onbacks/texture_backs/back_wanted, overlappingGpuWrite/writesvsblocked_by/Refresh/cross-shadow aliasing, WAR hazards (Refresh/TexturevsCopy/Step::Run), andHeld::Valuewait-range writes (lists_write_range).git merge-treeclean againstbeta(e328c88),#15,#41,#42, and our pending lazy-copyback/VRAM branches.Verification (
betae328c88, RTX 4070 SUPER / i5-13400F)cargo clippy -p victory-gpu --all-targets(default&--features diagnostics): 0 warnings in added/modified code.cargo test -p victory-gpu -- --test-threads=1: 161 passed, 0 failed (5 ignored).VICTORY_D3D12_DEBUG=1 VICTORY_REQUIRE_HW_GPU=1 cargo test -p victory-gpu --features diagnostics -- --test-threads=1: 169 passed, 0 failed (6/6livehw_gather_/hw_coalesce_tests including multi-frameHostList::resetreuse with 0 D3D12 debug errors/warnings), and kill switches (VICTORY_INDIRECT_GATHER=0,VICTORY_JOIN_PARTS=0,VICTORY_HOIST_CLAMPS=0) all pass.86.56xat 256 buffers);join_parts7.47x–12.89x (16 -> 1submissions).Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T21:08:01Z.
Thanks a lot @Vladimir-Human! The indirect clamps are one of the costs we are looking at right now, so this one goes first in our queue. We test one change at a time on the RX 9070 XT (same save, same 7-minute run, fps and picture compared with our reference build, with and without
VICTORY_INDIRECT_GATHER/VICTORY_JOIN_PARTS). Results will be posted here.Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-25T21:20:18Z.
I ran both switches independently on Microsoft WARP at
4f71557, using the PR source unchanged. WithVICTORY_JOIN_PARTS=0, the queue fixture observed four submissions. At=1, it observed one, with the same four written values. The unsatisfied-wait and intervening-fence checks passed in both runs. WithVICTORY_INDIRECT_GATHER=0and=1, the end-to-end test read back the expected indirect arguments, including the clamped record. Each setting ran in a fresh process and required a D3D12 device. All four runs passed. Windows test logThat gives the RX 9070 XT comparison a correctness baseline for the two switches. The software-adapter tests did not measure in-game timing.
Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T21:21:12Z.
Thanks @HandshakeHackin, that's exactly the baseline we wanted before the hardware runs. What we keep: on WARP, with each switch tested on its own in a fresh process,
VICTORY_JOIN_PARTS=1folds four submissions into one with the same written values and the wait/fence checks still passing, andVICTORY_INDIRECT_GATHERreads back the expected indirect arguments either way, clamped record included.So when we run #43 on the RX 9070 XT, any difference we see in fps or picture comes from the GPU path, not from correctness. We'll post the on/off results for both switches here.
Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-28T18:35:42Z.
Superseded by https://github.com/PastiiJay/klbf-lab/pull/188 cleanly ported onto
origin/stable-amd(75022ba).Pull request closed