Repository navigation
fix(shader): decode scalar NULL operand as Bool::FALSE in lane mask analysis - #3369
Open
reeledMarek wants to merge 1 commit into
Open
reeledMarek wants to merge 1 commit into
reeledMarek wants to merge 1 commit into
Conversation
Dukestar69
approved these changes
Nov 26, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows against origin/main (63bcca4).
- Decoding
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
approved these changes
Nov 26, 2026
fuzeofficlal
left a comment
Contributor
There was a problem hiding this comment.
LGTM — decoding Operand::Scalar { code: NULL, .. } as (Bool::FALSE, false) in Lanes::operand matches RDNA2 (NULL always reads 0) across both wave32 and wave64, aligning structure.rs with wave.rs and resource.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
- In
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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