run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING) #614
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!614
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/614/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@TuroYT on GitHub · 2026-11-24 09:56 UTC · original
TuroYT:fix/run-gpu-spirvas-missing→main· +46 −2 · 2 files · 1 commits · merged 2026-11-24 12:43 UTCClaimed in the coordination issue as: RUN-GPU-SPIRVAS-MISSING (#14)
What was wrong.
spirv_asinscripts/run_gpu_tests.py(line ~152) ranspirv-aswithout anOSErrorhandler. With nospirv-ason PATH, the three calls inrun_suite(around line 942) ended the run with a rawFileNotFoundErrortraceback, after the assemble and translate steps.What changed.
spirv_asnow turns theOSErrorinto aRuntimeError, the type a failed assembly already raises:FileNotFoundError:spirv-as not found on PATH (use --assembler python to assemble with tools/spirv_asm.py)OSError:spirv-as could not be started: <strerror>Nothing else changed. The callers do not catch
RuntimeErroreither (see the gap below).Tests. Two new tests in
tests/test_run_gpu_tests_python_assembler.pyfor the two messages, plus two guards for the existing behaviour (stubbed successful run, nonzero exit with stderr).Tested:
python3 -I tests/test_run_gpu_tests_python_assembler.py: 10 tests OK. On unfixedmain: the two new OSError tests ERROR, the other 8 pass.python3 -I tests/test_run_gpu_tests.py: 64 OK. The othertests/test_run_gpu_*.pyfiles: OK.PATH=/nonexistent: before,FileNotFoundError: [Errno 2] ... 'spirv-as'; after,RuntimeError: spirv-as not found on PATH (use --assembler python to assemble with tools/spirv_asm.py).spirv-asexiting 3:RuntimeErrorcarrying its stderr, as before.spirv-asexiting 0 with empty input: no exception.spirv-aswith empty input:RuntimeErrorwith spirv-as's own message, as before.spirv-ason PATH:spirv-as could not be started: Permission denied.python3 -I scripts/check_no_game_data.pyon the two changed files: clean.python3 -m compileall -q scripts tests: clean.Not tested: a real GPU run; a full
run_suitewith a built runtime and game work folder; Windows, wherespirv-as.exelookup goes through the same code path but was not run.Known gap, left for a decision.
run_suitedoes not catchRuntimeError, so a missingspirv-asstill ends in a traceback. Its last line is now the readable message, the same as a failed assembly today. Catching it inrun_suitewould change the exit path for every assembly failure, so it is not in this PR.AI-assisted (Claude Code).
@GeorgiyDemo on GitHub · 2026-11-24 11:18 UTC · original
Tested
078d0144on Apple M5 Pro, macOS 26.7.3 (25G342), withspirv-asremoved fromPATH:python3 -I tests/test_run_gpu_tests_python_assembler.py: 10 tests OK at this head.--assembler auto(the default) and nospirv-asonPATH,run_gpu_tests.py --filter ps_texfalls back totools/spirv_asm.pyand the run completes: 12/12 passed, onmainand on this head.--assembler spirv-asand nospirv-asonPATH, both revisions stop earlier, inrdna2spirv.py, withERROR: spirv-as not found; install SPIRV-Tools (spirv-as, spirv-val) and put it on PATH, beforespirv_asin the runner is called.So on this setup the new
OSErrorguard is only exercised by the unit tests; that is not a defect in the change, but the traceback it replaces was not reachable by either path here. Binaries frommain, no rebuild.AI-assisted; synthetic fixtures only, no game data.
@TuroYT on GitHub · 2026-11-24 11:21 UTC · original
Thanks for running it. I checked the code path and you are right: I overstated how reachable this is.
In
run_suite, the translator step (rdna2spirv.py) runs unconditionally before thespirv_ascalls and the run returns 1 if it fails, so with--assembler spirv-asand nospirv-ason PATH the run already stops there with a readable error. With--assembler auto,resolve_assemblerpicks the Python assembler whenspirv-asis missing. The newOSErrorhandler is only reached ifspirv-asdisappears between the translator step and the helper-shader step, or if the translator stops needing it. The traceback I described in the claim comes from callingspirv_as()directly with an empty PATH, not from a CLI run.So this is defence in depth, not a user-visible fix. I could not run the full CLI path here (no built Vulkan test programs), so that part rests on reading the code and on your run. I am fine with this being closed if you would rather not carry the extra branch.
@Dezmonius on GitHub · 2026-11-24 12:25 UTC · original
Independent Windows 10 check of
078d0144on21625bc, CPython 3.14.7. All 10 assembler tests and 64 runner tests passed. With the new assembler tests on the old runner, exactly the two new OSError cases failed as expected.I exercised the late-failure path in
run_suitewith a synthetic translator-success stub.--assembler autofound a temporaryspirv-as.exeon PATH, and the stub removed that file before the helper call. The real Windows subprocess lookup then raisedFileNotFoundError(WinError 2) on main and the expectedRuntimeError: spirv-as not found on PATHon the PR. A second run retained a deliberately invalid fixture namedspirv-as.exe: WinError 216 on main becameRuntimeError: spirv-as could not be startedon the PR. In both PR cases the current caller still propagates the exception, consistent with the stated scope.Synthetic fixtures only, no GPU or game files. AI-assisted (Codex).