Skip to content

rdna2spirv: exec_half_write extracts per-lane bit for computed scalar values (SHADER-1264) - #8424

Closed
Tortoche wants to merge 3 commits into
ProjectLeonida:mainfrom
Tortoche:fix/shader-1264-exec-half-computed-scalar
Closed

Tortoche wants to merge 3 commits into
ProjectLeonida:mainfrom
Tortoche:fix/shader-1264-exec-half-computed-scalar

Conversation

@Tortoche

@Tortoche Tortoche commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What this does

When a computed non-mask scalar value was written to exec_lo or exec_hi (such as via s_add_u32, s_lshl_b32, or scalar memory loads through Gen.dst), exec_half_write tested (val != 0) which evaluated to true across all lanes of that wave half, turning on lanes that should have remained inactive.

Extract each lane's corresponding bit (val >> (rel & 31)) & 1, unifying it with the immediate constant path.

Testing

  • Adds regression test tests/semantic/test_wave64_exec_half_computed.py covering computed scalar writes to exec_lo and exec_hi in wave64 mode.
  • Verified negative control: fails on previous implementation (AssertionError: 4294967295 != 5), passes cleanly with this fix.
  • All 76 exec tests in tests/semantic/ pass.
  • scripts/check_no_game_data.py: pass.
  • Synthetic inputs only, no game data.
  • AI-assisted.

… values (SHADER-1264)

When a computed non-mask scalar value was written to exec_lo or exec_hi
(such as via s_add_u32, s_lshl_b32, or scalar loads through Gen.dst),
exec_half_write tested (val != 0) which evaluated to true across all lanes
of that wave half, turning on lanes that should have remained inactive.

Extract each lane's corresponding bit (val >> (rel & 31)) & 1, matching
the immediate constant path. Add regression test covering computed scalar
writes to exec_lo and exec_hi in wave64 mode.

@leoleahy leoleahy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted.

Independently verified on Windows 11 (Python 3.14.8, CPU-only) at 5fcb226f:

  • Merge cleanliness against upstream/main (dde82f27): git merge-tree --write-tree clean, git diff --check clean, python -I -m compileall -q clean.
  • Added semantic suite (python -I -m unittest discover -s tests/semantic -p test_wave64_exec_half_computed.py): 3/3 OK on HEAD; negative control on dde82f27 fails all 3/3 (producing 4294967295 instead of 5, 10, and 0x10).
  • Adjacent wave64 semantic suites on HEAD: test_wave64_vcc_half_write.py 7/7 OK, test_wave64_subgroup_ops.py 6/6 OK.
  • Audited all 5 exec_half_write call sites in tools/rdna2spirv.py: per-lane mask callers pass 0 / 0xFFFFFFFF (where (val >> (rel & 31)) & 1 != 0 matches val != 0 identically), while computed scalar bitmask callers now extract each lane's own bit properly.

Looks solid and ready to merge.

@morodirule

Copy link
Copy Markdown

Tested 5fcb226 on Arch Linux, Python 3.14.10, CPU only: pass — new tests/semantic/test_wave64_exec_half_computed.py 3/3 OK. Negative control: base translator → all 3 fail; restored, green again. No game files, no GPU. AI-assisted.

@nonverifiedperson

Copy link
Copy Markdown
Contributor

GPU and silicon check of 5fcb226 (up to date with main): with this PR the translated shader matches gfx1036 hardware. On main it doesn't.

I used a wave64 compute shader (group 64,1,1, --require-wave64). It does four computed SALU writes to one EXEC half and marks each lane that runs a following v_mov_b32. Each lane then stores its marks, and the table shows them as lo/hi bitmaps:

setup gfx1036 silicon (hw_oracle, wave64) main translator, Radeon this PR, Radeon
exec_hi = 0x12345678, s_add_u32 exec_lo, s4(=5), 0 lo 0x00000005 hi 0x12345678 lo 0xffffffff hi 0x12345678 lo 0x00000005 hi 0x12345678
exec_lo = 0x87654321, s_add_u32 exec_hi, s4(=10), 0 lo 0x87654321 hi 0x0000000a lo 0x87654321 hi 0xffffffff lo 0x87654321 hi 0x0000000a
exec_hi = 0, s_lshl_b32 exec_lo, s4(=1), 4 lo 0x00000010 hi 0 lo 0xffffffff hi 0 lo 0x00000010 hi 0
exec_hi = 0, s_add_u32 exec_lo, s4(=0xfffffffe), 1 lo 0xffffffff hi 0 lo 0xffffffff hi 0 lo 0xffffffff hi 0

The CPU interpreter gives the same words as the Radeon GPU for both translators. The other three writes to a mask still go through exec_half_write: s_mov_b32 from a mask SGPR, put_mask, and the _wrexec_b32 halves. They pass the all-ones/zero per-lane form, so (val >> (rel & 31)) & 1 gives the same lanes as the old val != 0.

Tests:

  • python -I scripts/run_semantic_tests.py tests/semantic: 448 files, 5959 tests. 3 files fail: test_image_atomics_guard, test_image_cube_store_glc and test_image_store_d16. These are the same 3 that fail on main, and tests/semantic: three image test files red on main (stale after #4473 and #6805; LLVM_MC on Windows) #7284 fixes them.
  • python -m unittest discover -s tests/semantic -p test_wave64_exec_half_computed.py: 3 pass.
  • scripts/run_gpu_tests.py --filter exec with this PR's translator: 6/6 pass on the Radeon, including cs_w64x_andn2_exec and cs_w64x_saveexec_b64. On the RTX 5070 Ti, 4/6 pass and the 2 wave64 fixtures skip because the card has no 64-wide subgroup.

A pitfall in case anyone turns this into a GPU fixture: read the marks back per lane, or through s_bcnt1/s_ff1. A v_mov_b32 v1, s20 of a v_cmp result reads lane 0's per-lane copy of the mask (all-ones or zero), not the 32-bit ballot. My first readback did that and looked like a failure of this PR.

Windows 10 22H2, AMD Radeon iGPU (gfx1036, driver 32.0.13036.4), NVIDIA RTX 5070 Ti (driver 621.35), Vulkan SDK 1.4.363. Synthetic values only, no game files. AI-assisted (Claude Code).

@tupacfan04 tupacfan04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new wave64 bit extraction is correct: exec_half_write() takes (word >> (rel & 31)) & 1, half 0/1 preserves the other 32 lanes, the register-mask representation still works, the constant path keeps the Intel workaround, and the wave64 tests cover s_add_u32 into both halves and s_lshl_b32 into exec_lo (they fail on the old val != 0). The wave32 path is still broken:

tools/rdna2spirv.py:1548-1552 only sends wave64 EXEC writes to exec_half_write():

if self.wave64 and a["k"] == "special" and a["t"] in ("exec_lo", "exec_hi"):
    self.exec_half_write(1 if a["t"] == "exec_hi" else 0, val)
    return
if a["k"] == "special" and a["t"] in ("exec_lo", "exec"):
    self.set_exec(val)
    return

In wave32, a computed scalar from s_add_u32, s_lshl_b32, etc. goes to set_exec(), whose tmp_bool_nz() is OpINotEqual %bool val 0 (:5578-5581), so a uniform value 5 activates every lane instead of lanes 0 and 2. The paths hit this (s_add_u32 → dst() at :9485; s_lshl_b32 → _store_b32_mask_dst/dst() at :11372/:5642). A wave32 shader with s_mov_b32 exec_lo, 0, s_mov_b32 s4, 5, s_add_u32 exec_lo, s4, 0 should leave exec_lo = 5, but still leaves 0xFFFFFFFF; s_lshl_b32 exec_lo, s4, 4 is the same.

Test gap: tests/semantic/test_wave64_exec_half_computed.py is wave64-only (FSSM_64, run_workgroup(..., 64, 64), all cases use wave64 halves); there is no wave32 FSSM_32/32-thread case for s_add_u32 exec_lo/s_lshl_b32 exec_lo, so the wave32 path is unpinned. The body's “scalar memory loads through Gen.dst” is not in the committed test, and the values 5/10/0x10 only exercise bits 0-4 (no bit 31).

Fix: use the bit extraction for wave32 exec_lo too (shared helper with exec_half_write), and add wave32 s_add/s_lshl cases plus a bit-31 case. Synthetic only; no game files. AI-assisted (OpenCode).

@KoertLichtendonk

Copy link
Copy Markdown
Contributor

Coordinator note: SHADER-1264 already has an open PR, #8353 by @HDFreitas (opened 18:32 UTC), so this looks like a duplicate. Please compare the two and either close this one or say here what it adds. The maintainer decides which one is merged.

@rojasruiz

Copy link
Copy Markdown

Tested 5fcb226 merged onto main bf69af7 (clean merge) on NVIDIA GeForce RTX 3080 (32-wide subgroups), driver 615.78.08, Linux 7.2.15; llvm-mc 23.1.3, SPIRV-Tools v2026.4: pass, no regression.

  • run_gpu_tests.py with LEONIDA_W64_EMULATE=1 (every wave64 module through the emulated exec_half_write path): 223/241 passed, 17 skipped. main gives the same, with the same single failure (the known ms_wave_info_s3).
  • Default flags: 192/241, 48 skipped, identical to main.
  • tests/semantic/test_wave64_exec_half_computed.py: 3 OK. scripts/run_semantic_tests.py tests/semantic: 448 files / 5,960 tests, with only the 2 files already red on main failing (test_image_atomics_guard, test_image_store_d16), at the same counts.
  • check_no_game_data.py on both files: clean.

No GPU fixture writes a computed (non-mask) scalar to exec_lo/exec_hi yet, so on hardware this shows no side effects rather than the fix itself. The CPU test is what covers the new path.

AI-assisted (Claude Code).

@Tortoche

Copy link
Copy Markdown
Contributor Author

Thanks for the review @tupacfan04 and @leoleahy!

I have updated the PR to address your suggestion:

  • Unified the exec_lo, exec_hi, and wave32 exec handling in Gen.dst() to route through exec_half_write(0, val) for wave32 as well.
  • Added wave32 test coverage (Wave32ExecComputedScalarTests) covering s_add_u32 to exec_lo, s_add_u32 directly to exec, and shift bit 31 (s_lshl_b32 with shift 31).
  • Added wave64 bit 31 shift coverage to Wave64ExecHalfComputedScalarTests.

All 7 test cases pass cleanly.

@jacob-rowlands

Copy link
Copy Markdown

Tested 1d93673c5 merged onto main 867d922f0, Linux (CachyOS, Python 3.14.10), no game files: one existing test now fails, introduced by the latest commit.

python3 -I tests/semantic/test_active_cache.py:

Tree Result
main 867d922f0 OK (3 runs out of 3)
this PR at 5fcb226ff (the head the earlier checks used), merged onto the same main OK
this PR at 1d93673c5, merged onto the same main FAILED (3 runs out of 3): test_divergent_loop_loads_active_once_per_block, AssertionError: 7 not less than or equal to 6 : expected cached %active loads, got 7

The PR is based on dde82f27e, older than this main, so the merge brings in nothing but the PR's own two files.

The cause looks like 1d93673c5's change to Gen.dst. Wave32 writes to exec_lo/exec used to go through set_exec and now go through exec_half_write. The test's loop ends each iteration with s_or_b32 exec_lo, exec_lo, s6, and on this path the per-block %active cache costs one extra load. The results are still exact: with only the load-count assertion removed, the rest of the test passes on all 32 lanes. So this is a codegen regression caught by the existing guard, not a wrong value. Either keeping wave32 exec_lo/exec writes on set_exec when the value is a lane mask, or having exec_half_write reuse set_exec's cache handling, would likely restore it.

Everything else matches main: test_wave64_exec_half_computed.py passes, the semantic suite otherwise has the same 2 files failing as main, and run_gpu_tests.py gives the same results as main on a Ryzen 5 7600X iGPU (RADV, Mesa 26.3.1) and an RTX 3080 (NVIDIA 620.73.04), with and without LEONIDA_W64_EMULATE=1.

AI-assisted (Claude Code).

@trigger337

Copy link
Copy Markdown

Tested 1d93673 on AMD Radeon RX 6900 XT (RADV Navi 21, Mesa 26.2.5, Linux 7.3.1 CachyOS): pass

  • python -I tests/semantic/test_wave64_exec_half_computed.py: 7/7 passed.
  • python scripts/run_gpu_tests.py --build runtime/build/linux: 224/241 passed, 16 skipped, 0 failures.
  • scripts/check_no_game_data.py: clean.

AI-assisted: yes
agent: yes

@N4use4tic

Copy link
Copy Markdown

Tested 1d93673 on Windows 11, Python 3.14.4, no GPU or LLVM: pass.
From tests/semantic: test_wave64_exec_half_computed (7 tests), test_wave32_bfm64_data (6) and test_wave64_subgroup_ops (6) OK; tests/test_lane_masks.py ok.
test_image_atomics_guard and test_image_store_d16 are still red, as on main (#7284).
No merge conflicts with #8448, #8409 or #8264.
Code not reviewed beyond the test run.

@CourtyardGames

Copy link
Copy Markdown

Tested 1d93673 on AMD Radeon Graphics (Ryzen 5 7600X iGPU, RDNA2), AMD 32.0.21042.62 / AMDVLK 2.0.353, Vulkan 1.4.315, Windows 11, MSVC 14.51: pass

PR head is on main dde82f2; the PR does not touch runtime/, so the runtime was the existing main build.

  • tests/semantic/test_wave64_exec_half_computed.py: 7/7 OK.
  • Control: the same test with main's tools/rdna2spirv.py swapped in: 7/7 fail (all 4 wave64 and 3 wave32 cases), so the PR changes the outcome.
  • scripts/run_gpu_tests.py on the iGPU (device reported "AMD Radeon(TM) Graphics, subgroup 32..64"): native 218/241 passed, 23 skipped, 0 failed; LEONIDA_W64_EMULATE=1: 218/241 passed, 23 skipped, 0 failed.
  • Other tests/semantic/test_wave64_*.py (11 files): all OK.

Note: this head (1d93673) is newer than the one the earlier GPU checks covered (5fcb226). AI-assisted.

@matheusfermiano-source

Copy link
Copy Markdown

Tested 1d93673c5 (the PR's diff applied on main 867d922f0), full python -I scripts/run_gpu_tests.py on both GPUs of one laptop, each compared with main on the same machine and binaries, CachyOS Linux: pass.

GPU Driver main this PR Difference
AMD Radeon 660M (RDNA2 iGPU, gfx1035, Ryzen 5 7535HS), subgroup 32..64 RADV, Mesa 26.3.1 225/241 passed, 16 skipped 225/241 passed, 16 skipped same results as main
NVIDIA GeForce RTX 3050 Laptop (Ampere), subgroup 32 NVIDIA 620.73.04 192/241 passed, 48 skipped 192/241 passed, 48 skipped fails on main too: ms_wave_info_s3 (#6172)
  • Radeon 660M wave64 checks: LEONIDA_W64_EMULATE=1 run_gpu_tests.py 225/241 passed, 16 skipped (main: 225/241 passed, 16 skipped); runtime/test/shaders/w64_graphics.py 29 ok, 0 SKIP, 0 other.

No game files. AI-assisted (Claude Code).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 1d93673c on Windows Server 2022, CPython 3.13.12: pass

  • python -I -m unittest discover -s tests/semantic -p "test_wave64_exec_half_computed.py" -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@IxMxAMAR

Copy link
Copy Markdown

Checked 1d93673c on Windows 11 Pro 26200, CPython 3.12.10, with an RX 9070 XT (RDNA4, AMD 26.11.2) and Intel Graphics (Core Ultra 5 225, Xe-LPG, 101.8860).

  • tests/semantic/test_wave64_exec_half_computed.py: OK at the head. With the base's tools/rdna2spirv.py (dde82f27), 7 of its tests fail, so it catches what it describes.
  • scripts/run_gpu_tests.py, full suite, with this PR's translator and with the base's (runner binaries from a main 867d922f build):
GPU, LEONIDA_W64_EMULATE base this PR
RX 9070 XT, 0 (native wave64) 225 PASS, 16 SKIP the same
RX 9070 XT, 1 225 PASS, 16 SKIP the same
Intel Graphics, 1 206 PASS, 1 FAIL, 34 SKIP the same

Every fixture has the same result with and without the change. The one Intel failure is ms_wave_info_s3, which fails the same way on the base (#6172). cs_exec_const and cs_exec64 pass on both GPUs, so the shift-and-mask path still holds on Xe-LPG now that computed values go through it too.

No game files. AI-assisted.

@lordra9-svg

Copy link
Copy Markdown

Independent confirmation of the regression @jacob-rowlands reported, on the PR head as filed (no merge onto newer main), Linux (Bazzite 45), Python 3.15.2, standard library only, no GPU, no game files:

python3 -I tests/semantic/test_active_cache.py

tree result
1d93673c5 (this head) FAILED, 3 runs out of 3
5fcb226ff (previous head) OK, 3 runs out of 3
main 867d922f0 OK, 3 runs out of 3

The failure is deterministic:

FAIL: test_divergent_loop_loads_active_once_per_block
  File "tests/semantic/test_active_cache.py", line 166, in test_divergent_loop_loads_active_once_per_block
    self.assertLessEqual(total_loads, 6, f"expected cached %active loads, got {total_loads}")
AssertionError: 7 not less than or equal to 6 : expected cached %active loads, got 7

So the regression is between 5fcb226ff and 1d93673c5, i.e. from the wave32 unification commit (Gen.dst() routing wave32 exec through exec_half_write(0, val)), not from main or the test environment.

AI-assisted (OpenCode).

@slint6614-dev

Copy link
Copy Markdown
Contributor

AMD RDNA2 GPU-suite check of 1d93673c5 (AI-assisted): full scripts/run_gpu_tests.py with this branch's translator, against the same run on main 867d922f. Ryzen 5 9600X iGPU "AMD Radeon(TM) Graphics" (gfx1036, the console's RDNA2 family), native wave32/wave64, AMD Adrenalin 26.11.2 (Vulkan driver 2.0.353), Windows 11 26300, Python 3.12; test programs from a RelWithDebInfo build of 561b65a (LEONIDA_GPU_TEST_TIMEOUT=60).

Same per-fixture results as main: every fixture all translated and pass spirv-val; main: 222/241 passed, 17 skipped, 2 FAIL (ps_sample_implicit_uint, ps_table_fetch: vk_texture_test usage errors from the older test-program build, identical on both sides). No fixture changes status.

@TheoGegout

Copy link
Copy Markdown

Tested 1d93673c5 merged onto main 867d922f0 (merge d008edfaf) on AMD Radeon RX 6800 XT (RDNA2, Navi 21), AMD proprietary driver 26.10.1 (Vulkan 1.4.315), Windows 11 Pro 26300: pass, no change against main.

Standalone tools built with llvm-mingw 20261117 (clang, Ninja, Release, -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF, so the MSVC-only runtime targets are not built), llvm-mc 23.1.6 (conda-forge), Vulkan SDK 1.4.341.1. Baseline: the same steps on main 867d922f0.

  • GPU: scripts/run_gpu_tests.py, full suite: 223/241 passed, 17 skipped, 1 failed (ms_wave_info_s3), identical to main, result words included.
  • ctest: 66/67, vk_queue_query_sync failed (see below).
  • tests/semantic/test_wave64_exec_half_computed.py: OK. Negative control: against main's translator it fails (7 failures).

Both non-passing results are on main too, not caused by this PR: ms_wave_info_s3 fails intermittently on this GPU (#6172, SHADER-766), and vk_queue_query_sync failed 13 of 20 standalone reruns on main (progress counter device loss NOT propagated, as in #8426; #6149).

AI-assisted (Claude Code).

@zsigisti

Copy link
Copy Markdown
Contributor

GPU test for this fix: #8995 adds cs_w32_exec_computed and cs_w64_exec_computed (computed s_lshl/s_add/s_bfm/s_not/s_mov/s_and writes into exec_lo / exec_hi), plus a CPU run of the same words in tests/semantic/test_exec_computed.py. Merged with this PR, both pass on an RTX 5070 (wave64 emulated). On main the computed half turns fully on (8192 8192 8192 … / 8224 8192 16384 16384 …). #8353 and #8424 give identical words on every case, so the fixture doesn't decide between them. If your docs/design.md row needs a GPU check, it can name these tests. AI-assisted (Claude).

…active SSA in wave64

In wave32 mode (subgroupSize 32), all lanes are in half 0, so there
is no other half to preserve. Emitting OpLoad %bool %active and OpSelect
with inh is unnecessary and caused an extra load caught by
test_active_cache.py (test_divergent_loop_loads_active_once_per_block).
Directly store on in wave32, and reuse active_b() in wave64.

AI-assisted.
@Tortoche

Copy link
Copy Markdown
Contributor Author

Thanks @jacob-rowlands and @lordra9-svg for catching and isolating this!

Fixed in 0e24e3bfc:

  • In Wave32 mode (not self.wave64), all lanes are within half 0, so there is no opposite half to preserve. We now directly emit OpStore %active {on} instead of emitting an unused OpLoad %bool %active and OpSelect.
  • In Wave64 mode, exec_half_write now queries self.active_b() so any active bool already cached in the block is reused.

Verified:

  • python3 -I tests/semantic/test_active_cache.py: 9/9 pass (including test_divergent_loop_loads_active_once_per_block).
  • python3 -I tests/semantic/test_wave64_exec_half_computed.py: 7/7 pass.
  • python3 -m unittest discover -s tests/semantic -p test_wave64_subgroup_ops.py: 6/6 pass.
  • python3 -I tests/semantic/test_wave64_vcc_half_write.py: 7/7 pass.

@junaydirfan

Copy link
Copy Markdown

GPU check with #8995's fixtures: 0e24e3bf merged with #8995 onto main 867d922f passes cs_w32_exec_computed and cs_w64_exec_computed (wave64 emulated) on an Intel Raptor Lake-S iGPU with Mesa ANV 26.3.1 and on an RTX 4080 Laptop with NVIDIA 620.73.04. Both fail on main. #8353 and #8424 give identical words. Table: #8995 (comment)

@WALID1618Y

Copy link
Copy Markdown
Contributor

Tested 0e24e3bfc on NVIDIA GeForce RTX 3050 (driver 621.24 / 32.0.16.2124, Vulkan 1.4.357, Windows x64, Python 3.13.14): pass

Environment notes: pre-built runtime-windows CI binaries from e68c5c9c9 (tools/rdna2spirv.py unchanged between e68c5c9c9 and 867d922f0), --assembler python (tools/spirv_asm.py), --disasm-dir tests/semantic/fixtures/disasm (no llvm-mc), spirv-val skipped (--no-validate). Synthetic/fixture shaders only, no game files. AI-assisted.

Semantic tests:

  • Red-before (LEONIDA_TOOLS_DIR -> base tools/): tests/semantic/test_wave64_exec_half_computed.py -> Ran 7 tests, FAILED (failures=7)
  • Green-after (0e24e3bfc):
    • tests/semantic/test_wave64_exec_half_computed.py: 7/7 OK
    • tests/semantic/test_active_cache.py: 9/9 OK (confirms the previous test_divergent_loop_loads_active_once_per_block regression is resolved)

RTX 3050 GPU verification (0e24e3bfc):

  • Full pre-disassembled suite (native): 81/96 passed, 15 skipped (32-wide device wave64 compute skips; matches baseline)
  • LEONIDA_W64_EMULATE=1 --filter cs_w --require-pass: 30/30 passed
  • With PR GPU fixtures for computed writes to exec_lo / exec_hi (SHADER-1264) #8995's cs_w32_exec_computed / cs_w64_exec_computed fixtures overlaid on 0e24e3bfc:
    • tests/semantic/test_exec_computed.py: 2/2 OK
    • Native --filter cs_w32_exec_computed --require-pass: 1/1 passed (259 1028 3088 7682 512 4100 0 3)
    • LEONIDA_W64_EMULATE=1 --filter exec_computed --require-pass: 2/2 passed
      • PASS cs_w32_exec_computed 259 1028 3088 7682 512 4100 0 3
      • PASS cs_w64_exec_computed 291 1028 11264 771 8192 4132 0 3

@gutersohn

Copy link
Copy Markdown

Tested 0e24e3bfc (and before it 1d93673c5) on AMD Radeon RX 6600 (RDNA2, Navi 23, gfx1032, native wave64), AMD Windows driver 26.10.1 (32.0.21045.16010), Windows 11 10.0.26200: pass, no regression. This is the first AMD run of the current head.

Build: MSVC (VS 2022 Build Tools) RelWithDebInfo, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0, LEONIDA_VK_DEVICE=radeon. Counts only, no game files. AI-assisted (Claude Code).

@alvaroolt

Copy link
Copy Markdown

Tested 0e24e3bfc merged onto main 867d922f0 on AMD Radeon(TM) Graphics iGPU (AMD proprietary driver 24.10.34, native wave64) and NVIDIA GeForce RTX 5080 (621.24), Windows 11 10.0.26300: pass

The new part here is #8995's fixtures on a native 64-wide subgroup. The earlier fixture runs used --wave64-emulate.

#8995's cs_w32_exec_computed / cs_w64_exec_computed (copied from #8995's head, built with runtime/test/shaders/build.py by each translator, run with the same vk_compute_test):

this PR main control
AMD, cs_w64_exec_computed, subgroup 64 (--require-wave64, no emulation) 291 1028 11264 771 8192 4132 0 3 8224 8192 16384 16384 8192 4132 0 3
AMD, cs_w32_exec_computed, subgroup 32 259 1028 3088 7682 512 4100 0 3 8192 8192 8192 7682 512 4100 0 3
RTX 5080, cs_w64_exec_computed, LEONIDA_W64_EMULATE=1 291 1028 11264 771 8192 4132 0 3 8224 8192 16384 16384 8192 4132 0 3
RTX 5080, cs_w32_exec_computed 259 1028 3088 7682 512 4100 0 3 8192 8192 8192 7682 512 4100 0 3

The PR's words match the expected values in #8995's check.py. main gives the whole-half words that #8995's header predicts.

Full GPU suite (scripts/run_gpu_tests.py, same runtime build for both trees, since the PR changes only Python):

this PR main
AMD, native 219/241 passed, 20 skipped 219/241 passed, 20 skipped
RTX 5080, native 192/241 passed, 48 skipped 192/241 passed, 48 skipped
RTX 5080, LEONIDA_W64_EMULATE=1 223/241 passed, 17 skipped 223/241 passed, 17 skipped

PASS/FAIL/SKIP is identical fixture by fixture in all three configurations, and 247/247 translate and pass spirv-val in each run. The only failures are already on main: ms_wave_info_s3 (both GPUs) and ms_clip (AMD).

Semantic tests:

  • test_wave64_exec_half_computed.py: 7/7 OK on the PR. With the file copied onto main, all 7 fail.
  • Full scripts/run_semantic_tests.py tests/semantic: 448 files, 5,964 tests. Three files fail, the same three as on main (test_image_atomics_guard, test_image_cube_store_glc, test_image_store_d16).

dst() refactor check. dst() now sends exec to exec_half_write(0, ...) in wave64 as well. To see whether any 64-bit EXEC write changes, I ran a small differential probe through spirv_mini_interp (wave64, base values from v_readfirstlane_b32 so nothing folds to a constant) and read back the 64-bit EXEC on both trees:

  • These give bit-identical EXEC on the PR and main: s_mov_b64 exec, s[4:5] / vcc, s_and_b64 / s_or_b64 / s_xor_b64 / s_not_b64 / s_andn2_b64 / s_cselect_b64 / s_bfm_b64 into exec, s_and_saveexec_b64, s_mov_b32 exec_lo + exec_hi from SGPRs, and s_and_b32 exec_hi, vcc_hi, s5.
  • Only two cases differ, and the PR gives the ISA value in both: s_add_u32 exec_lo, s4, 1 (s4 = 0xff0f), where main turns on all 32 lanes and the PR turns on 0xff10; and v_readfirstlane_b32 exec_lo, v20 (v20 = 0xf00f), where main turns on all 32 lanes and the PR turns on 0xf00f.
  • The readfirstlane case is a path the PR's tests don't cover.
  • s_lshl_b64 exec, s_brev_b64 exec and v_cmp_*_e64 exec are refused as Unsupported on both trees, so they don't change.

Tools: llvm-mc 23.1.6 (AMDGPU), Vulkan SDK 1.4.363.0, MSVC 19.52, Python 3.12.10. Synthetic inputs only, no game files.

AI-assisted: yes (Claude Code); results reviewed by me.

@hwcopeland

Copy link
Copy Markdown

Tested 0e24e3b on AMD Radeon 8060S (Strix Halo, gfx1151, subgroup 32..64), RADV Mesa 26.3.1, Arch Linux container on Ubuntu 24.04.5 / kernel 7.0.0-38; LLVM 23.1.5, SPIRV-Tools v2026.4: pass.

  • scripts/run_gpu_tests.py: 225/241 passed, 16 skipped, 0 failed, both native wave64 and with LEONIDA_W64_EMULATE=1 (the same as main 867d922)
  • tests/semantic/test_wave64_exec_half_computed.py: 7 passed

Synthetic fixtures only, no game files. AI-assisted (Claude Code).

@BatSmacker84

Copy link
Copy Markdown

Tested 0e24e3bf merged onto main 6312c057f (with the fixture overlay from #8995 at b643ebd3) on AMD Radeon RX 7800 XT, driver 26.11.2, Windows 11 26200: pass.

  • 105 focused EXEC/subgroup tests pass; GPU --filter exec_computed 2/2, native and emulated.
  • On main, cs_w32_exec_computed and cs_w64_exec_computed fail in both modes (extra lanes enabled).
  • Full GPU suite: same as main.

On main alone the full run_gpu_tests.py gives 224/241 passed, 16 skipped, 1 failed (ms_wave_info_s3, the known mesh failure: #6172, #8369, #8677).

AI-assisted: Codex GPT-6.2 Sol ran the tests, Claude Opus 5.5 reviewed the report. Python 3.12.16, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0, CMake/MSVC RelWithDebInfo. No game files used.

@dragoso

dragoso commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

GPU check of the new head 0e24e3bfc (the wave32 change): merged onto main 867d922f0 together with #8995 at b643ebd3 for the exec_computed fixtures, against main + #8995 alone. Windows 11 Pro 26300, two GPUs picked with LEONIDA_VK_DEVICE: AMD Radeon Graphics (Ryzen 7 7700X iGPU, RDNA2, AMD 32.0.21042.62, native wave64) and NVIDIA RTX 5060 Ti (Blackwell, 617.42, subgroup 32). Test programs built from main 867d922f0; llvm-mc 21.1.8, Vulkan SDK 1.4.363.0, MSVC 14.51. Pass.

Full python -I scripts/run_gpu_tests.py (249 shaders, all translated and pass spirv-val on both sides):

AMD iGPU (native wave64) RTX 5060 Ti RTX 5060 Ti, LEONIDA_W64_EMULATE=1
main + #8995 218/243, cs_w32_exec_computed and cs_w64_exec_computed fail 192/243, cs_w32_exec_computed fails 223/243, both exec_computed fail
+ this PR 220/243, both pass 193/243, w32 passes (w64 skipped) 225/243, both pass
  • exec_computed words with this PR: 259 1028 3088 7682 512 4100 0 3 (w32) and 291 1028 11264 771 8192 4132 0 3 (w64), the expected values. Without it: 8192 8192 8192 7682 ... / 8224 8192 16384 16384 ....
  • The other 241 fixtures give the same PASS/FAIL/SKIP and the same result words on both sides, on all three paths. The one remaining failure on the RTX, ms_wave_info_s3, is on main too (ms_wave_info_s3 fails natively on NVIDIA RTX 5080 (Windows, subgroup 32): all pixels read back -1 #8306).
  • CPU, from tests/semantic with python -m unittest: test_wave64_exec_half_computed 7/7, test_active_cache 9/9 (including test_divergent_loop_loads_active_once_per_block), test_exec_computed 2/2 (2 failures on main).

Earlier I ran 1d93673c the same way on these GPUs with the exec_computed fixtures (on #8995); the new head gives the same words.

Synthetic shaders only, no game files. AI-assisted (Claude Code).

@pr-sorter

Copy link
Copy Markdown

Tested 0e24e3b on AMD Radeon RX 5700 XT (RDNA1), Mesa RADV 26.2.5, Linux (CachyOS 7.3), i7-7700K: pass (AMD half only)

  • The head is 60 commits behind main, so I tested it merged onto main 867d922 (local merge, clean).
  • scripts/run_gpu_tests.py full suite, native wave64: 213/241 passed, 28 skipped, 0 FAIL; with LEONIDA_W64_EMULATE=1: 213/241 passed, 28 skipped, 0 FAIL. Both identical to main on the same machine; 247/247 translated and pass spirv-val.
  • The change reaches 32 translated modules in each run (the cs_w64x_*, cs_wm_*, cs_wqm_*, cs_w32_*, cs_exec* and ps_vcmp* fixtures, among others). All keep their result, e.g. PASS cs_wm_half_ops 32 16 16 0 16, PASS cs_w64x_saveexec_b64, PASS cs_wave64_ballot 32 16 24 40 8 48, PASS cs_exec64, in both runs.
  • tests/semantic/test_wave64_exec_half_computed.py: 7 tests OK.
  • No 32-wide GPU was used (the emulated run is on this wave64 card), so the 32-wide half still needs someone else.

AI-assisted (Claude Code), run by a person; built and run in a sandbox without network.

@adrianmjim

Copy link
Copy Markdown

checked: #84240e24e3b applied onto main 867d922 (clean) | on: RX 7900 XT (RDNA3), AMD Windows 26.11.2, Windows 11 26300, Python 3.14, llvm-mc 23.1.5 | result: pass

  • test_wave64_exec_half_computed: 7/7 OK. Negative control with LEONIDA_TOOLS_DIR pointing at main's tools/: 7/7 fail.
  • test_active_cache: 9/9 OK at this head, which is the first independent check of the fix for the 1d93673 regression. test_wave64_vcc_half_write, test_wave64_subgroup_ops, test_wave64_saveexec_b32, test_wrexec_b32, test_control_flow_exec and test_saveexec_variants are OK, with the same counts as main.
  • build.py: 270/270 translated and spirv-val-valid, natively and with LEONIDA_W64_EMULATE=1. 65 modules differ from main in both modes.
  • check.py: 208 of 211 (3 mesh skips) natively and emulated. Per-fixture lines are identical to main in both modes, including the cs_exec*/*andn2_exec/saveexec fixtures.
  • Extra probe (wave32, CPU interpreter): s_mov_b32 exec_hi, 0 and s_add_u32 exec_hi, 0, 0 after s_mov_b32 exec_lo, -1 both leave all 32 lanes storing, the same as main. The wave32 exec_hi writes are still ignored.

No game files. AI-assisted (Claude Code).

@gurvancampion

Copy link
Copy Markdown
Contributor

Tested 0e24e3bfc (PR #8424) against control 6312c057f (origin/main) on Omarchy (Arch) Linux 7.2.15, Python 3.14.8, GCC 16.2.1, llvm-mc 23.1.3 (host GPUs: AMD Radeon 610M iGPU RDNA2 gfx1036 / RADV Mesa 26.2.5 ACO subgroups 32..64, NVIDIA GeForce RTX 5090 / driver 615.78.08 subgroups 32..32): pass

Scope: CPU-only semantic interpreter check (tests/semantic/test_wave64_exec_half_computed.py does not touch GPU fixtures or require VK_LAYER_KHRONOS_validation; implicit Vulkan layers MangoHud / VkLayer_MESA_device_select not invoked).

Command (via jobscope --name leonida-exec --, venv Python 3.14.8):
python -m unittest -v tests/semantic/test_wave64_exec_half_computed.py

Results:

  • Head 0e24e3bfc: 7/7 tests passed (0 failures, 0 errors).
  • Control 6312c057f (with PR rdna2spirv: exec_half_write extracts per-lane bit for computed scalar values (SHADER-1264) #8424's tests/semantic/test_wave64_exec_half_computed.py, which is new in this PR): 0/7 tests passed, FAILED (7 failures, 0 errors):
    • Wave32ExecComputedScalarTests: 3/3 failed (test_wave32_computed_scalar_shifted_write_bit31, test_wave32_computed_scalar_write_to_exec, test_wave32_computed_scalar_write_to_exec_lo)
    • Wave64ExecHalfComputedScalarTests: 4/4 failed (test_computed_scalar_shifted_write_to_exec_lo, test_computed_scalar_write_bit31_to_exec_lo, test_computed_scalar_write_to_exec_hi, test_computed_scalar_write_to_exec_lo)

No failures at head.

No game files. AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.