[PR #614] [MERGED] run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING) #655

Closed
opened 2026-11-26 20:18:36 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/614
Author: @TuroYT
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: fix/run-gpu-spirvas-missing


📝 Commits (1)

  • 078d014 run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING)

📊 Changes

2 files changed (+46 additions, -2 deletions)

View changed files

📝 scripts/run_gpu_tests.py (+7 -2)
📝 tests/test_run_gpu_tests_python_assembler.py (+39 -0)

📄 Description

Claimed in the coordination issue as: RUN-GPU-SPIRVAS-MISSING (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128005394)

What was wrong. spirv_as in scripts/run_gpu_tests.py (line ~152) ran spirv-as without an OSError handler. With no spirv-as on PATH, the three calls in run_suite (around line 942) ended the run with a raw FileNotFoundError traceback, after the assemble and translate steps.

What changed. spirv_as now turns the OSError into a RuntimeError, the type a failed assembly already raises:

  • FileNotFoundError: spirv-as not found on PATH (use --assembler python to assemble with tools/spirv_asm.py)
  • other OSError: spirv-as could not be started: <strerror>

Nothing else changed. The callers do not catch RuntimeError either (see the gap below).

Tests. Two new tests in tests/test_run_gpu_tests_python_assembler.py for 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 unfixed main: the two new OSError tests ERROR, the other 8 pass.
  • python3 -I tests/test_run_gpu_tests.py: 64 OK. The other tests/test_run_gpu_*.py files: OK.
  • Reproduction with 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).
  • Fake spirv-as exiting 3: RuntimeError carrying its stderr, as before.
  • Fake spirv-as exiting 0 with empty input: no exception.
  • Real spirv-as with empty input: RuntimeError with spirv-as's own message, as before.
  • Non-executable spirv-as on PATH: spirv-as could not be started: Permission denied.
  • python3 -I scripts/check_no_game_data.py on the two changed files: clean.
  • python3 -m compileall -q scripts tests: clean.

Not tested: a real GPU run; a full run_suite with a built runtime and game work folder; Windows, where spirv-as.exe lookup goes through the same code path but was not run.

Known gap, left for a decision. run_suite does not catch RuntimeError, so a missing spirv-as still ends in a traceback. Its last line is now the readable message, the same as a failed assembly today. Catching it in run_suite would change the exit path for every assembly failure, so it is not in this PR.

AI-assisted (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/614 **Author:** [@TuroYT](https://github.com/TuroYT) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `fix/run-gpu-spirvas-missing` --- ### 📝 Commits (1) - [`078d014`](https://github.com/ubiquitarianism/leonida/commit/078d0144ada566d48b93f7dd15174d83c6043c07) run_gpu_tests: report a missing spirv-as instead of a traceback (RUN-GPU-SPIRVAS-MISSING) ### 📊 Changes **2 files changed** (+46 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `scripts/run_gpu_tests.py` (+7 -2) 📝 `tests/test_run_gpu_tests_python_assembler.py` (+39 -0) </details> ### 📄 Description Claimed in the coordination issue as: RUN-GPU-SPIRVAS-MISSING (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128005394) **What was wrong.** `spirv_as` in `scripts/run_gpu_tests.py` (line ~152) ran `spirv-as` without an `OSError` handler. With no `spirv-as` on PATH, the three calls in `run_suite` (around line 942) ended the run with a raw `FileNotFoundError` traceback, after the assemble and translate steps. **What changed.** `spirv_as` now turns the `OSError` into a `RuntimeError`, the type a failed assembly already raises: - `FileNotFoundError`: `spirv-as not found on PATH (use --assembler python to assemble with tools/spirv_asm.py)` - other `OSError`: `spirv-as could not be started: <strerror>` Nothing else changed. The callers do not catch `RuntimeError` either (see the gap below). **Tests.** Two new tests in `tests/test_run_gpu_tests_python_assembler.py` for 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 unfixed `main`: the two new OSError tests ERROR, the other 8 pass. - `python3 -I tests/test_run_gpu_tests.py`: 64 OK. The other `tests/test_run_gpu_*.py` files: OK. - Reproduction with `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)`. - Fake `spirv-as` exiting 3: `RuntimeError` carrying its stderr, as before. - Fake `spirv-as` exiting 0 with empty input: no exception. - Real `spirv-as` with empty input: `RuntimeError` with spirv-as's own message, as before. - Non-executable `spirv-as` on PATH: `spirv-as could not be started: Permission denied`. - `python3 -I scripts/check_no_game_data.py` on the two changed files: clean. - `python3 -m compileall -q scripts tests`: clean. **Not tested:** a real GPU run; a full `run_suite` with a built runtime and game work folder; Windows, where `spirv-as.exe` lookup goes through the same code path but was not run. **Known gap, left for a decision.** `run_suite` does not catch `RuntimeError`, so a missing `spirv-as` still ends in a traceback. Its last line is now the readable message, the same as a failed assembly today. Catching it in `run_suite` would change the exit path for every assembly failure, so it is not in this PR. AI-assisted (Claude Code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:36 +01:00
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#655
No description provided.