Repository navigation
GPU test cs_w32_int_ext: integer ops that only had CPU checks - #833
LouisRiverstone wants to merge 0 commit into
Conversation
|
Tested 5879d51 on Windows 11 with two GPUs on one machine (runtime built from main with MSVC 14.51, llvm-mc 23.1.6): pass on both
So the eight ops agree with the CPU checks on two real Vulkan drivers, beyond llvmpipe. |
quackottu
left a comment
There was a problem hiding this comment.
Tested 5879d51 on NVIDIA GeForce RTX 5070 (subgroup 32), driver 621.24, Windows 11 Pro (26300), Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (built with scripts/build_llvm_mc.ps1), scripts/run_gpu_tests.py:
- native: 72/99 passed, 27 skipped (
main8df277f here: 64/91 passed, 27 skipped, all wave64 tests needing a 64-wide subgroup) LEONIDA_W64_EMULATE=1: 99/99 passed (mainhere: 91/91)python -m unittest discover -s tests/semantic: Ran 977 tests in 185.070s OK
|
Tested 5879d51 on two GPUs: Windows 11 Home 10.0.26300, llvm-mc 21.1.8 (AMDGPU, native), Vulkan SDK 1.4.363.0, MSVC 14.44.35207, Python 3.14.7,
ctest with AI-assisted (Claude Code). No game files. |
|
Tested the fixture on AMD, as you asked. RX 9070 XT (RDNA4), AMD proprietary 26.11.2, Windows 11. I didn't run this branch's scripts. I took
So on AMD hardware all eight results match the ISA-derived values, including the wrap in AI-assisted (Claude Code). No game files. |
ec64bd6 to
4def9b2
Compare
|
The |
2ea930e to
4def9b2
Compare
These scalar and vector integer ops went in with semantic (CPU) tests only:
s_absdiff_i32(#445),s_lshl2_add_u32and the SCC ofs_lshl1_add_u32(#448),s_pack_lh_b32_b16(#449),s_mul_hi_i32(#445),v_mul_hi_i32_i24(#440),v_sad_u8(#544) andv_lerp_u8(#577). This adds a GPU test, so every runner ofcheck.py/scripts/run_gpu_tests.pyexecutes them on a real Vulkan driver. CI does that on llvmpipe. Claimed in #634.Change
runtime/test/shaders/cs_w32_int_ext.asm(new): lane 0 of a wave32 group computes one result per op and stores eight dwords. The header derives each expected value:s_absdiff_i32(0x7FFFFFFF, 0x80000000)= 1, because the difference wraps to −1 first(5 << 2) + 7= 27s_lshl1_add_u32(0x80000000, 0)= 1, because the shifted-out bit counts as a carrys_pack_lh_b32_b16=0x33332222s_mul_hi_i32(INT_MIN, INT_MAX)=0xC0000000v_mul_hi_i32_i24(−2²³, −2²³)=0x4000v_sad_u8= 18v_lerp_u8=0x20304050runtime/test/shaders/check.pyandscripts/run_gpu_tests.py: the test is registered as a wave32 dump, next tocs_w32_permute, with the same eight words. It doesn't need 32 lanes (only lane 0 stores), so it also runs on llvmpipe's 8-wide subgroups.tests/semantic/regen_fixtures.pyandfixtures/disasm/cs_w32_int_ext.s: the fixture, generated by the script.tests/semantic/test_int_ext_fixture.py(new): runs the fixture on the CPU and checks the eight words against values computed in Python from the ISA definitions. It also checks thatcheck.pyandrun_gpu_tests.pyexpect exactly those words.Tested
python -I -m unittest discover -s tests/semantic: all pass.regen_fixtures.py --checkpasses.tests/test_run_gpu_tests.pyandtests/test_shader_checks.pypass.llvm-mc, so the.asmhasn't been assembled locally. CI'slinux-gpu-toolsjob builds and runs it on llvmpipe. A run on real hardware (run_gpu_tests.py, AMD especially, since the SCC and wrap rules come from the ISA pseudocode) would be welcome.AI-assisted (Claude Code): it wrote the test and ran the checks listed above.