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

Open
opened 2026-11-26 21:21:05 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2389
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: feat/gpu-test-setup


📝 Commits (1)

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

📊 Changes

2 files changed (+407 additions, -0 deletions)

View changed files

➕ scripts/gpu_test_setup.py (+193 -0)
➕ tests/test_gpu_test_setup.py (+214 -0)

📄 Description

Claimed in the coordination issue as: GPU-TEST-SETUP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198352545)

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 three test programs, in the build folders and configuration subfolders the runner searches;
  • 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 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: 10 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, 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.
  • On this machine (NVIDIA GeForce RTX 5080, driver 617.42, subgroup 32..32, and an integrated AMD Radeon, subgroup 32..64; no llvm-mc, no SPIRV-Tools on PATH, test programs not built) it reports both devices with their ranges, semantic: ready, and for subset and full the missing programs and llvm-mc.
  • 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: a machine where the levels subset and full are ready (the commands it prints for them were not run here), Linux and macOS, Python 3.12, and no mutation check of the tests.

GPUs tested: n/a (no GPU test was run; vulkaninfo was read on the two devices 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2389 **Author:** [@syfyra](https://github.com/syfyra) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/gpu-test-setup` --- ### 📝 Commits (1) - [`ed4403d`](https://github.com/ubiquitarianism/leonida/commit/ed4403dd370336eec1283f2ab4a7e736856b2962) scripts: gpu_test_setup.py says what of the GPU tests this machine can run (GPU-TEST-SETUP) ### 📊 Changes **2 files changed** (+407 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `scripts/gpu_test_setup.py` (+193 -0) ➕ `tests/test_gpu_test_setup.py` (+214 -0) </details> ### 📄 Description Claimed in the coordination issue as: GPU-TEST-SETUP (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7198352545) 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 three test programs, in the build folders and configuration subfolders the runner searches; - 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 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`: 10 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, 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. - On this machine (NVIDIA GeForce RTX 5080, driver 617.42, subgroup 32..32, and an integrated AMD Radeon, subgroup 32..64; no llvm-mc, no SPIRV-Tools on PATH, test programs not built) it reports both devices with their ranges, `semantic: ready`, and for `subset` and `full` the missing programs and llvm-mc. - `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: a machine where the levels `subset` and `full` are ready (the commands it prints for them were not run here), Linux and macOS, Python 3.12, and no mutation check of the tests. GPUs tested: n/a (no GPU test was run; `vulkaninfo` was read on the two devices above) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] 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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2391
No description provided.