Commit Graph

71 Commits

Author SHA1 Message Date
8550970f10 Merge upstream GPU fixture dependencies into the two-mip test
Preserve the cube test's isolated vertex shader and count the new upstream compute checks alongside the two-mip draw.
2026-11-22 00:28:50 +01:00
dbc785f9e5 Merge pull request #332 from fearkov
# Conflicts:
#	tests/semantic/regen_fixtures.py
2026-11-21 18:09:52 -05:00
0d5ba399c0 Merge pull request #247 from crastinator
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 18:07:52 -05:00
7761916406 Merge pull request #303 from mrb-eel 2026-11-21 18:07:42 -05:00
76add28b8a Merge pull request #315 from Vonsek 2026-11-21 18:07:38 -05:00
77db72f602 run_gpu_tests: find the test programs in RelWithDebInfo/Release (TEST-38)
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.
2026-11-22 00:04:20 +01:00
1186f99340 Merge updated Leonida GPU runner into class compare fix 2026-11-21 23:57:44 +01:00
adbe6fd42e Tests: ps_scc_minmax checks SCC of s_min and s_max on a tie 2026-11-21 18:54:42 -04:00
7fefe7f425 Merge upstream cube sampling with the two-mip Vulkan fixture
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.
2026-11-21 23:51:27 +01:00
4dfdbc3f0e fix: build the vertex shader for filtered cube tests
The cube harness loads vs_ids at runtime, so a standalone fragment filter needs the same draw dependency as the ordinary texture fixture.
2026-11-21 23:50:12 +01:00
b933118d32 GPU tests: run ps_vcc_x2 on the GPU with a seeded V# and heap in vk_harness (TEST-19)
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.
2026-11-22 00:44:48 +02:00
ce1eb6ae85 Merge latest Leonida main into class compare fix 2026-11-21 23:42:07 +01:00
0bcf104719 Merge upstream/main and retain both Vulkan texture checks 2026-11-21 23:41:25 +01:00
cd4fc9a606 Merge pull request #247 from crastinator 2026-11-21 17:38:38 -05:00
30ad4802c4 Merge pull request #298 from AlxcBTW
# Conflicts:
#	docs/design.md
#	tests/test_translate.py
2026-11-21 17:38:35 -05:00
b779cc17e1 Merge pull request #301 from Shuvam Pandey 2026-11-21 17:38:32 -05:00
1fa7b7f435 Merge pull request #142 from ttd0x
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 17:38:30 -05:00
5e0400fe52 Merge pull request #203 from Ayinaki 2026-11-21 17:38:29 -05:00
3a1bfb50f5 Merge pull request #290 from crastinator 2026-11-21 17:38:29 -05:00
8e2bc63836 Merge pull request #287 from troythedecoyx 2026-11-21 17:38:29 -05:00
bcdb954190 Merge pull request #280 from DiazE117
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 17:38:28 -05:00
05df043d00 Merge pull request #265 from Vorpe Jérémy
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 17:38:28 -05:00
fa8beb755a Translate v_cmpx_class_f32 as an EXEC-only compare 2026-11-21 23:35:42 +01:00
d798c76853 test: distinguish explicit mip zero from implicit minification on Vulkan
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.
2026-11-21 23:31:25 +01:00
b9552cd924 Translator: convert cube sample coordinates for the 2D-array view
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.
2026-11-22 04:15:43 +05:45
55459fa124 run_gpu_tests: ps_texture_sample with a relative --build or a --filter
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).
2026-11-22 00:29:12 +02:00
a2e41646c8 GPU tests: report a test program Windows refuses to start, not a traceback
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>
2026-11-21 16:26:33 -06:00
94ff4c9da9 Merge remote-tracking branch 'origin/main' into test19-vcc-x2-gpu
# Conflicts:
#	runtime/test/shaders/check.py
#	runtime/test/vk_harness.cpp
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 00:24:49 +02:00
6de5bd46b4 run_gpu_tests: run cs_wavemask on any subgroup size with LEONIDA_W64_EMULATE=1
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>
2026-11-21 16:19:14 -06:00
9fcf3d88f7 run_gpu_tests: judge the compute dumps like check.py does (eight decimal words, 64-wide confirmation)
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.
2026-11-22 00:17:56 +02:00
6d3f80a0ff GPU tests: skip bitmask_perm on unknown width, carry the harness skip reason
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.
2026-11-21 22:10:27 +00:00
cc1f4d3597 Merge pull request #230 from Jan Trencansky
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 17:09:46 -05:00
01e23b6175 Merge pull request #208 from dcastell1 2026-11-21 17:07:41 -05:00
fdaf5e402e Merge pull request #246 from LuanFreitas 2026-11-21 17:07:40 -05:00
2765bbfc22 run_gpu_tests: honor LEONIDA_W64_EMULATE via a w64_emulated() helper (cmd.exe leaves a trailing space in 'set VAR=1 &', so the raw == '1' parse drops the flag and mis-sorts the wave64 emulated results on a 32-wide GPU) 2026-11-21 23:01:48 +01:00
d9c0ab5b48 vk_harness: VKH_HEAP on a device without buffer addresses is a SKIP; stricter VKH_SGPRS/VKH_HEAP parsing
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.
2026-11-21 23:57:11 +02:00
34f63c6c62 Translator: detect wave64 from 64-bit lane-mask SOP ops (#210)
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.
2026-11-21 18:57:04 -03:00
69ff8e5c72 Runtime: bindless set 0 (M2)
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>
2026-11-21 16:56:56 -05:00
36ace7135e Merge pull request #222 from simonbronk
# Conflicts:
#	docs/design.md
#	tests/semantic/test_alu_perm_alignbit.py
#	tools/rdna2spirv.py
2026-11-21 16:56:10 -05:00
047d4d9b60 Wave64 emulation: guard the chained voted branch, more tests, bench reference
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>
2026-11-21 22:52:35 +01:00
cdaef79a7d Wave64 emulation: fewer rounds (reuse mask exchanges, chain voted branches), benchmark
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>
2026-11-21 22:52:35 +01:00
3fae38a7a1 GPU tests: ms_v5_workgroup expects #209's v5 (group * NumThreads + lane); run_gpu_tests runs #167's ps_texture_sample
#219's checker was written for the older workgroup-index model; on an RTX 4060 Ti lanes 0/1/31 of every
group read 32g, 32g+1, 32g+31, which is #209's model (the game's mesh entry shifts v5 right by 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:51:24 -05:00
58f3fe8f6b GPU tests: run ps_vcc_x2 on the GPU with a seeded V# and heap in vk_harness (TEST-19)
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) and VKH_HEAP (addr=word seeds in a 64 KiB device-address heap, passed as the heap
base, with bufferDeviceAddress and shaderInt64 enabled only then). Both runners give ps_vcc_x2 the V# and words
tests/semantic uses and expect 0x11223344 0x55667788 0 0.
2026-11-21 23:51:16 +02:00
59fc0da713 fix(xbox): run cs_wavemask under wave64 emulation in run_gpu_tests
SHADER-12: check.py already passes --require-wave64 only when
LEONIDA_W64_EMULATE is not 1. run_gpu_tests.py passed it
unconditionally, so cs_wavemask was skipped on every 32-wide GPU
even when the wave64 emulation path was active.

Mirror check.py: omit the flag under emulation and only apply the
64-wide-subgroup skip/confirmation checks when the flag is set.
2026-11-21 22:50:33 +01:00
8b4d2f781e Merge pull request #212 from Ayinaki
# Conflicts:
#	tests/test_shader_checks.py
2026-11-21 16:38:46 -05:00
a81bcb8284 Merge pull request #207 from LouisRiverstone
# Conflicts:
#	runtime/test/vk_harness.cpp
2026-11-21 16:38:32 -05:00
e9cb0b0e68 Merge pull request #203 from Ayinaki
# Conflicts:
#	tests/test_shader_checks.py
2026-11-21 16:38:18 -05:00
48adc7b9a5 Translator: v_perm_b32 sign selectors 8-11; integer ALU tests ps_ops7/ps_ops8
v_perm_b32 returned 0x00 for selectors 8-11. Per the RDNA ISa BYTE_PERMUTE
they give 0xff when bit 7 of byte 1, 3, 5 or 7 of {src0, src1} is set. Each
byte pick also shifted both sources by up to 56 bits (undefined in SPIR-V,
the select kept the right one); the shift is now (sel & 3) * 8 on the source
chosen by sel < 4.

New test shaders, checked on the GPU (check.py, run_gpu_tests.py) and in
tests/semantic with expected words derived from the ISA:
- ps_ops7: v_perm_b32 (byte picks, 0x00/0xff, sign selectors), v_alignbit_b32
  with a shift of 36, v_med3_i32 vs v_med3_u32.
- ps_ops8: v_mul_hi_u32/i32, v_bcnt_u32_b32, v_ffbl_b32, v_ffbh_u32 (of 0),
  v_xad_u32, v_add3_u32.

The semantic interpreter gains OpUMulExtended/OpSMulExtended,
OpUGreaterThanEqual and GLSL FindILsb, FindUMsb, UMax, SMin, UClamp, SClamp,
with direct tests; the unsupported-ext example moves from FindUMsb to Ldexp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:33:25 +01:00
e8a0b11ada Test mesh v5 against all 24 coordinates of a 3D draw 2026-11-21 22:33:25 +01:00
cdc67e4d20 GPU tests: report gs_tri/ms_tri as SKIP without geometry or mesh shaders (TEST-18)
vk_harness exits 77, the code vk_compute_test and vk_store_test already use for a
device that cannot run a test, when VKH_GS is set and the device has no
geometryShader, or VKH_MESH is set and it has no VK_EXT_mesh_shader. Before, a
missing mesh extension exited 1 and a missing geometryShader failed in
vkCreateDevice with VK_ERROR_FEATURE_NOT_PRESENT (MoltenVK, #166).

run_gpu_tests.py (gs_tri, ms_tri, ms_w64x_ballot, ms_clip) and check.py
(ms_w64x_ballot) turn that exit code into SKIP, quoting the harness's reason.
2026-11-21 18:29:45 -03:00