victory-shader: lower all-zero and all-one constant lane masks #1057
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!1057
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1057/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?
@bartikele on GitHub · 2026-11-24 15:21 UTC · original
bartikele:shader-constant-lane-mask→main· +4 −0 · 1 files · 1 commits · closed without mergingLowers \Atom::Constant(0)\ to \alse\ and all-ones constant lane masks (\u64::MAX, or \u32::MAX\ in wave32) to \ rue\ without requiring \console_lanes\ or \WAVE_OPS.
Verified with \cargo clippy -p victory-shader --all-targets --locked -- -D warnings, \cargo test -p victory-shader --locked, \cargo xtask policy, and \ictory translate --validate.
@shortselow-byte on GitHub · 2026-11-24 16:09 UTC · original
This PR has no CI run yet, so I ran the CI's checks at head
a793ad8(onmainffe310e): Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT (RDNA2). Workspace tests 342 passed, 0 failed (GPU tests on the AMD device and WARP); both clippy runs (default and--all-features) clean;cargo xtask policyok.The change reads right to me: 0 is no lane,
u64::MAXis every lane, andu32::MAXcounts as every lane only for a wave32 program (!native.wave64), so a wave64 mask of just the low 32 lanes still goes through theconsole_lanespath.It adds no test, though. A small one that lowers a program comparing against an all-ones mask and checks that it no longer needs
console_lanesor wave ops would keep this from regressing.@Zipettte on GitHub · 2026-11-24 16:30 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
a793ad8:cargo test -p victory-shaderpasses, 120 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@avt0m4t48 on GitHub · 2026-11-24 19:30 UTC · original
I ran a synthetic before/after check for the regression requested above. Base translator
ffe310e, then the four-linelower.rsdiff froma793ad8, Rust 1.98.1 on Linux.I prepended
s_mov_b32 exec_lo(wave32) ors_mov_b64 exec(wave64) with each of0,-1, and5to a synthetic pixel emitter fixture. Both branches emitted byte-identical DXIL for the four zero/all-ones combinations. Both still refused the two partial-mask combinations witha constant lane mask. No title data or GPU execution.A separate structurer test confirmed why. On both wave widths, zero becomes
Bool::FALSE, all-ones requires no guard, and only the partial-mask control producesAtom::Constant(5). The PR's new terminal-value cases therefore aren't exercised by these production translation paths. A shader that reaches the actual refusal would need a nontrivial constant mask or a different constructor.@bartikele on GitHub · 2026-11-24 20:34 UTC · original
Closing as redundant: as @DoubleD17 showed, \structure.rs\ already collapses all-zero and all-one masks to \Bool::FALSE\ / \Bool::TRUE, making these \Lower::atom\ arms unreachable (also confirmed on \shaders.rpf\ by @mercuryVM). Thanks to @DoubleD17, @catminou4, @mercuryVM, and @shortselow-byte for the thorough verification and review!
Pull request closed