Repository navigation
Conversation
…moves (fixes #750) Upstream: Marvisak#1182 by @R0D4X
|
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
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. |
…tor word across redundant masked moves (fixes Marvisak#750) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 8c94b5c on Windows 11, RTX 5070, MSVC:
cargo test -p victory-shader -- --test-threads=1passes on the head (125 passed, 1 ignored), including the new waterfall tests.- Merged into our fork: workspace tests, shader tests and
clippy -D warnings(default and all features) are all clean.
The reasoning is sound:
- The redundant-move proof only asks about the lanes that run the masked
v_mov_b32(known ∧ reach ∧ guard). Lanes that don't run it keep the old value by definition, so proving old == src on the running lanes means the result is the old value everywhere. - An infeasible lane set counts as vacuously equal.
- Back-edge phis are refused.
- Integer-only negation in
CompareKeyavoids the NaN trap of folding float compares.
A static measurement on a full game package, counts only: no program there hits "a per-lane descriptor written where some lanes may keep the old one", either before or after this PR. So this frees nothing in that package, and changes nothing either (0 programs change result). Both the fork and upstream are neutral on it.
AI-assisted (Claude Code).
…oss redundant masked moves (fixes Marvisak#750)
…oss redundant masked moves (fixes Marvisak#750)
Where a fork-only change duplicates upstream's own version of a feature, upstream's is kept and the fork's dropped: - victory-shader is upstream's crate with the fork-only merges replayed onto it oldest first; those that do not apply onto upstream are dropped (37 of 63: among them Marvisak#704/raw views, gather4_l, the lane-mask and Marvisak#308 ports, Marvisak#947, Marvisak#1022, Marvisak#1112, Marvisak#1090, Marvisak#1182). Marvisak#284 (legacy fused madds) and Marvisak#98 (permlane16 in whole-wave sections) are dropped too: the first disagrees with upstream's hardware-checked model, the second refused 46 programs upstream translates. - translate: upstream's --cache replaces Marvisak#254's write-cache and work queue; Marvisak#378, Marvisak#517, Marvisak#673 and the victory.toml console are re-applied. - victory-gpu: upstream's stride table, page table and heap views replace the fork's Marvisak#704/stride-table wiring; fork-only fixes re-applied on top. Package (shaders.rpf, translate --validate --list, counts): vertex/pixel emitted 12559 -> 14295 of 14337, compute 2359 -> 2628 validated, mesh 2730 -> 2811 validated. Tests: the failures left (rect fourth corner, two stride tests, row order, gather4 at a level, memory table, dynamic heap slots) fail on upstream main as well on this host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Automated triage for the maintainers. Closing because this change is already in 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. |
Summary
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 Shader resource tracking: redundant masked write after a per-lane descriptor join is refused (synthetic repro on #566) #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).