Repository navigation
Conversation
…32 code cannot contain s_bcnt0/1_i32_b64 and s_ff0/1_i32_b64 on a 64-bit SGPR pair, and v_mbcnt_hi_u32_b32, are data ops that wave32 compiler output has (clang -mno-wavefrontsize64 emits s_bcnt1_i32_b64 and s_ff1_i32_b64 for a 64-bit popcount and ctz). With a wave32 FSSM header they raised "FSSM wave32 header contradicts wave64 code". Only exec_hi, saveexec/wrexec_b64, s_wqm_b64, s_bfm_b64 and _b64 ops on EXEC/VCC contradict it now; without a header the markers still imply wave64. GPU test cs_w32_s64_data (build.py writes a real wave32 FSSM header for a "; fssm-wave: 32" comment), semantic test, contract row. AI-assisted.
|
Code read of AI-assisted review (Claude Code). |
|
Tested f74da3c on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Tested |
|
Tested f74da3c on AMD Radeon RX 9060 XT (RDNA4), AMD driver 26.10.44 (LLPC, Vulkan driver 2.0.395), Windows 11 Pro 10.0.26300, subgroup 32..64: pass. The checks above have no AMD run from outside the author; this adds an AMD card with native 64-wide subgroups.
Test programs: an MSVC 14.44 build of main ec8ec4c; this PR's runtime C++ and CMake are identical to that commit, and the translator, runner and |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested f74da3c on AMD Radeon RX 7900 XTX (RDNA3, Navi 31; native wave32 and wave64), AMD driver 26.11.2, Vulkan 1.4.359, Windows 11: pass.
Tools: llvm-mc 21.1.8 (WSL), Vulkan SDK 1.4.363.0, MSVC 14.44. |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): No problems found. ctest on the RTX 4080 SUPER: 129/129 passed. Intel UHD 770 ctest: only the two known base failures, d3d12_descriptor (fixed by #2948) and d3d12_subgroup (fixed by #2934). |
docs/design.md AI-assisted.
docs/design.md runtime/test/shaders/check.py scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py AI-assisted.
|
Tested 0d4c3b7 (a re-test at the new head) on AMD Radeon RX 9070 XT (RADV GFX1201, wave32/64) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.
No game files. AI-assisted. |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-W32-S64-MARKERS, #2716 (comment)
What and why
translate()takes the wave size from the FSSM header, but first checks the header against code markers and refuses a listing whose header says wave32 and whose code has anyWAVE64_REmarker. Two of those markers are plain data ops that wave32 compiler output contains. With AMD clang (-mcpu=gfx1036 -mno-wavefrontsize64, OpenCL), a uniform 64-bit popcount, ctz and clz compile tos_bcnt1_i32_b64,s_ff1_i32_b64ands_flbit_i32_b64(the same code in wave64 mode is identical); a wave32 lane-id chain may also end inv_mbcnt_hi_u32_b32(clang folds it away today, but the instruction is valid and the translator computes it correctly in wave32). A wave32 shader with a 64-bit scalar popcount was refused with "FSSM wave32 header contradicts wave64 code".Now the contradiction check uses only the markers wave32 code cannot contain:
exec_hi,*_saveexec_b64,*_wrexec_b64,s_wqm_b64,s_bfm_b64(the translator models both as lane masks) and a_b64op on EXEC or VCC.s_bcnt0/1_i32_b64,s_ff0/1_i32_b64andv_mbcnt_hi_u32_b32still count as wave64 evidence when there is no header (the fallback heuristic is unchanged), but a wave32 header now wins.WAVE64_REitself is unchanged, sowave64_graphics_scan.pyand the fallback behave as before.New GPU test
cs_w32_s64_data(wave32 compute, 8 words):s_bcnt1/0_i32_b64,s_ff1/0_i32_b64on data pairs with only the high half set, andv_mbcnt_hi_u32_b32afterv_mbcnt_lo_u32_b32.compute_fixture.pygets a; fssm-wave: 32|64header comment that makes build.py write a real FSSM header (magic and the 0xd4 bit 5 flag) for that test; without it the synthetic zero-prefixed compute header has no magic, so the heuristic would decide. Semantic testtest_w32_s64_data_fixture.py: hand constants and a plain-Python model, the shader in the interpreter under a wave32 header, the still-refused markers, the wave64 header, and the no-header fallback.Tested
FSSM wave32 header contradicts wave64 code);run_gpu_tests.py --filter cs_w32_s64_datareports "missing .spv (translation failed)". Green with this change.s_ff0_i32_b64high-word offset 32 changed to 33 fails on the Radeon (word 3 expected 32, got 33).python -m unittest discover -s tests/semantic,regen_fixtures.py --check,tests/test_shader_checks.py,tests/test_fssm_wave_size.py,tests/test_wave64_graphics_scan.py: all pass (discover 4143 tests OK, 3 skipped; regen --check clean; shader_checks, fssm_wave_size and wave64_graphics_scan OK).Checklist
docs/design.md, with how it was confirmed (the "Wave64 handling" row).AI-assisted.