tools/f32_fuzz.py runs seeded VOP1/VOP2/VOP3 float programs (neg/abs, clamp,
omod) through an exact-arithmetic RDNA2 model and through the translated
SPIR-V in tests/semantic's interpreter, and compares them bit-exact.
Denormals, and inputs the emitted SPIR-V leaves undefined, are counted
separately instead of being compared.
Translator fixes it found:
- v_mac_f32 is the VOP2 form of v_mad_f32 (product rounded before the add),
not of v_fma_f32 (LLVM getNewFMAInst: V_MAC_F32 -> V_MAD_F32_e64). It
emitted Fma.
- VOP3 clamp and mul:2/mul:4/div:2 were dropped on v_cvt_f32_i32/u32,
v_cvt_f32_ubyte0..3, v_cvt_f32_f16 and v_rcp_iflag_f32 (LLVM
VOPProfileI2F: $src0, $clamp, $omod).
Interpreter: RoundEven keeps the sign of a zero result; Fma rounds once
(it double-rounded through a double); adds OpFDiv, OpIsNan, OpIsInf,
Floor/Ceil/Trunc/Exp2/Log2/Sqrt/InverseSqrt, raising where SPIR-V or
GLSL.std.450 leave the result undefined.
Pinned by runtime/test/shaders/ps_f32_mods.asm (check.py, run_gpu_tests.py,
tests/semantic/test_f32_valu.py) and tests/test_f32_fuzz.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vs/gs/ms: no OpGroupNonUniformQuadSwap (only guaranteed in fragment and
compute); shuffle from the quad's four lanes there.
- 32-bit forms in wave64 write only their own half of EXEC/VCC and vote SCC
over that half; mask_src accepts exec_hi. New GPU test cs_wqm_w64_half.
- cs_wqm_w32: read SCC right after s_wqm.
- test_wqm_on_data checks the real constants and shifts; new vs and half tests.
- docs: narrowed claims (SCC vote needs 64-wide or emulation, lane
assumptions, partial quads, helper invocations untested).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Visual Studio generator the test programs land in build/<Config>, and the runner only looked in the build
folder itself, so --build had to point at the subfolder (#166, RX 9070 XT entry). resolve_build_dir() looks in the
build folder first, then in RelWithDebInfo, Release, Debug and MinSizeRel, and takes the configuration that has all
three required programs and was built last. If none has them, the folder given is kept for the error message.
Keep both sides: main's ps_vcc_x2 / ps_tex / bindless and irreducible-CFG tests
next to ps_gather_wrap, main's buffer-format-store row next to the updated
gather row, and both the literal-SGPR table and #298's mask tokens in store_reg.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the conflicts with the GPU test lists and counts (#203, #212, #218,
#222, #235, #246, #219, #298, #230), and keep main's partial-wave rule for
ds_bpermute_b32 in wave64. The wave32 path gets the same ballot, so a
source lane that isn't running reads 0 there too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_sampler_test binds a 128x128 two-level texture with the VkSampler from
vulkan_sampler(decode(S#)) and the view range from decode(T#). ps_ssharp
samples it with image_sample_lz and image_sample. check.py judges eight
S#/T# cases per pixel against levels worked out from the S# and T# bits.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the cube array at its original extent and allocate a separate upload range for the two-dimensional mip chain. Both shader registrations now run through the updated upstream runner.
s_wqm on EXEC/VCC/an SGPR mask is no longer the identity: the lane ORs its
bit with its quad's (two OpGroupNonUniformQuadSwap, or four x_buf reads under
--wave64-emulate), SCC is the wave-wide any. Data operands compute the quad
bits directly. GPU tests cs_wqm_w64, cs_wqm_w32, ps_wqm; design.md row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ps_vcc_x2 reads two dwords through the V# in s[0:3], but vk_harness pushed zeros and bound no memory, so on the
GPU it read address 0 and lost the device; run_gpu_tests.py skipped it and check.py left it out. vk_harness now
takes VKH_SGPRS (user SGPRs, decimal or 0x hex) and VKH_HEAP (addr=word seeds in a 64 KiB device-address heap,
passed as the heap base). bufferDeviceAddress and shaderInt64 are enabled only then; a device without them gets
"unsupported: ..." and exit 77, which both runners report as SKIP. Both runners give ps_vcc_x2 the V# and words
tests/semantic uses and expect 0x11223344 0x55667788 0 0.
The four-fetch emulation of image_gather4_l(_o) clamped every texel to the
edge. Each coordinate now goes through the S#'s CLAMP_X/CLAMP_Y (wrap, mirror,
clamp to last texel, mirror once), read at translation time from a literal S#
and from the SGPR at run time otherwise. A literal S# with a border mode or
FORCE_UNNORMALIZED is Unsupported.
GPU test ps_gather_wrap (vk_texture_test) with hand-derived expected values;
wired into check.py, scripts/run_gpu_tests.py and tests/test_shader_checks.py;
pytest cases in tests/test_translate.py; docs/design.md row updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A single-level view produces the same image for both sampling operations. Exercise both against the same minified view so the readback detects a wrong LOD or swapped texture coordinates.
The hardware takes a cube sample's s and t in [1, 2] and its third
coordinate as 8 * slice + face (Mesa ac_nir_lower_tex_coords.c, LLPC
ImageBuilder.cpp). Samples and gathers passed them unchanged to the
6-layer 2D-array view; they now use s - 1, t - 1 and layer
6 * slice + face.
ps_cube_sample checks every pixel on a GPU (vk_texture_test cube), and
test_cube_sample checks the coordinates without one.
vk_texture_test runs with its working directory in <work>/spirv, so a relative --build (runtime/build) made the
tool path point there and the test failed with "missing runtime/build/vk_texture_test". --build and --work are
now made absolute after parsing. A filtered run also builds vs_ids.spv for ps_texture_sample, which
vk_texture_test loads, as #192 did for ps_flat (one table, DRAWN_WITH).
On Windows 11, Smart App Control blocks freshly built unsigned programs it
has no reputation for (WinError 4551, "An Application Control policy has
blocked this file"), and which ones it blocks changes with each rebuild.
run_gpu_tests.py then stopped the whole run with an OSError traceback, and
check.py did the same from mesh_w64x_test.
- check.start_failure() turns the OSError into one result line naming the
program and, for the Windows refusals (4551 Application Control, 1260
software restriction policy, 225 Defender), who refused it and how to
allow it.
- check.run(), mesh_w64x_test(), run_gpu_tests.run_cmd() and the
ps_texture_sample launch report it as a FAIL of that test and go on with
the rest. It is a failure, not a SKIP: a blocked run must not look green.
pixel_test() passes the reason on instead of "vk_harness failed".
- A missing program still stops check.py with the build instructions.
tests/test_gpu_blocked_program.py fakes the error, so it runs on any OS.
AI-assisted (Claude Code). Tested on Windows 11 Home, NVIDIA GeForce RTX
4060 Ti (driver 32.0.16.2124), on main 36ace71:
- the new tests: 7/7 on Windows and on Linux (WSL Ubuntu 26.04); 5 of
them fail without the fix
- end to end, with test programs Windows really refuses (WinError 216):
run_gpu_tests.py and check.py print one FAIL line per test and exit 1,
no traceback
- run_gpu_tests.py: every PASS/SKIP identical to main, natively (29/49,
20 skipped) and with LEONIDA_W64_EMULATE=1 (47/49, 2 skipped); ctest
12/12; tests/test_*.py all pass; tests/semantic 388 OK
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check.py drops --require-wave64 for cs_wavemask when wave64 is emulated; run_gpu_tests.py always passed it,
so on a 32-wide GPU the emulated suite skipped cs_wavemask. The check moves into wavemask_check(), which
asks for a 64-wide subgroup (and confirms it) only for the native build. test_run_gpu_wavemask covers both
paths with a fake vk_compute_test.
NVIDIA GeForce RTX 4070 SUPER (subgroup 32), driver 610.88, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 in WSL:
LEONIDA_W64_EMULATE=1 run_gpu_tests.py 48/49 (was 47/49; ps_vcc_x2 skips), cs_wavemask 0 mismatches.
Native: 29/49, cs_wavemask still skips. AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_gpu_tests.py parsed only the expected prefix of the out[0..7] line, so "55 48 BAD 0 0 0 0 0" passed
cs_wm_scc_rfl and text inside the prefix raised a ValueError that aborted the whole run. It also never looked
for the "compute subgroup size: 64" line for the dumps run with --require-wave64, so a vk_compute_test that
ignores the flag could pass.
The judging of a dump moves into judge_cs_dump(): the line must be eight decimal words (dump_words(), also used
by cs_bounds), and the dumps run with --require-wave64 must print the confirmation, as in check.py. The skip on
exit 77, the partial-group skip and the emulated and cs_store paths (#152) are unchanged; the run_suite block
only calls it.
tests/test_run_gpu_tests.py exercises this without a device, including the emulated and partial paths.
Decide ps_bitmask_perm from the reported subgroup width before the
pixel count, skip when the width line is missing, and include the
harness's unsupported reason in the GPU runner skip.
The fallback block (no VS CMake tools) built vk_texture_test when
VULKAN_SDK is set but not the two tests this branch adds. They are built
the same way now: both include their headers by relative path and need no
library.
Not run here: this machine has no MSVC or PowerShell. The two sources
build with MSVC through CMake (reported on the pull request).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A device without bufferDeviceAddress or shaderInt64 now gets "unsupported: ..." and exit 77, which check.py and
run_gpu_tests.py report as SKIP (the same handling as #203), so ps_vcc_x2 doesn't turn into a FAIL there. Words
are decimal or 0x hex only (no octal, sign or spaces), a trailing comma is rejected, and an empty VKH_HEAP is unset.
Shaders that only use s_bcnt1_i32_b64 (and related mask ops) on ordinary
SGPR pairs were translated as wave32. Treat those ops as wave64 markers
and add a GPU test that expects a count of 48.