Repository navigation
GPU test cs_w32_late_ext: ds_mskor, v_add/sub_nc_i16 clamp, s_buffer_load constant offset - #3039
LouisRiverstone wants to merge 5 commits into
Conversation
|
Hardware result for
For a negative control, in a separate checkout I removed only the AI-assisted verification · GPT-6.2 Astra Medium |
|
Tested 4ef280b 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
gfx1151 is RDNA 3.5, not RDNA2: this shows the translated SPIR-V gives the modelled words on a real driver, not that RDNA2 hardware does. AI-assisted (Claude Code). |
|
Tested 4ef280b on NVIDIA RTX 5060 Ti (Blackwell), subgroup 32..32, NVIDIA 621.01 (Vulkan 1.4.357), Windows 11: pass.
Tools: llvm-mc 23.1.6 (conda-forge, native Windows), Vulkan SDK 1.4.363.0 ( AI-assisted (Qoder): I built the tools, ran the GPU suite and the CPU test, and checked the eight words against the header. |
Dual-GPU Hardware Verification Report for #3039Tested commit \4ef280bec103bc6f9c7f07c2c5c2d0bdde964a97\ across both physical host GPUs on Windows 11. Hardware & Driver Environment
Test Results1. GPU Harness (\scripts/run_gpu_tests.py --filter cs_w32_late_ext)Both physical GPUs assembled the fixture, translated cleanly via \\ ext === GPU TEST RESULTS === Hexadecimal word breakdown:
|
|
Tested
Translator: 1 shader translated, spirv-val clean — |
Kam471
left a comment
There was a problem hiding this comment.
Verified on the PR head with a fresh MSVC 19.44 + Vulkan SDK 1.4.363 Ninja build: \cs_w32_late_ext\ -> PASS, 1/1, words \
|
Tested
Closes the GPU-coverage gap for those three merged changes cross-vendor on NVIDIA. AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
16647f2 to
0366ce8
Compare
…load constant offset ds_mskor_b32 / ds_mskor_rtn_b32 (ItsNotRexed#1954), v_add/sub_nc_i16 with clamp (ItsNotRexed#1974) and the s_buffer_load constant-SGPR-offset fold (ItsNotRexed#1948) were merged with CPU checks only. cs_w32_late_ext.asm stores eight words from lane 0; the LDS ops run after EXEC is cut to lane 0, and the scalar loads run before any store. With vk_compute_test's V# (num_records 0xFFFFFFFF) s12 = -4, offset:20 must read 0: the old 32-bit wrap read byte 16, the 0xEE fill. tests/semantic/test_late_ext_fixture.py runs the fixture on the CPU with the harness's buffer (0xEE fill, num_records max), checks the words, that both runners expect them, and the lane-0 order.
python -I on the file failed with ModuleNotFoundError: support, as the folder was not on sys.path (found by @justr4mzi on ItsNotRexed#4323, the same template). It is now inserted, as test_cs_shared_memory_limit does.
|
Heads-up: this fixture segfaults on llvmpipe (CI's GPU), which I could only check now with a local Mesa 26.0.8 build. Word 6's out-of-range |
…d form still hoisted) @wavehs's review on ItsNotRexed#4573 led to a fixture with more loads (cs_smem_oob_far) that still segfaulted llvmpipe with the guarded load: inside the branch the compiler knows the bound holds and folds the selected address back to the far one, so the first version only passed ItsNotRexed#3039's fixture by luck. A selected heap base (as suggested) segfaults too: the heap base is 0 in vk_compute_test. The dword is now loaded with no branch, through OpSelect(in range, its address, the V#'s base), and its value is OpSelect(in range, loaded, 0). Both host addresses are computed once, outside the per-dword loop. - test_scalar_mem_smem.py's evaluator models OpSelect %uint and keeps loads through the out-of-range side of an address select out of reads (in discarded): reads stays the addresses the hardware rule reads. - test_smem_oob_safe_address.py checks the shape (no branch, the address and value selects on one condition), the discarded reads at the V# base, values unchanged, and the new fixture on the CPU. - runtime/test/shaders/cs_smem_oob_far.asm: passes on llvmpipe with this rule, segfaults vk_compute_test without it. - docs/design.md row updated.
|
First real-GPU run of the new fixture (the PR body says it had only been run in CI's llvmpipe job). Head
No code changes, no game data; synthetic shader and counts only. AI-assisted. |
|
Tested
The GPU test programs are the runtime build of main |
|
Tested Setup: the PR diff applied to
No game files. AI-assisted (Claude Code); I ran the commands above and checked the numbers against the logs. |
|
Tested 577b780 on AMD Radeon 610M (RDNA2 iGPU, AMD 26.11.2 / 32.0.21045.29003, subgroup 32..64) and NVIDIA GeForce RTX 5070 Ti Laptop GPU (Blackwell, 621.24, subgroup 32..32), Windows 11 Home 26200: pass. This adds an AMD GPU on the Windows driver to the runs above. Same laptop, one GPU at a time through
215 shaders translated, 215 pass spirv-val in each run. I did not run the CPU tests of this PR. One run of each. No game files. AI-assisted (Claude Code). |
|
Thanks @bobcatchris (Apple M2), @kapitche (RTX 4080 SUPER + UHD 770), @cxchhh (V100, native and emulated) and @Etr0p (Radeon 610M, RTX 5070 Ti), all on the current head |
…rom the V# base (llvmpipe segfault) Rebuilt on main, which replaced one selection per dword with one per load (to cut the blocks of the cascade-shadow CS). That still segfaults llvmpipe (Mesa 26.0.8, LLVM 21) on ItsNotRexed#3039's s12 = -4, offset:20 and on cs_smem_oob_far: the load inside the selection is hoisted and reads 4 GB past the buffer. The loads now have no branch: they read through OpSelect(dword 0 in range, the address, the V#'s base), at index i when in range and 0 otherwise (main's indexing), and each value is OpSelect(dword i in range, loaded, 0). Out of range they read the buffer's first dword and the values are discarded; no extra blocks at all. - test_scalar_mem_smem.py's evaluator models OpSelect %uint and keeps loads through the out-of-range side of an address select out of reads. - tests/semantic/test_smem_oob_safe_address.py: the no-branch shape (one selected pointer on dword 0's bound, a value select per dword), discarded reads only at the V# base's first dword, values unchanged, the fixture on the CPU. - runtime/test/shaders/cs_smem_oob_far.asm: passes on llvmpipe with this rule, segfaults vk_compute_test with main's translator. - docs/design.md row added.
|
Tested
No game files. AI-assisted (Claude Code). |
|
Thanks @lunarminus (Radeon 760M, native and emulated, the per-test comparison with |
# Conflicts: # runtime/test/shaders/check.py # scripts/run_gpu_tests.py # tests/semantic/regen_fixtures.py
|
Tested 1b5f6c0 on Intel UHD Graphics 630 (CFL GT2), Mesa ANV, subgroup 8..32: run_gpu_tests.py --filter cs_w32_late_ext prints "PASS cs_w32_late_ext 305419896 305441656 4294901761 32767 32768 32768 0 4008636142" and "1/1 passed", which is 0x12345678 0x1234AB78 0xFFFF0001 0x7FFF 0x8000 0x8000 0 0xEEEEEEEE. With LEONIDA_VK_DEVICE=NoSuchDevice it fails with "no Vulkan physical device matches". tests/semantic test_late_ext_fixture runs 4 tests OK, and tests/test_shader_checks.py and tests/test_run_gpu_tests.py pass. The full tests/semantic suite and the full GPU suite were not run. AI-assisted. |
# Conflicts: # runtime/test/shaders/check.py # scripts/run_gpu_tests.py # tests/semantic/regen_fixtures.py
|
Tested AI-assisted (Claude Code). |
|
Tested f3a6f32 on NVIDIA GeForce RTX 4090, driver 595.99.02, Linux (Debian 13 userspace), llvm-mc 21.1.8: pass
Test programs built from |
# Conflicts: # runtime/test/shaders/check.py # scripts/run_gpu_tests.py # tests/semantic/regen_fixtures.py
A GPU test, in the
cs_w32_*_extformat CI runs on llvmpipe, for three merged changes that only had CPU checks:ds_mskor_b32/ds_mskor_rtn_b32(#1954),v_add/sub_nc_i16withclamp(#1974), and thes_buffer_loadconstant-SGPR-offset fix (#1948).runtime/test/shaders/cs_w32_late_ext.asm: lane 0 of a wave32 group stores eight words (derivations in the header):ds_mskor_rtn_b32old value (LDS 0x12345678, DATA 0xFF00, DATA2 0xAB00)0x123456780x1234AB78ds_mskor_b32(LDS ~0, DATA 0xFFFF, DATA2 1)0xFFFF0001v_add_nc_i16 0x7FFF + 1 clamp0x7FFFv_sub_nc_i16 0x8000 - 1 clamp0x8000v_add_nc_i16 0x7FFF + 1, no clamp (wraps)0x8000s_buffer_load_dwordwiths12 = -4,offset:200s12 = 12(byte 32, never written)0xEEEEEEEEWhy words 6 and 7 work:
vk_compute_testfills the buffer with0xEEand its V# hasnum_records = 0xFFFFFFFF(runtime/test/vk_compute_test.cpp).0xFFFFFFFC + 20isn't reduced mod 2^32, so it's out of range and reads 0. Before #1948, the folded constant wrapped to 16 and read the0xEEfill instead. Word 7 is the in-range control. Both scalar loads run before any store, because a scalar load would not see a vector store without a cache invalidate.LDS: EXEC is cut to lane 0 before the LDS ops, so 32 lanes never race on one address (the #1850 lesson).
Registration, as
cs_w32_new_ops:WAVE32_DUMPSandCS_DUMPSincheck.py, the dump list, expected words and wave32 exclusion inrun_gpu_tests.py, andregen_fixtures.py, plus the fixture.CPU check:
tests/semantic/test_late_ext_fixture.pyruns the fixture as one wave32 group inspirv_mini_interp, with the harness's buffer (0xEEfill and the max-num_recordsV#). It checks the eight words against values computed in the test, that both runners expect them, and that thev_cmpxcomes before the firstds_. 4/4 pass;regen_fixtures.py --checkpasses.python -I -m unittest discover -s tests/semantic: 4146 tests OK (4 skipped).tests/test_shader_checks.pyandtests/test_run_gpu_tests.pyOK.Not yet run on a GPU. I have no GPU or
llvm-mchere, so CI's linux-gpu-tools job will be the first run. No game files.AI-assisted (Claude Code): I reviewed and ran the change and the tests.