Shader: lower WQM QuadAny, clamp LDS accesses, and guard loop budgets & barriers #292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/292"
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 Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T02:05:11Z.
Summary
Fixes shader WQM divergence, out-of-bounds LDS accesses, and GPU loop/barrier hangs across
victory-shader:QuadAnylowering:Atom::Quad(Value, Bool)fors_wqm_b32/s_wqm_b64and lowers it to SM 6.6dx.op.quadOp.i32OR-reduction (QuadAny) in pixel/4-aligned mesh shaders andwaveReadLaneAtquad OR-reduction in console-lane compute shaders instead of hardcodingtrue, plus scalar SWARs_wqm_b32/s_wqm_b64.ds_read*dword indices into0..lds_dwords(returning0when OOB) and bounds-checksds_write*and LDS atomics againstlds_dwords.s_barriersafety:StepTrack(separate lane-loop and group-uniform barrier-loop budgets) and enablesVICTORY_SHADER_LOOP_LIMITin release builds.s_barriervia immediate post-dominators, preserves per-laneEXECguards inside them, and lifts branch conditions withdx.op.waveAllTrue/dx.op.waveAnyTrue.dxil.dll+ D3D12 hardware/WARP execution tests.Verification
cargo clippy --workspace --all-targets— passed (zero new warnings)cargo clippy -p victory --features diagnostics --all-targets— passedcargo test --workspace— passed (victory-shader: 75/75 passing)cargo xtask policy— passed (151 files ok)upstream-sync referenced this pull request2026-11-24 06:52:50 +00:00
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:17:52Z.
Tested PR #292 at head
a2a1b1e9445242777a6a566637432e601a0c600d(state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged ata2a1b1e9445242777a6a566637432e601a0c600d.cargo test --locked -p victory-shader wqm_tracks_source_mask_and_folds_constants— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.00s ); cases: structure::tests::wqm_tracks_source_mask_and_folds_constants.cargo test --locked -p victory-shader barrier_branches_keep_inner_guards_unless_barrier_post_dominates— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.00s ); cases: structure::tests::barrier_branches_keep_inner_guards_unless_barrier_post_dominates.cargo test --locked -p victory-shader nested_loops_share_invocation_step_budget— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.45s ); cases: emit::valu_tests::nested_loops_share_invocation_step_budget.cargo test --locked -p victory-shader divergent_loop_and_barrier_branches_do_not_deadlock— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.62s ); cases: emit::valu_tests::divergent_loop_and_barrier_branches_do_not_deadlock.cargo test --locked -p victory-shader s_wqm_pixel_loop_and_skip_run_per_quad— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.36s ); cases: emit::valu_tests::s_wqm_pixel_loop_and_skip_run_per_quad.cargo test --locked -p victory-shader oob_lds_reads_writes_and_atomics_clamp_and_drop— passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 74 filtered out; finished in 0.37s ); cases: emit::valu_tests::oob_lds_reads_writes_and_atomics_clamp_and_drop.Behavior covered: Checks WQM source-mask propagation, barrier guard preservation, divergent-loop budgets, per-quad behavior and clamped out-of-range LDS operations.
Code: crates/victory-shader/src/emit/lower.rs, crates/victory-shader/src/structure.rs
Imported from Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T20:46:38Z.
Rebased onto current main (
ffe310e) ase065026; add/add conflicts in structure.rs and valu_tests.rs were kept on both sides, and the new test helpers now callresource::trackwith the structured lanes as main's signature requires. Gate clean.AI-assisted (Claude Code); checked on Windows 11 / RTX 5090.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:17Z.
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-shader/src/emit/lower.rs,crates/victory-shader/src/emit/valu_tests.rs,crates/victory-shader/src/structure.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.