Repository navigation
Tests: GPU and CPU checks for the untested d16_xyz/d16_xy typed-buffer forms - #2039
Conversation
…r forms buffer_load_format_d16_xyz, tbuffer_load_format_d16_xy/_d16_xyz and buffer_store_format_d16_xyz were translated but no test ran them. Add the GPU test cs_fmt_d16_xyz (one thread; integer, f16 and UNORM8 loads with the kept high half of an odd final component, the 16-bit clamp of 32-bit UINT channels, and stores into 32_32_32_UINT and 32_32_32_FLOAT), compared over the whole 80-word heap, and run the same fixture in test_value_semantics.py. AI-assisted.
|
Tested Independent Vulkan check of Built the Vulkan harnesses at the pinned head and ran The targeted AI-assisted verification. |
|
Tested b87dc1e 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 b87dc1e merged into
AI-assisted (Claude Code). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). No game files used. |
|
Tested b87dc1e on AMD Radeon RX 9070 (RDNA4, subgroup 32..64), AMD 26.10.1 (LLPC), Vulkan 1.4.359, Windows 11 26300: pass. Python 3.12.10, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0; harness programs built from
|
Conflicts: scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py tests/test_shader_checks.py AI-assisted.
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-COV-D16FMT (#1902 (comment))
What and why
An opcode inventory of
tools/rdna2spirv.pyagainstmain(every opcode the translator handles, checked againstruntime/test/shaders/*.asm,tests/**and the fuzzers' tables) finds d16 typed-buffer forms that no test runs. This adds a GPU test and atests/semanticcheck for four of them:buffer_load_format_d16_xyz,tbuffer_load_format_d16_xy,tbuffer_load_format_d16_xyz,buffer_store_format_d16_xyz.The
d16_xforms (buffer_load_format_d16_x,tbuffer_load_format_d16_x) are left out: #1759 and #1885 exercise them.runtime/test/shaders/cs_fmt_d16_xyz.asm(one thread) writes its inputs at 0x100, then:d16_xyzfrom a 16_16_16_16_UINT and a 32_32_32_UINT V# (the second clamps 0x10000 and 0xffffffff to 0xffff), MTBUFd16_xyfrom 16_16_FLOAT, and MTBUFd16_xyzfrom 16_16_16_16_FLOAT, 8_8_8_8_UNORM (0 and 255 only, so no rounding question) and 32_32_32_UINT. Each_xyzdestination's second VGPR is seeded first, and its high half must survive (the d16 rule indocs/design.md).d16_xyzstores into 32_32_32_UINT (16-bit values zero-extended) and 32_32_32_FLOAT (f16 widened), each into a region whose fourth word must stay untouched.All 80 words of the heap are compared (results, untouched fill, inputs). The derivation from the ISA and the design.md rules is in the header; registered in
check.py(fmt_d16_xyz_test) andrun_gpu_tests.py, with the harness case intests/test_shader_checks.py.test_value_semantics.pyruns the same fixture through the interpreter with the expected words written from a small Python model (f16 viastruct, the 16-bit clamp, the kept high half).No translator change: all four match on both GPUs.
Tested
Windows 11,
python -I scripts/run_gpu_tests.py --filter cs_fmt_d16_xyz:Negative control: in
buffer_load_format, the odd final d16 component written withself.dstinstead ofself.write_lo16(one line, so the high half is cleared).cs_fmt_d16_xyzfails on both GPUs (word 1: expected 0xa5a57fff, got 0x00007fff) andtest_d16_xyz_typed_buffersfails at the five_xyzsecond words. Reverted.python -m unittest discover -s tests/semanticOK,python tests/semantic/regen_fixtures.py --checkclean,python -I tests/test_shader_checks.pyandpython -I tests/test_run_gpu_tests.pyOK.AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (No new rule.)