mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1397] rdna2spirv: a VALU data read of a lane-mask operand yields the wave's mask word #1427
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#1427
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/1397
Author: @whoalin1
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:mask-regs-data-read📝 Commits (5)
63f6683translator: a VALU data read of a lane-mask operand yields the wave's mask word77f23d0translator: gate mask-word gathers on EXEC coverage; scalar mask number readsb83f9d2translator: s_mov copies of EXEC keep the narrowing's tag through SGPR round-tripsec8b961rdna2spirv: the wave mask gather is stored before it is read, so every lane runs it (SHADER-WAVEMASK-EAGER)e3e119atranslator: lane-mask data reads gather the wave word under narrowed EXEC📊 Changes
14 files changed (+670 additions, -41 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
runtime/test/shaders/check.py(+7 -3)➕
runtime/test/shaders/cs_exec_copy.asm(+40 -0)📝
scripts/run_gpu_tests.py(+7 -3)📝
tests/semantic/README.md(+3 -0)➕
tests/semantic/fixtures/disasm/cs_exec_copy.s(+26 -0)📝
tests/semantic/test_lane_masks_vector_bitwise.py(+280 -13)📝
tests/semantic/test_salu64_bitwise_data.py(+4 -2)📝
tests/semantic/test_salu_movrels_lane_mask.py(+3 -1)📝
tests/semantic/test_scselect_b64_data.py(+3 -1)📝
tests/semantic/test_slot67_operand_forms.py(+1 -3)➕
tests/semantic/test_wave_mask_eager.py(+140 -0)📝
tools/rdna2spirv.py(+148 -13)📝
tools/wave64_emulate_opt.py(+7 -1)📄 Description
Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147335368
Depends on: #953
What
A lane mask (EXEC/VCC or a mask-tracked SGPR) that an instruction reads as a 32-bit value — for example
v_mov_b32of it into a plain VGPR, or a scalar number reader such ass_add_u32 s20, s10, K— must produce the wave's mask word. Hardware SGPRs hold that wave-wide word; the translator previously produced each lane's own0/~0bit in the VALU path.This pull request now:
src_u/lane_mask_word), while mask consumers keep extracting the lane bit throughmask_src;if (active)runs, since the gather is a cross-lane operation;docs/design.mdrecords the contract. Semantic coverage includes narrowed SGPR/VCC reads, independent all-ones SGPR EXEC restore, EXEC round trips, scalar readers, vector-bitwise mask composition, native/emulated wave64 structure, and the eager-gather shape.Tested
python -I scripts/run_semantic_tests.py tests/semantic— 488 files, 6298 tests, 0 files failed;compileallclean;tests/test_lane_masks.pypassed.VK_LOADER_DRIVERS_SELECT=*nv-vk*):tools/crosslane_fuzz.py --programs 200 --seed 7 --wave 32 --modes native— 199 match / 1 mismatch / 0 hypothesis-only versus 186 / 9 / 5 atba315fbf1. The remainingcs_xl32_700032minimizes to an inactive-EXEC write-predication case (v_cmpx+ maskdatav_mov+v_xor), distinct from the narrowed-EXEC mask-word family and already present before this change.--programs 106) � 105 match / 1 mismatch / 0 hypothesis-only versus 100 / 3 / 3 atba315fbf1. The remainingcs_xl32_10200411is an EXEC-zero/readfirstlane control-flow case. AMD evidence is reported in the pull-request comments; no game files were used.AI-assisted (SWE-2.1 Max).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.