Repository navigation
wave64: synchronize scalar flbit reads of lane masks - #4392
Conversation
AI-assisted (Codex).
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 6214c468 on Windows 11: python -I tests/semantic/test_wave64_emulate_opt.py -> 24 tests, OK; git diff --check clean.
Scalar flbit reads of lane masks are now synchronized in the wave64 emulation analysis, and the new cases plus the existing CFG suite pass. No blocking issue.
|
Tested 6214c46 on Windows 11 with NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and AMD Radeon(TM) Graphics (driver 32.0.21043.5001): pass. This adds a GPU readback for the two scalar flbit instructions to the CPU review above. I used a synthetic group of 128 threads with 32-lane subgroups. In each emulated wave, lane 37 sets VCC, and lane 0 reads The merge-base translator cannot translate the same unsigned listing ( I found no defect. AI-assisted. |
|
Tested 6214c46 on AMD Radeon RX 9070 XT (RDNA4, RADV GFX1201), Mesa 26.2.6, Vulkan 1.4.354, Arch Linux: pass. Suite with emulation: The new flbit case on a 32-wide subgroup: I translated
Lanes 32-63 also read 28, so the upper half sees the mask bit that lives in the lower 32-lane half. That is the exchange this PR adds. Control: the same listing on the merge base No game files used. AI-assisted (Claude). |
|
Tested
All 20 generated modules passed |
|
Tested
No GPU, no game data. AI-assisted. |
|
APPROVE (
Minor: signed AI-assisted review, no game files, no GPU. |
|
Tested
No game files used. AI-assisted. |
|
Tested
No game data. AI-assisted. |
AI-assisted (Codex). Claimed in the coordination issue.
What and why
s_flbit_i32_b32ands_flbit_i32reconstruct the whole wave64 mask when their source is a lane mask. The scheduler missed that exchange when deciding whether an EXECZ block could fold or a multi-wave block could run without synchronization. Share the mask-reader classification between both checks. Plain scalar sources can still fold.Tested
03b09a08: four EXECZ cases and two SCC cases stop translation. All six translate after the fix, and four ordinary SGPR controls still pass.spirv-val --target-env vulkan1.2with SPIRV-Tools v2026.4. The strict CPU interpreter confirms the exact output lanes and words for unsignedflbit.git apply --checkfor wave64_emulate_opt: record destination read for s_bitset0/1_b32/b64 in _scalar_rw (SHADER-767) #4280 succeeds on this diff. Windows, CPU only, no game files.03b09a08and 124/124 with this change. The full discovery ran 7,458 tests and reported 7 failures, 3 errors, 7 skips and 1 expected failure. Targeted baseline checks reproduced the structured-control, mutation and f64 comparison failures, plus the missingspirv-aserror (tests: gate vcmp16 SPIR-V validation on tool availability #4305). All ten flbit modules were validated separately with the explicit v2026.4 tools.Fixes #4394.