gpu: scope card-compare and card-steps prelude UAV barriers to touched buffers #2606

Merged
nidea1 merged 1 commit from upstream-pr/2606 into main 2026-11-30 14:12:02 +00:00
nidea1 commented 2026-11-29 14:54:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-11-29T14:54:04Z.


Summary

Replaces the remaining host-emitted global (NULL) UAV barriers in Host::check (card-side shader-write compare prelude) and card_steps::record (GPU-side buffer fill/copy replay) with deduplicated per-resource UAV barriers covering only the touched buffers:

  • crates/victory-gpu/src/host.rs:
    • Adds COM-safe borrowed-pointer uav_barrier() and scoped_uav_barriers() helpers (using ManuallyDrop / transmute_copy without touching COM refcounts).
    • Replaces the global NULL UAV barrier before CARD_COMPARE in Host::check (~325 passes/frame) with scoped UAV barriers over {r.shadow.buffer, before, shared.differs.0} (deduplicated by raw pointer).
  • crates/victory-gpu/src/host/card_steps.rs:
    • Replaces the global NULL UAV barrier at level == 0 in record() (5,900+ fills/frame) with deduplicated scoped UAV barriers covering every buffer touched across all 0..levels passes.

Verification

  • cargo test -p victory-gpu --lib -- card_steps host::batch:: host::tests::: 119 passed, 0 failed (including new real-GPU RTX 3060 Ti tests exercising heavy 256-group x 64-thread compute UAV writes into 1-ECL CARD_COMPARE and 2-ECL multilevel card_steps with 0 D3D12 debug errors).
  • cargo clippy -p victory-gpu --tests: 0 warnings in touched lines.
  • cargo xtask policy --staged: passed.
  • Live VICTORY_BARRIER_STATS=1 on RTX 3060 Ti: shifts ~820–1,650 barriers/frame from global UAV to per-resource UAV, leaving host-emitted global UAV barriers near zero while title UAV waits remain intact.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551890657 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2606). Originally posted by [nidea1](https://github.com/nidea1) on 2026-11-29T14:54:04Z. --- ## Summary Replaces the remaining host-emitted global (`NULL`) UAV barriers in `Host::check` (card-side shader-write compare prelude) and `card_steps::record` (GPU-side buffer fill/copy replay) with deduplicated per-resource UAV barriers covering only the touched buffers: - **`crates/victory-gpu/src/host.rs`**: - Adds COM-safe borrowed-pointer `uav_barrier()` and `scoped_uav_barriers()` helpers (using `ManuallyDrop` / `transmute_copy` without touching COM refcounts). - Replaces the global `NULL` UAV barrier before `CARD_COMPARE` in `Host::check` (~325 passes/frame) with scoped UAV barriers over `{r.shadow.buffer, before, shared.differs.0}` (deduplicated by raw pointer). - **`crates/victory-gpu/src/host/card_steps.rs`**: - Replaces the global `NULL` UAV barrier at `level == 0` in `record()` (5,900+ fills/frame) with deduplicated scoped UAV barriers covering every buffer touched across all `0..levels` passes. ## Verification - `cargo test -p victory-gpu --lib -- card_steps host::batch:: host::tests::`: 119 passed, 0 failed (including new real-GPU RTX 3060 Ti tests exercising heavy 256-group x 64-thread compute UAV writes into 1-ECL `CARD_COMPARE` and 2-ECL multilevel `card_steps` with 0 D3D12 debug errors). - `cargo clippy -p victory-gpu --tests`: 0 warnings in touched lines. - `cargo xtask policy --staged`: passed. - Live `VICTORY_BARRIER_STATS=1` on RTX 3060 Ti: shifts ~820–1,650 barriers/frame from `global UAV` to `per-resource UAV`, leaving host-emitted global UAV barriers near zero while title UAV waits remain intact.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!2606
No description provided.