Repository navigation
test_lane_masks_edge_cases: s_and_b32 of a lane mask with -1 stays a mask (EGEN-MASK-AND-M1-TEST) - #6509
test_lane_masks_edge_cases: s_and_b32 of a lane mask with -1 stays a mask (EGEN-MASK-AND-M1-TEST)#6509evilclanker9000 wants to merge 1 commit into
Conversation
…mask lane_masks.kind answers EITHER for the immediates 0 and -1, so s_and_b32 s5, s4, -1 on a compare result leaves s5 a lane mask. Dropping -1 from that rule (only 0 kept) made s5 plain data and left every test that passes on main green. The new test counts the bits of s5 with s_bcnt1_i32_b32: 3 in every lane for a compare true in lanes 0-2, where a lane reading its own bit as data would get 0 or 32.
|
Tested 0505665 on Windows 11 (NTFS), Python 3.12.10 (CPU only, no GPU, no game files): pass What I ran:
One correction to the description, not blocking: with negative control 1, not all mask-related files stay green. Overlap: #6502 "a mask parked in lane 8 survives a word written to lane 40" and #6572 "v_mov_b32 of a lane mask keeps the lane that is off in EXEC" add different tests at the same place in AI-assisted (Claude Code). |
|
Tested 0505665 merged with main e36d4c4 on Linux/Python 3.12.16: pass Test-only (one new test in tests/semantic/test_lane_masks_edge_cases.py,
|
Claimed in the coordination issue as: EGEN-MASK-AND-M1-TEST (Vonsek4), #4933 (comment)
Depends on: none (a test in
tests/semantic/test_lane_masks_edge_cases.py). #293 is about reading a mask as data; this test is about the translator still knowing the result is a mask.What and why
tools/lane_masks.pykind()returns EITHER for the immediates 0 and -1 (a constant: no lanes or all lanes). That is what keepss_and_b32 s5, s4, -1on a compare result a lane mask, so a laters_bcnt1_i32_b32 s6, s5counts the wave's bits instead of the lane's own.I changed
a["v"] in (0, -1)toin (0,)in a copy oftools/and ran the 13 mask-related files oftests/semantic: all stayed green. The new test fails on it.The test (wave32, 4 lanes):
v_cmp_gt_u32_e64 s4, 3, v0(lanes 0-2),s_and_b32 s5, s4, -1,s_bcnt1_i32_b32 s6, s5, stores6. Expected 3 in every lane; a lane that readss5as its own per-lane bit would count 0 or 32.Tested
No GPU needed (CPU interpreter).
python -I -m unittest discover -s tests/semantic -p test_lane_masks_edge_cases.py -k minus_one: OK on this branch.(0, -1)->(0,)inkind(): the test fails (the file was green without the change).Notes
tools/, then the per-fileunittest discover).AI-assisted.