mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:50:52 +01:00
[PR #1996] rdna2spirv, lane_masks: extract per-lane bits for m0 and scc/src_scc in mask_src and _maskable_b32 (SHADER-MASK-SRC-M0-SCC) #2002
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#2002
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/1996
Author: @ShotTechOp
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/mask-src-m0-scc📝 Commits (1)
01cd084rdna2spirv, lane_masks: handle m0 and scc/src_scc in mask_src and _maskable_b32📊 Changes
4 files changed (+252 additions, -2 deletions)
View changed files
📝
docs/design.md(+1 -0)➕
tests/semantic/test_mask_src_m0_scc.py(+238 -0)📝
tools/lane_masks.py(+1 -1)📝
tools/rdna2spirv.py(+12 -1)📄 Description
Claimed in #1608 as
SHADER-MASK-SRC-M0-SCC.What and why
_maskable_b32in bothtools/rdna2spirv.pyandtools/lane_masks.pypreviously accepted onlysgpr,imm,exec*,vcc*, andnull, omittingm0andscc/src_scc.exec_lo/exec_hiorvcc_lo/vcc_hiwithm0orsrc_scc(e.g.,s_and_b32 exec_lo, exec_lo, m0,s_andn2_b32 exec_lo, exec_lo, m0,s_and_b32 vcc_lo, vcc_lo, m0,s_not_b32 vcc_lo, m0),sop2_b32_srcs/s_not_b32fell back to rawsrc_u()instead of_mask_b32_src():exec_lo/exec_hidestinations,rheld raw non-zero bitmasks on active lanes whose bit inm0/src_sccwas0, soscc_logic(scc_any_half(r)) setSCC = 1even when the resultingEXEChalf was0(e.g.,exec_lo = 0x2,m0 = 0x5->exec_lo & m0 == 0still setSCC = 1).vcc_lo/vcc_hidestinations,put_mask/dststored that raw non-zero word into%vccon lanes whose bit inm0was0(corrupting subsequentv_cndmask_b32ands_cbranch_vccz), andlane_masks.stepdroppedvccfrom the mask state.Gen.mask_srcalso raisedUnsupported("mask operand")form0andscc/src_scc, breakings_*_saveexec_b32/s_*_wrexec_b32/s_*_saveexec_b64withm0orsrc_scc.m0,scc, andsrc_sccto_maskable_b32(both modules) and toGen.mask_src(zero-extending bits32..63to0whenwide and self.wave64) fixes both the silent miscompilations and thesaveexec/wrexecrejections.m0andscc/src_scclane-mask sources indocs/design.md.Testing
tests/semantic/test_mask_src_m0_scc.py— testss_and_b32,s_andn2_b32,s_or_b32,s_xor_b32,s_not_b32intoexec_lo,exec_hi,vcc_lo,vcc_hi(wave32 and wave64), ands_and_saveexec_b32/s_and_saveexec_b64withm0andsrc_scc, checking both per-lane mask values andSCC.origin/main(b9320a1):tests/semantic/test_mask_src_m0_scc.pyfails withFAILED (failures=19, errors=1)(proving wrongSCConexec_lo/exec_hi, corruptedvcc_lo/vcc_hilane bits, andUnsupported("mask operand")ons_and_saveexec_b32/b64).python -I tests/semantic/test_mask_src_m0_scc.py -v(3/3 OK)python -m unittest discover -s tests/semantic -p test_salu_b32_lane_masks.py(9 ran, OK, 1 skipped)python -m unittest discover -s tests/semantic -p test_mask_src_sgpr_const.py(7/7 OK)python -m unittest discover -s tests/semantic -p test_wave64_vcc_half_write.py(7/7 OK)python -m unittest discover -s tests -p "test_docs_*.py"(50/50 OK)python -I tests/test_text_write_line_endings.py(3/3 OK)python -m compileall -q tools/rdna2spirv.py tools/lane_masks.py tests/semantic/test_mask_src_m0_scc.pypython -I scripts/check_no_game_data.py tools/rdna2spirv.py tools/lane_masks.py docs/design.md tests/semantic/test_mask_src_m0_scc.pygit diff --check🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.