Shader: lower WQM QuadAny, clamp LDS accesses, and guard loop budgets & barriers #292
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!292
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@wbkepler on GitHub · 2026-11-24 02:05 UTC · original
wbkepler:shader/fix-wqm-and-hangs→main· +1293 −112 · 4 files · 1 commits · openSummary
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)@jeremygold02 on GitHub · 2026-11-24 04:17 UTC · original
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
@wbkepler on GitHub · 2026-11-24 20:46 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 00:26 UTC · original
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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.