fix(shader): decode scalar NULL operand as Bool::FALSE in lane mask analysis #3369
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!3369
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3369"
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?
@reeledMarek on GitHub · 2026-11-26 20:40 UTC · original
reeledMarek:fix/shader-structure-null-operand→main· +22 −1 · 1 files · 1 commits · openSummary
Lanes::operandguarded scalar operands withif code != NULL, letting scalarNULL(code 125, which always reads as 0) fall through to_ => return None.null(such ass_and_saveexec_b32 s0, nullors_mov_b32 exec_lo, null) therefore failed inLanes::sop, turningEXECand saved masks intoAtom::Opaqueinstead ofBool::FALSE.Operand::Scalar { code: NULL, .. }as(Bool::FALSE, false)inLanes::operand, matchingwave.rsandresource.rs.null_scalar_operand_is_zero_mask.Verification
null_scalar_operand_is_zero_maskdirectly againstvictory-shaderon Linuxcargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningscargo test -p xtask --locked@Dukestar69 on GitHub · 2026-11-26 20:48 UTC · original · approved these changes
LGTM — verified on Windows against
origin/main(63bcca4).Operand::Scalar { code: NULL, .. }as(Bool::FALSE, false)inLanes::operandaccurately reflects thatNULLreads as 0 and keepsEXECtracking precise instead of turning it opaque.cargo test -p victory-shader --lib structure:: -- --test-threads=1: 14 passed, 0 failed (1 ignored; includingnull_scalar_operand_is_zero_mask).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 20:54 UTC · original · approved these changes
LGTM — decoding
Operand::Scalar { code: NULL, .. }as(Bool::FALSE, false)inLanes::operandmatches RDNA2 (NULLalways reads 0) across both wave32 and wave64, aligningstructure.rswithwave.rsandresource.rs.Verified
cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--all-features): clean.rustfmt --edition 2024: clean on all PR-touched hunks incrates/victory-shader/src/structure.rs.cargo test --locked -p victory-shader --lib -- --test-threads=1 structure:: resource:: ir::: 58 passed, 0 failed, 1 ignored (includingnull_scalar_operand_is_zero_mask).Non-blocking downstream notes
structure.rs:1107-1114,"wqm"buildsa | Atom::Quad(lo). Withnullnow decoding toBool::FALSE,s_wqm_b32 exec_lo, nullproducesQuad, whichemit/lower.rs:2592unconditionally lowers totrue(same pre-existing behavior as inline0; foldinga == Bool::FALSEin"wqm"to(Bool::FALSE, Some(Bool::FALSE))would avoid this).s_cmp_eq/lgwithnull(structure.rs:1208) inherits the existing per-lane mask comparison behavior used for inline0; float inline constants (240..=248) remain unresolved inLanes::operand, and the new test covers wave32 only.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.