Repository navigation
test_lane_masks_edge_cases: v_mov_b32 of a lane mask keeps the lane that is off in EXEC (EGEN-VMOV-MASK-TEST) - #6572
Conversation
…hat is off in EXEC lane_masks.step returns op != "v_mov_b32" for a VGPR mask write, so only per-lane mask computations take the all-lanes store and a plain v_mov_b32 stays an ordinary VALU write (SHADER-21 part 2). Returning True for v_mov_b32 too wrote the inactive lane and left every test that passes on main green. The new test writes v2 from a mask SGPR with EXEC = lanes 0-2 and expects lane 3 to keep 0xdeadbeef.
|
Checked on macOS 27.2.1 / Apple M1 Max, Python 3.15.2, CPU only: replicated.
AI-assisted (OpenCode / DeepSeek V4.1 Flash + GLM-5.3): the agent ran the battery and the sabotage control sandboxed. |
|
Tested 75d20ed merged with main e36d4c4 on Linux/Python 3.12.16: pass The PR adds one test, test_v_mov_of_a_mask_keeps_inactive_lanes, to tests/semantic/test_lane_masks_edge_cases.py and changes no translator code, so it can only guard behavior that main already has; there is no code change to revert for a negative control. Commands run (merged worktree,
Limits: the test asserts only the inactive lane; the comment in it says the active lanes need the mask materialization from #293, so it does not pin the value of the active lanes. I did not mutate the translator to check that the assertion fails when an inactive lane is overwritten. |
Claimed in the coordination issue as: EGEN-VMOV-MASK-TEST (Vonsek4), #4933 (comment)
Depends on: none (a test in
tests/semantic/test_lane_masks_edge_cases.py). Touches the same file as #6502 and #6509 in a different place.What and why
tools/lane_masks.pystep()returnsop != "v_mov_b32"for a mask written to a VGPR (SHADER-21 part 2): only per-lane mask computations take the all-lanes store, and a plainv_mov_b32stays an ordinary VALU write, so a lane that is off in EXEC keeps its old VGPR value.I changed that to
return Truein a copy oftools/and ran the 17 mask-related files oftests/semantic: all stayed green. The new test fails on it.The test (wave32, 4 lanes):
v_cmp_lt_u32_e64 s6, v0, 2,v2 = 0xdeadbeef,exec_lo = 7,v_mov_b32 v2, s6,exec_lo = 0xf, storev2. Lane 3 was off during the write and must still hold0xdeadbeef. Only that lane is asserted: the active lanes reads6as data, which needs #293's mask materialization (same reasoning as the existingtest_sdwa_bitwise_respects_exec_on_mask_operands).Tested
No GPU needed (CPU interpreter).
python -I -m unittest discover -s tests/semantic -p test_lane_masks_edge_cases.py: 7 tests OK on this branch.return op != "v_mov_b32"->return True: the file fails (it was green without the change).Notes
s_bfm_b64-> EITHER instead of MASK (av_cndmask_b32on the result); that mutant gives the same lanes either way, so I did not write a test for it.AI-assisted.