Skip to content

scripts: gpu_test_setup.py says what of the GPU tests this machine can run (GPU-TEST-SETUP) - #2389

Draft
syfyra wants to merge 3 commits into
ProjectLeonida:mainfrom
syfyra:feat/gpu-test-setup
Draft

syfyra wants to merge 3 commits into
ProjectLeonida:mainfrom
syfyra:feat/gpu-test-setup

Conversation

@syfyra

@syfyra syfyra commented Nov 26, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: GPU-TEST-SETUP (#1608 (comment))

Depends on: none. No open pull request changes these two files (checked with the scripts/pr_overlap.py of #2349).

What and why

docs/testing.md lists everything the GPU tests can use: llvm-mc with the AMDGPU target, SPIRV-Tools, the Vulkan test programs, a GPU. Not all of it is needed for a first result. run_gpu_tests.py already runs the fixtures kept as listings without llvm-mc (--disasm-dir tests/semantic/fixtures/disasm, 108 listings on main) and assembles with tools/spirv_asm.py when spirv-as is missing. Nothing says so up front, and which part is missing shows only when a run stops.

python -I scripts/gpu_test_setup.py looks once and prints what is there:

  • llvm-mc (from LLVM_MC, --llvm-mc or PATH, through tools/mc_command.py), its version and whether it has the AMDGPU target;
  • spirv-as and spirv-val, with what happens without them;
  • the test programs, in the build folders and configuration subfolders the runner searches: the three the runner requires, and the four more a full run starts (vk_texture_test, vk_bindless_test, vk_sampler_test, d3d12_texture_uav_test);
  • the listings, and the devices vulkaninfo reports with driver and subgroup range.

Then three levels, each with its command or what it still needs: semantic (Python alone), subset (the listings: the programs and a device, no llvm-mc, no SPIRV-Tools) and full (llvm-mc with the AMDGPU target and all seven programs as well). For a device whose largest subgroup is below 64 it says that the wave64 fixtures need a second run with LEONIDA_W64_EMULATE=1. --json gives the same as one object. It builds nothing, runs no test and writes nothing.

Tested

Windows 11, Python 3.14.7:

  • python -I tests/test_gpu_test_setup.py: 12 tests with stand-in tools (recorded --version and vulkaninfo text) and a temporary checkout: nothing installed, the subset without llvm-mc, an llvm-mc without and with the AMDGPU target, LLVM_MC as a whole command, --llvm-mc carried into the printed command, a build folder with a space, programs in a configuration subfolder and an incomplete build, SPIRV-Tools that do not start, the device parser, the text and JSON reports. One test reads scripts/run_gpu_tests.py to check that the program names and --disasm-dir it relies on are still the runner's.
  • First on this machine without llvm-mc, SPIRV-Tools or test programs: it reported both devices with their ranges, semantic: ready, and for subset and full the missing programs and llvm-mc.
  • Then with llvm-mc 21.1.8 (built by scripts\build_llvm_mc.ps1), SPIRV-Tools v2026.4 and the seven test programs built: subset and full are reported ready, and the commands it prints were run on both devices. Full run at main 935a2cd: NVIDIA GeForce RTX 5080 (driver 617.42, subgroup 32..32) 211/268 passed, 55 skipped, 2 failed native and 246/268 passed, 20 skipped, 2 failed with LEONIDA_W64_EMULATE=1; integrated AMD Radeon (Granite Ridge, driver 25.10.36, subgroup 32..64) 246/268 passed, 20 skipped, 2 failed in both runs. The two failures (cs_imgatomic_ext, cs_texture_uav) are in the tests, not in this script. Subset run on the RTX 5080: 83/101 passed, 17 skipped, 1 failed (cs_w64x_partial_swizzle, reported in GPU test: Intel Arc A770 (Alchemist) - 180/248 pass, 66 skip, 2 fail (the tfe pair in #31); retail exe maps with 0 unimplemented #725).
  • python -I on tests/test_tool_stdout_encoding.py, tests/test_text_write_line_endings.py and tests/test_ci_registration.py; python -I scripts/check_no_game_data.py on both files.
  • Not tested: Linux and macOS, Python 3.12, and no mutation check of the tests.

GPUs tested: NVIDIA GeForce RTX 5080 (driver 617.42) and AMD Radeon Graphics, Granite Ridge iGPU (driver 25.10.36), Windows 11: the commands this script prints, results above

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator rule in this change.)

🤖 Generated with Claude Code

…n run (GPU-TEST-SETUP)

docs/testing.md lists everything the GPU tests can use, but not all of it
is needed for a first result, and which part is missing shows only when a
run stops. run_gpu_tests.py already runs the fixtures kept as listings
without llvm-mc and assembles with tools/spirv_asm.py without SPIRV-Tools;
nothing tells a newcomer that this is enough to start.

scripts/gpu_test_setup.py looks once: llvm-mc and whether it has the
AMDGPU target, spirv-as and spirv-val, the three test programs in the
build folders the runner searches, the listings, and the devices
vulkaninfo reports with their subgroup range. It prints three levels
(semantic, subset, full) with the command for each or what is missing,
and says when a device needs the second run with LEONIDA_W64_EMULATE=1.
It builds nothing and runs no test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ecox982745

ecox982745 commented Nov 26, 2026 •

Copy link
Copy Markdown

I tested the ready paths at ed4403dd37 on Windows 11 with a physical RTX 4090 and test programs built from that revision. The survey correctly found NVIDIA 616.64, subgroup 32–32, LLVM 23.1.6 with AMDGPU, and 108 saved listings. All 10 setup unit tests passed. I found three cases where the report needs more information to give a working command.

Setup What the advertised command did Control
LLVM was supplied through the survey’s --llvm-mc option only. LLVM_MC was unset and LLVM was off PATH. The survey reported full ready, but the full command omitted the override and exited 1 looking for llvm-mc. Passing the same --llvm-mc to the runner produced all 80 expected words for cs_fmt_d16_xyz.
The build directory was named gpu build. Both commands printed --build gpu build. PowerShell passed two arguments and the runner exited 2 before testing. Quoting the directory produced all 80 expected words in both the saved-listing and assembled variants.
The build directory contained exactly the three detected programs. Full reported ready. On Windows --filter cs_texture_uav then failed looking for d3d12_texture_uav_test.exe, and --filter ps_ssharp failed looking for vk_sampler_test.exe. With the sampler helper present, all eight sampler cases matched, 4,096 pixels each.

Please carry the explicit LLVM argument through to the full command, quote path and command-valued arguments for the target shell, and identify the additional helpers needed for full fixture coverage. Each failure above can be checked using --filter and --require-pass.

The saved-listing path also exposed the previously reported partial-swizzle fixture gap. In a scratch copy I replaced just that listing with LLVM’s encoded listing from the repository’s synthetic assembly. With LLVM and SPIRV-Tools off PATH and LEONIDA_W64_EMULATE=1, the complete subset then passed 101/101 on the RTX 4090.

I also ran the full command with all the Windows helper binaries built. At the unmodified PR head, 278/278 shaders translated and passed SPIR-V validation. The runtime suite had 211 passes, 55 skips and two fixture failures. In a separate build at the same head I applied only the fixture changes from #1518 (7bcb5ba529) and #2261 (409da28db7). The default run then passed 213 with 55 skipped. Wave64 emulation passed 248 with 20 skipped. Neither run had a failure.

AI-assisted hardware verification with OpenAI Codex (GPT-6).

syfyra and others added 2 commits November 26, 2026 22:27
…ures start

Run on an RTX 5080 with only the three programs run_gpu_tests.py checks
for, the full run failed 30 fixtures with "could not start
vk_texture_test.exe" (and vk_bindless_test, vk_sampler_test,
d3d12_texture_uav_test), while this script called the level ready. The
full level now names the ones that are missing; the subset needs none of
them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two review findings on ProjectLeonida#2389: a build folder with a space was printed as
two arguments, and an llvm-mc given with --llvm-mc (not in LLVM_MC) made
the full level ready while the command it printed did not pass it on to
run_gpu_tests.py. The folder is quoted and the option is carried over.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@syfyra

syfyra commented Nov 26, 2026

Copy link
Copy Markdown
Author

Thanks for running it. All three are fixed, each with a test:

  • The programs the full run starts beyond the three the runner checks for (vk_texture_test, vk_bindless_test, vk_sampler_test, d3d12_texture_uav_test): full is ready only with them and names the missing ones (129f56c). I had hit the same thing here: with only the three, the full run failed 30 fixtures with "could not start".
  • A build folder with a space is printed in double quotes, and an llvm-mc given with --llvm-mc is carried into the printed full command; one from LLVM_MC is not repeated, since the runner reads it itself (d669e9a).

The description says the subset and full commands were not run on this machine. They have been since, at ed4403d with all seven programs built (Ninja, RelWithDebInfo, MSVC 14.44), Vulkan SDK 1.4.363.1 and an llvm-mc 21.1.8 built by scripts\build_llvm_mc.ps1, Windows 11:

  • NVIDIA GeForce RTX 5080, driver 617.42, subgroup 32..32: subset 83/101 passed, 17 skipped, 1 failed (cs_w64x_partial_swizzle, the listing without encodings you mention); full native 211/268 passed, 55 skipped, 2 failed; LEONIDA_W64_EMULATE=1 246/268 passed, 20 skipped, 2 failed. 278 shaders translated and passed spirv-val.
  • Integrated AMD Radeon, driver 25.10.36, subgroup 32..64: full native 246/268 passed, 20 skipped, 2 failed.
  • The two failures are the same on both devices: cs_imgatomic_ext (6 of 64 sint words differ, first word 32: got 0x0badf00d, expected 0x00000101) and cs_texture_uav (exit 1 from d3d12_texture_uav_test).

Not run: the emulated run on the AMD device, and the tests of this pull request on Linux, macOS or Python 3.12. AI-assisted.

@Rezn0r27

Copy link
Copy Markdown

Tested d669e9a on Windows 11 with Python 3.12. All 12 tests in tests/test_gpu_test_setup.py passed, with exit code 0.

I also ran scripts/gpu_test_setup.py on my HP OMEN with --build pointing to an extracted runtime-windows artifact from PR #1818, outside the checkout. It found the test programs, counted 108 listings, and reported both GPUs: Intel Graphics (101.8626, subgroup 8–32) and NVIDIA RTX 5070 Laptop (621.40, subgroup 32–32).

With llvm-mc, spirv-as, and spirv-val absent, the report showed semantic: ready, subset: ready, and full: not yet, and identified an AMDGPU-capable llvm-mc as the missing requirement for the full suite. The diagnostic exited with code 0. I did not run the suggested suites as part of this check.

Tested locally. AI-assisted setup and reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants