shader(fold): sign-extend negative inline constants in upper mask9 half #2983
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2983
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2983"
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?
@RanoGames on GitHub · 2026-11-29 19:12 UTC · original
RanoGames:fix/fold-mask9-negative-upper→main· +38 −0 · 1 files · 1 commits · openWhat it changes
Fixes
mask9incrates/victory-shader/src/fold.rswhen folding 64-lane VALU instructions (such asv_cndmask_b32and*_co_ci_u32carry-in) into lower/upper 32-lane halves:129..=192and 32-bit literals255already mapped to128(0) inupper(half)(Half::B/Half::BSwap).193..=208(-1..=-16) sign-extend to-1(0xFFFF_FFFF, code193) in bits32..63(matchinghalves()), butmask9previously returnedOk(code)unchanged for194..=208, clearing bits in lanes32..35on the upper half.193..=208 if upper(half) => Ok(193)and unit testfold::tests::mask9_sign_extends_negative_inline_constants_in_upper_half.How it was tested
folded_testsinvictory-shader)mask9(194..=208, Half::B | Half::BSwap, ...)returned194..=208(-2..=-16) instead of193(-1, all 32 upper lanes set).mask9(193..=208, Half::B | Half::BSwap, ...)returns193.emit::folded_tests+fold::tests)cargo testpassed for the crates it touches: yes (cargo test --locked -p victory-shader --lib -- fold::tests emit::folded_tests: 18 passed, 0 failed;cargo xtask policy --stagedpassed)Checked for overlap
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.