Commit Graph

105 Commits

Author SHA1 Message Date
e1fb6bce2d Merge pull request #424 from Tomgamer 2026-11-21 19:14:02 -05:00
7d15dab8a3 Merge pull request #343 from Andrea
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-21 19:08:36 -05:00
2da77d56e6 Merge pull request #269 from shelbykb2 2026-11-21 19:08:26 -05:00
2c6f763e5f Merge pull request #240 from eIBart0 2026-11-21 19:08:23 -05:00
e66e969597 Merge pull request #193 from AREA52 Agent 2026-11-21 19:08:21 -05:00
e53b9e5450 Tests: add ms_wave_info_s3 mesh shader test for s3[27:24] wave ID 2026-11-21 21:05:43 -03:00
1284712038 Docs/Tools: record SHADER-4 corpus counts and add audit_shader4_regs.py 2026-11-21 21:05:25 -03:00
add0b5cfce GPU test for texel offsets (image_sample*_o, image_gather4_lz_o)
SHADER-14. runtime/test/shaders/ps_texoff.asm samples vk_texture_test's 8x8
texture (every texel different, point sampler, clamp to edge) through the
translated shader and exports the texel coordinates it read as integers:

- image_sample_lz_o with an offset computed per pixel: all 64 pairs of x, y
  in -4..3 from the centre of texel (4, 4), each a different texel, none
  clamped;
- image_sample_l_o with (-3, +2) and image_sample_lz_o with (+16, -32), the
  offset dword loaded from an immediate. The second one tells 4-bit, 5-bit
  and 6-bit fields apart; it is outside Vulkan's guaranteed -8..7 and is
  judged only where the device's texel offset limits cover it;
- image_gather4_lz_o of red and of green with the per-pixel offset, at a
  texel corner (shaderImageGatherExtended, not maintenance8).

Expected words are derived by hand from the docs/design.md rule (signed
6-bit fields, x [5:0], y [13:8]) and the texture contents, before any run;
the derivation is in the .asm header and check.py's texoff_words().

Harness: vk_texture_test enables VK_KHR_maintenance8 and
shaderImageGatherExtended when the device has them, prints the texel offset
limits, and with VKT_NEED_MAINTENANCE8=1 exits 77 without the extension
(SKIP in check.py and scripts/run_gpu_tests.py).

vk_harness.cpp is unchanged: its maintenance8 guard (#if defined() on the
structure-type enumerator, never true) was already fixed upstream, which now
uses #ifdef VK_KHR_MAINTENANCE_8_EXTENSION_NAME.

tests/conftest.py: the sample validator retries with
--allow-offset-texture-operand (what rdna2spirv.py validates with) when
spirv-val rejects a non-gather Offset, and skips on a spirv-val that does not
know the flag.

Tested on an AMD Radeon RX 6800, Windows, driver 26.11.2 (texel offset limits
-64..63, gather -32..31, maintenance8 enabled):
  run_gpu_tests.py: 49/50 passed, 1 skipped (was 48/49, 1 skipped)
    PASS  ps_texoff  4096/4096 pixels exact (offsets +16/-32 judged)
  check.py: 45 of 45 pass, 0 skipped (was 44 of 44)
No translator bug found: tools/rdna2spirv.py is unchanged.

Negative controls (translator sabotaged, test run, reverted). FAIL: sample
offset dropped, x/y swapped, y field at bit 6, 4-bit fields, 5-bit fields;
gather offset dropped, x/y swapped, y field at bit 6; three corrupted
expectations. PASS, so not detected on this GPU:
- fields read unsigned (sample and gather): Offset 60..63 sampled as -4..-1
  and +32 as -32, so the sign extension cannot be seen through Vulkan here;
- 4-bit and 5-bit gather fields: the gather offsets stay in -4..3.
Both are pinned by the new structural test tests/test_texel_offsets.py
instead (signed, bit 8k, 6 bits; it fails with OpBitFieldUExtract).

The test shows that the translated SPIR-V implements the documented rule on
Vulkan; it does not measure the field layout on the hardware. Still not
GPU-tested: sign extension, gather field width, image_sample_o, _b_o,
_c_lz_o, image_gather4_l_o, the z field (3D), 1D/2D-array/cube targets, wrap
or mirror addressing, linear filtering, mips other than 0, other vendors'
drivers, devices without maintenance8.

unittest tests/semantic: 388 OK before and after.
pytest tests (LLVM_MC set): 1467 passed, 6 skipped, 1 xfailed before;
1478 passed, 6 skipped, 1 xfailed after.

AI-assisted.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:55:18 -07:00
41cb7c541c pe_inspect.py: one report per input image (same-stem inputs overwrote each other)
Reports were named after the image's stem, so game.exe + game.dll, or a/x.exe +
b/x.exe, in one call wrote the same <out>/<stem>.json/.md and the last one won,
with exit 0. Reports are now named after the full file name (game.exe.json,
game.dll.md); a second image with the same file name from another directory
gets a numbered suffix (x.exe-2.json), compared case-insensitively, and the
name used is printed to stderr. The same path given twice is inspected once.

scripts/first_look.ps1, the only consumer of the report name, reads
<exe file name>.json. Tests cover the exe/dll pair and the two-directory case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:49:13 +01:00
648a84a930 Merge pull request #400 from Ewann 2026-11-21 18:43:26 -05:00
eb330b6864 Resolve generated clip variants through their shared assembly source 2026-11-21 15:40:46 -08:00
cdd98c1f8c Merge pull request #352 from AlxcBTW
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
2026-11-21 18:38:00 -05:00
84c66f7196 Merge pull request #331 from fearkov 2026-11-21 18:37:54 -05:00
8b92bcef0d Merge pull request #193 from AREA52 Agent 2026-11-21 18:37:42 -05:00
714531412f check.py: find the Visual Studio build folders too; say which one was used (TEST-38 follow-up)
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.
2026-11-22 00:35:00 +01:00
25ca1d63f2 Merge upstream main into SHADER-7 and retain filtered clip dependencies 2026-11-21 15:31:09 -08:00
993a2cbf72 Runtime: install static TLS for mapped images 2026-11-21 23:29:24 +00:00
03bd5a0b20 Tests: ps_fma_literal checks which operand the literal multiplies 2026-11-21 19:24:37 -04:00
0a5f0688c5 test: report missing GPU executables per build config 2026-11-22 00:13:33 +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
988aeecf97 test: locate GPU test executables in VS build configs 2026-11-22 00:07:27 +01:00
abefe80779 Merge origin/main into shader-34-wqm; WQM review fixes
- 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>
2026-11-22 00:06:34 +01: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
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
3dd8007237 translator: whole-quad mode (s_wqm_b32/b64) on lane masks and data (SHADER-34)
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>
2026-11-21 23:45:36 +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
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
eef019d7ba Keep clip regressions alongside the merged bindless texture check 2026-11-21 14:37:58 -08:00
fa8beb755a Translate v_cmpx_class_f32 as an EXEC-only compare 2026-11-21 23:35:42 +01:00
ce41eba4f7 Merge current main and preserve distinct mesh and clip harness modes 2026-11-21 14:33:12 -08: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