mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #2360] rdna2spirv: handle mixed mask pairs, wave32 VCC, and mask bit indices in s_bitcmp0/1_b32/b64 (SHADER-BITCMP64-MIXED-AND-SPECIAL-SRCS) #2362
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2362
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2360
Author: @ShotTechOp
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/bitcmp64-mixed-and-special-srcs📝 Commits (1)
c26efd2rdna2spirv: handle mixed mask pairs, wave32 VCC, and mask bit indices in s_bitcmp0/1_b32/b64 (SHADER-BITCMP64-MIXED-AND-SPECIAL-SRCS)📊 Changes
3 files changed (+290 additions, -16 deletions)
View changed files
📝
docs/design.md(+1 -0)➕
tests/semantic/test_bitcmp64_mixed_and_special.py(+262 -0)📝
tools/rdna2spirv.py(+27 -16)📄 Description
Item ID:
SHADER-BITCMP64-MIXED-AND-SPECIAL-SRCSSummary
Fixes
Gen.bitcmp(s_bitcmp0/1_b32ands_bitcmp0/1_b64) intools/rdna2spirv.pyfor five broken lane-mask operand combinations (matching the per-dword word-materialization model used bys_cmp_eq/lg_u64):s_bitcmp0/1_b64: when one dword ofs[r:r+1]holds a lane mask and the other holds plain scalar data,holds_lane_maskreturnedFalse, so the mask dword was loaded raw (0/0xFFFFFFFFper lane) instead of materializing the wave's 32-bit mask word.(mask, -1)(EITHER) pairs ins_bitcmp0/1_b64:holds_lane_maskreturnedTrueand calledwave_mask(s[r:r+1]), which returned(lo, 0)in wave32 and dropped the high-1word to0.s_bitcmp0/1_b64(e.g.s10 = vcc_hi,s11 = vcc_lo):holds_lane_maskreturnedTrueandwave_maskcollapsed them to canonical(lo, hi). Now only canonical wave64(MASK_LO, MASK_HI)keeps a singlewave_mask; all other SGPR pairs materialize each dword independently (lane_mask_wordwhen tracked as a mask, elseload_reg).s_bitcmp0/1_b64 vcc, bit: in wave32,vccis{vcc_hi, vcc_lo}wherevcc_locan hold a lane mask whilevcc_hiholds scalar data (or a separate mask). Previouslywave_mask(vcc)zeroed bits 32..63; nowvcc_loandvcc_hiare materialized independently.a[1]ons_bitcmp0/1_b32ands_bitcmp0/1_b64: previouslyself.src_u(a[1])read per-lane0/0xFFFFFFFFinstead ofself.lane_mask_word(a[1]).Also simplifies
_b32to useself.lane_mask_word(src0)and replaces the non-mask 64-bit fallbackself.mask_src(src0)withself.src_u(src0). Updates the contract table indocs/design.mdand addstests/semantic/test_bitcmp64_mixed_and_special.py.Verification
spirv_mini_interp; no local GPU/Vulkan/spirv-valinstalled)python -I tests/semantic/test_bitcmp64_mixed_and_special.py -v-> 6/6 OK (wave32, FSPX wave32, native wave64,--wave64-emulate)python -I tests/semantic/test_scalar_bitcmp.py-> 23/23 OKpython -I tests/test_text_write_line_endings.py-> 3/3 OKpython -m compileall -q tools/rdna2spirv.py tests/semantic/test_bitcmp64_mixed_and_special.py-> exit 0python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_bitcmp64_mixed_and_special.py docs/design.md-> exit 0git diff --check-> cleanorigin/main(tools/extracted fromorigin/main):tests/semantic/test_bitcmp64_mixed_and_special.pyfails 5 of 6 tests (6 failures across wave32, FSPX wave32, native wave64, and--wave64-emulate;test_wave64_bitcmp32_high_half_maskis a parity regression guard).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.