shaders: MOVREL waterfall proof and exact cost rewrites (VICTORY_*) #121
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!121
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-120"
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?
@SovietBearz0r on GitHub · 2026-12-05 13:17 UTC · original
SovietBearz0r:longroad-movrel-exact→main· +7650 −471 · 65 files · 48 commits · draftShader exactness/cost rewrites from longroad:
VICTORY_MOVREL_WATERFALL,VICTORY_MINMAX_NONZERO,VICTORY_MED3_CLAMP,VICTORY_LEGACY_MUL_FORMS.What
VICTORY_MOVREL_WATERFALL(on unless0): av_movrel*whose M0 holds a first-lane read defined in the same block joins the waterfall's compares/reads, so the M0-indexed loop is proven and runs once with each lane picking its register (main's per-lane movrel lowering already does the pick). Ported from longroadea1d83a2(Darnerde329bf); main already had the descriptor/first-lane proof machinery, only this proof was missing.emit/cost.rs+lower/operands.rs:MINMAX_NONZERO(min/max with a nonzero constant drops the two-zeros test; on unless0),MED3_CLAMP(median of value and two normal/infinite constants = clamp, console-exact+0where the general form leaves-0; on unless0),LEGACY_MUL_FORMS(legacy product identities; off unless1, since main already has its ownVICTORY_LEGACY_MULforms and host-RDNA forms that drop the zero test).TRANSLATOR_VERSION20→21 (default translations change). Original exactness/cost suite (emit/valu_tests/cost_checks.rs, GPU + WARP over ±0/denormals/NaNs/infinities) and the M0 waterfall test ported.LONGROAD_BIG_NO_BACK_MB(host/shadow GPU copy-back experiment, off by default, belongs with the heap-twin work).Verification
cargo test -p victory-shader --lib: 328 passed, 0 failed, 2 ignored (240 s), including the four new exactness/cost GPU+WARP tests (identical bits, fewer instructions via census) and the movrel proof test.cargo check -p victory,cargo xtask policy, clippy: clean.victory shadersre-translation counts. MOVREL touches loop proof — a too-loose proof would miscompile; the exactness tests are the guard.Source: Lesloo/longroad
ea1d83a2+ea580ea9.@ReTerryDavis on GitHub · 2026-12-05 17:39 UTC · original
Nice compact, well-tested shader win (great bit-exact GPU+WARP test coverage over ±0/denorms/NaNs)! Marking as draft for two quick items before merge:
crates/victory-shader/src/emit/valu_tests.rsafter #136 merged.MINMAX_NONZERO,MED3_CLAMP,MOVREL_WATERFALL) are default-on, please confirm one quick in-game visual sanity check after rebasing ontomain.Mark ready once rebased/checked and we'll get this in!
@SovietBearz0r on GitHub · 2026-12-05 18:55 UTC · original
Rebased onto current
main; the only conflict (tail ofemit/valu_tests.rs) is resolved by keeping #136's DPP/SDWA test block and appending the branch'smod cost_checks;after it (diff vs main is now exactly +2 lines there). Full shader suite 331 passed, including the bit-exact cost tests on hardware+WARP; clippy clean. Staying draft for the in-game visual sanity check you asked for on the three default-on rewrites — no game runs available here.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.