Shaders: keep prior per-lane descriptor word across redundant masked moves (fixes #750) #1182
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!1182
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1182/head"
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?
@R0D4X on GitHub · 2026-11-24 16:21 UTC · original
R0D4X:fix/issue-750-redundant-per-lane-write→main· +540 −7 · 2 files · 1 commits · closed without mergingSummary
Fixes #750.
When a per-lane descriptor joined across control flow is followed by a plain predicated
v_mov_b32that re-writes one of its VGPR words with the exact value every active lane already holds,Tracer::lane_valuepreviously refused the program with"a per-lane descriptor written where some lanes may keep the old one".What changed
crates/victory-shader/src/resource.rs:Tracer::redundant_vmovandTracer::equals_under: whenTracer::runscannot prove that every lane inknownexecutes a plainv_mov_b32, check whether the destination VGPR's prior SSA value (inst.read(Reg::V(reg))) already equals the move's source on every feasible active lane (known ∧ reach[site] ∧ guard, walking forwardphis andv_cndmask_b32joins). If proven, the move is a no-op andlane_valuecontinues from the prior VGPR value; otherwise the conservative refusal is unchanged.Tracer::lanes_meet(with canonical purev_cmp*/v_cmpx*comparison keys and BDD-order backtrackingmeet_equiv, fast-pathing straight throughBools::meetwhen no two lane-compare atoms share a key) so repeated comparisons of identical SSA operands (including operand swaps and integer negations, without unsafe float NaN negations) are recognized as equivalent without mutatingstructure::Bools.resource::testscovering the exact #750 repro, a negated integer compare on theelsearm, and two negative cases (writing the other arm's word; writing under a wider predicate mask) that must still be refused.crates/victory-shader/src/emit/waterfall_tests.rs:lanes_sample_their_arm_after_a_redundant_masked_writeto verify DXIL lowering,dxil.dllvalidation, and end-to-end execution on both host GPU hardware and D3D12 WARP.Verification
cargo xtask policy: passed (154 files ok)cargo clippy --workspace --all-targets -- -D warningsand--all-features: passedcargo test --workspace: 347 passed, 0 failed (includingvictory-shader125/125, running the new waterfall test on RTX 5080 + WARP withdxil.dllvalidation)victory translate --listover 26,096 title programs): 0 regressions (25,736 / 26,096tracked before and after; no game data or dumps included).@pablogonz12 on GitHub · 2026-11-24 17:27 UTC · original
Setup: Linux, RX 9070 XT, RADV (Mesa 26.3.1), dxil-spirv master, spirv-val 1.3. Your head folded onto a base of origin/main
ffe310eplus #1017 (main's host build fails without it:E0425 host_resource), then the four-stage offline check over 768 programs (751-program world dump + 52-program BVH capture, 35 duplicate containers skipped).No program gained or lost and the failure table is identical to the base, reason for reason: nothing in this capture reaches the class you handle, so this is a no-regression result only (same 10 SPIR-V validation failures as the base).
Not tested: in-game.
@Zipettte on GitHub · 2026-11-24 18:00 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
8c94b5c:cargo test -p victory-shaderpasses, 125 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Marvisak on GitHub · 2026-11-25 00:34 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Fix for #750 ('per-lane descriptor written where some lanes may keep the old one'): that refusal class is 0 in main after today's lane-condition fixes; same issue as #1229.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed