Shaders: a deep block's reach no longer hides a waterfall's proof #1550
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!1550
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1550/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?
@EduAzevedo on GitHub · 2026-11-24 19:03 UTC · original
EduAzevedo:fix/waterfall-meet-reach→main· +43 −1 · 2 files · 1 commits · closed without mergingTitle: Shaders: a deep block's reach no longer hides a waterfall's proof
What
15 programs (12 mesh, 3 vertex) were refused with "a waterfall loop whose compares do not select the access's lanes", although their loops are the plain LLVM waterfall:
v_cmp_eq_u64(the first in the VOPC form, into VCC);s_and_b64ands_and_saveexec_b64;s_xor_b64 execands_cbranch_execnz.Moving those loops into the unit tests (a sampler compared per lane, the image loaded inside the loop, VCC, inside a divergent
if, as Vs, Ps and Cs) doesn't reproduce the refusal: they all prove.The cause is in
Bools::meet(crates/victory-shader/src/structure.rs). It answers yes when its search exceedsMAX_MEETcase splits. In these programs the loop sits deep, around block 145, so itsreachis large. A local census inwaterfall()showed the solver's answers:reach,meet(&[(selected, true), (matched, false)])is false: the proof holds;reach, it is true: the search gave up.Adding a condition can only lower what meets, so that yes is the budget running out, not a lane.
Fix
Bools::meet_beside(aside, others)asksmeet(others)first. A no frommeetis exact, and fewer conditions are met at least as often, so a no there settles it. Only when the others can meet does it ask again withaside.waterfall()uses it with the block's reach asaside. No other caller changes.Tests
structure::tests::a_large_condition_aside_does_not_hide_that_the_others_never_meet. It builds a condition the search gives up on (the parity of 20 atoms) and checks:meetanswers yes;meet_besideanswers no for conditions that never meet;meet_besidestill answers yes for conditions that do.cargo test -p victory-shader: 121 passed, 1 ignored (as on main).cargo clippy -p victory-shader --all-targets: clean.Measured
victory translate --jobs 8 --list, offline, on my own retail dump (26,148 programs), mainffe310evs this branch:All 15 now pass resource tracking and stop at "a scalar memory read as data" (the #979 area), so DXIL emitted counts don't move on main alone.
With #979. I cherry-picked Machad3x's
bc2b1b5on main, with and without this branch:No shader names, disassembly or game data are included here, only counts.
AI-assisted. The measurement is offline, so no GPU was needed. Built and tested on Windows 11 (Ryzen 7 5700G, RTX 2070 SUPER, driver 610.88).
@sinan-cmyk on GitHub · 2026-11-24 19:33 UTC · original
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count changes against
main, and the tests pass on Ada.Offline. I merged head
6c9e0econtomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 on both, 0 gained, 0 lost. 15 programs that already fail move from "resources: a waterfall loop whose compares do not select the access's lanes" to "emit: a scalar memory read as data". So this PR gets them through resource tracking, and they now stop at the later scalar-read gap that #953, #1103 and #1319 address.This is the expected result for a correctness fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests. With the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 00:42 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Waterfall proofs hidden by a deep block's reach exhausting
Bools::meet: main fixed this in resource.rsmeet(small conditions first) and the refuted memo; that refusal class is 0.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