perf(victory-gpu): filter non-UAV barriers, scope buffer UAV barriers, and deduplicate consecutive UAV waits #474
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!474
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-474"
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?
@mauroalvare on GitHub · 2026-11-27 01:13 UTC · original
mauroalvare:rt/passes/scoped-barriers-and-dedup→main· +803 −36 · 5 files · 1 commits · openChange
Eliminates redundant and overly broad global NULL UAV barriers along the ray-tracing dispatch, enhanced-barrier, and indirect-argument clamp paths in
third_party/victory/crates/victory-gpuwhile preserving every producer-consumer ordering guarantee:host/rec.rs,indirect.rs,indirect/batch.rs):Recnow tracksuav_synced(set when a global NULL UAV barrier is emitted/held, reset on any non-barrierDerefcommand) and collapses duplicate global/per-resource UAV barriers in contiguous barrier batches without altering any transition or aliasing barrier.indirect::clamp_intoandindirect::open_batchquerylist.list.is_uav_synced()so an indirect dispatch immediately following a titlebarrier()/barrier_groups()/sync()does not emit a second back-to-back global NULL UAV barrier.indirect::record_clamp_asdrops its redundant post-clamp global NULL UAV barrier (matchingbatch::record), because theUNORDERED_ACCESS -> INDIRECT_ARGUMENTtransition ondstalready orders clamped indirect arguments forExecuteIndirect.list.rs):barrier()skips emitting a UAV wait forBEGIN_ONLYsplit buffer barriers and pure read-to-read buffer transitions (neither state is a write orCOMMONstate).Shadow(shadow::peek), emits a resource-scoped UAV barrier onshadow.buffer(kept alive on the list) instead of a GPU-wide NULL UAV barrier; falls back conservatively to global NULL UAV when no singleShadowcovers it.list.rs,list/thin.rs):barrier_groups_need_uav()inspectsD3D12_BARRIER_GROUPentries (both directly inlist.rsand at thin-list recording time inlist/thin.rs) and skips emitting a global NULL UAV barrier when all groups are empty (NumBarriers == 0),D3D12_BARRIER_SYNC_NONE, or pure read-only /NO_ACCESStransitions.COMMON/null/unknown barrier group still conservatively syncs.Verification
Tested locally on Windows x64 with NVIDIA GeForce RTX 5070 Ti (driver 621.40, Wave32, SM 6.6):
Synthetic Multi-Pass RT Tile-Stream Benchmark (RTX 5070 Ti, hardware D3D12 timestamps, 256 dispatches across 8 streams, 30 FPS budget = 33.333 ms)
RecUAV dedup)Oracle and test data
host/rec.rs,list.rs); no game files or assets.host::rec::tests::consecutive_global_uav_barriers_collapse_while_keeping_transitionslist::tests::classic_buffer_barrier_skips_split_begin_and_read_to_readlist::tests::enhanced_barrier_groups_filter_empty_and_read_only_groupshost::rec::tests::rt_barrier_scoping_and_dedup_benchverifies bit-exact producer-consumer readback across 32 chained passes per stream.Checklist
E_NOTIMPL), never a fake success.Made with AI assistance (Antigravity / Gemini).
@mauroalvare on GitHub · 2026-11-27 01:22 UTC · original
Independently verified
b6b8c72ce4f7b4779b649673cb19d88b498b42c6on RTX 5070 Ti, driver 621.40, release.list::passed all 7 tests. The published 256-dispatch fixture kept its producer-consumer readback bit-exact. Its GPU median went from 0.1601 to 0.1278 ms (20.2% less) and CPU recording from 0.1818 to 0.0849 ms.I also compared two builds with RT enabled. I reused the #472 1920×1080 movable-occluder fixture, with one dispatch through each build’s production
record_clamp_as. The two builds werea40ed684341fbd2cc6d27c171af9ae27bbc56018(functional pass baseline) andb6b8c72ce4f7b4779b649673cb19d88b498b42c6. Both executed 2,073,600 rays with 24 warmups and 120 measured frames per mode, twice in base/head/head/base order. All four output hashes matched the #472 baseline.The single-clamp scene’s GPU median changed by about 0.1 µs. The full-frame shift was within repeat variation. The tile stream workload isolates repeated barrier costs, and the movable-occluder workload verifies the single production clamp in a complete synthetic pass sequence.
The local registry contains
pr474-clamp-base.patch,pr474-clamp-head.patch, and the exact sharedpr474-clamp-probe.rs. With the overlays present (the head also needs the shared probe copied tosrc/rt_passes_tests.rs), the two-build filter isrt_passes_tests::rt_passes_validation_baselinewith the same release and test flags. Thepr474-clamp-{base,head}-{a,b}logs include raw timings and output hashes.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.