Resolve the conflicts with the test lists again. cs_bpermute32 now goes
through main's WAVE32_DUMPS/CS_DUMPS instead of its own W32_DUMPS list, and
the LDS row keeps main's d16 and ds_permute wording. A new pytest asserts
the wave32 ds_bpermute sequence (EXEC select, ballot bit, shuffle, select).
It fails with main's translator, so the fix is covered without a GPU, as a
review asked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up to #337, from the review points there:
- resolve_build_dir, CONFIG_DIRS and the "not found" message move from
scripts/run_gpu_tests.py into runtime/test/shaders/check.py, which
run_gpu_tests.py already imports from. check.py main() now finds the
programs in build/RelWithDebInfo, Release, Debug or MinSizeRel as well,
so `check.py <out>` (docs/design.md, "Reproduce the shader tests") works
with the Visual Studio generator.
- When the programs come from a configuration subfolder, one line says
which: `test programs: <folder> (newest of A, B)`, so a #166 report can
name the build it ran and a stale pick is visible.
- The "Test programs not found" message says the configuration subfolders
were searched too (and gets a space after the colon in run_gpu_tests.py).
- tests/test_gpu_build_dir.py: the printed line, the message, and two
main()-level tests (run_gpu_tests.main hands the resolved folder to
run_suite, check.main hands it to the first test) with the programs faked.
No GPU used. AI-assisted.
- 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.
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>
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 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.
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.
Set 0 as the translator declares it (docs/design.md, docs/d3d12_vulkan.md
section 5), in runtime/src/vulkan_bindless.h: the twenty bindings with the
array sizes vk_pipeline_check uses, and DescriptorTable (descriptor_table.h)
behind binding 2.
- An image has one index in its dimension (2D, 2D array, 3D, 1D), the same
in every binding of that dimension. The storage arrays hold 256, so an
image with a storage view gets an index below 256 and a read-only one
goes above while there is room.
- Index 0 of every array is a fallback (a 1x1 image of zeros, a nearest
clamping sampler), because a miss in the table is index 0.
- Changes are queued and written by flush(), one write a slot: a view
removed before the next flush is never written, so it may be destroyed
at once.
- insert_key / erase_key change the table; flush() copies it to the buffer,
into a new and larger one when it has grown. Erasing compacts a probe
cluster, which moves other keys' entries, and a new buffer rewrites
binding 2: flush_needs_idle() says when a flush would do either, so the
owner can make sure no command buffer that uses the set is still running.
- With update after bind the set may be flushed between submissions; with
partially bound only index 0 is written at creation.
Test: vk_bindless_test, run by runtime/test/shaders/check.py and
scripts/run_gpu_tests.py. ps_tex.asm, a hand-written RDNA2 pixel shader
built by build.py, loads a T# and an S# from a descriptor table and
samples: the translator's own lookup against the table and the set. It
draws the gradient with the T# at the fourth slot probed, the fallback
after the key is erased, the gradient after the table has grown into a new
buffer, another view at the same index and the fallback after removal,
with and without the descriptor-indexing flags; and it adds, removes and
destroys a view before its first flush, which the validation layer reports
if the write is still made.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Raise Unsupported when a voted branch's segment was not started by the vote's
own round. New tests cs_w64x_mask_reuse2 (EXEC reuse, read after a store,
half of a mask pair rewritten, chained successor starting with a conflicting
load) and cs_w64x_chain_barrier (chained successor starting with s_barrier),
plus a translation test counting mask exchanges. bench_wave64.py reports a
missing bench line readably and compares against the native AMD output.
design.md: how the rules were confirmed, current GPU counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A whole-mask read of a register value already exchanged in the block reuses
the exchange; a block ending in a voted branch runs its successor in the
round that reads the vote. Adds scripts/bench_wave64.py, cs_bench_mix,
VKC_BENCH timing in vk_compute_test and the cs_w64x_mask_reuse test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>