Skip to content

CI: install SPIRV-Tools in the semantic-tests job; a missing tool fails instead of skipping (TEST-604) - #3091

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Etoile-Bleu:test-604-spirv-tools-ci
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Etoile-Bleu:test-604-spirv-tools-ci

Conversation

@Etoile-Bleu

@Etoile-Bleu Etoile-Bleu commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-604 (claim); found by @tupacfan04.

What and why

The semantic-tests job installs nothing, and the runner images have neither spirv-as nor spirv-val. Every semantic test that assembles or validates the translator's output with them skips (test_fma_khr, test_bary_fallback, test_image_coherent, and others), so the job reports green for tests that never ran.

  • .github/workflows/ci.yml: the Linux leg of semantic-tests installs spirv-tools and runs with LEONIDA_REQUIRE_SPIRV_TOOLS=1. The Windows leg is unchanged (it has no SPIRV-Tools and keeps skipping those tests).
  • tests/semantic/test_spirv_tools_required.py (new): with LEONIDA_REQUIRE_SPIRV_TOOLS=1, a missing or non-running spirv-as / spirv-val is a failure. Without the variable it skips, so a developer's machine is unaffected.
  • tests/test_ci_registration.py (the tests: guard CI test registration across both jobs #2188 guard): finds the tests/semantic files that skip without SPIRV-Tools and fails when the semantic-tests job does not apt-get install spirv-tools or does not set LEONIDA_REQUIRE_SPIRV_TOOLS to 1. It reads the job from ci.yml, not from a copy. A second test builds broken copies of the workflow and checks that each problem is named.

Tested

  • The branch on my fork's CI (workflow_dispatch, run 45059604321): both semantic-tests legs pass. On ubuntu-latest the suite is 4143 tests, none skipped, in 267 s (under the job's 10 minute limit), and test_fma_khr.test_spirv_tools_accept_it and the new test both report ok, with the distro's spirv-tools. On windows-latest the same tests report skipped as before (OK, skipped=5).
  • Locally on Windows 11 with the Vulkan SDK's SPIRV-Tools: python -I tests/test_ci_registration.py 7/7. With LEONIDA_REQUIRE_SPIRV_TOOLS=1 and the tools off PATH, test_spirv_tools_required.py fails with "spirv-as is not on PATH"; with them on PATH it passes; without the variable it skips.
  • Against the original ci.yml the new guard test fails with "it does not apt-get install spirv-tools; it never sets LEONIDA_REQUIRE_SPIRV_TOOLS to 1".
  • Not related to this change: the check job fails on windows-latest in tests/test_report_paths.py::test_macos_case_sensitive_volume_keeps_case (path_key lower-cases a Windows path), and it fails the same way on a clean checkout of main 16282101. tests: pass the no-game Python tests on Windows with a non-ASCII profile path #2984 already fixes it, so that job should go green once it lands.
  • No GPU involved.

Open question: should the Windows leg get SPIRV-Tools too (for example choco install vulkan-sdk)? I left it out because it is a large install against a 10 minute job limit.

AI-assisted (Claude Code). No game data.

Checklist

  • 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.)

@Vyral1978

Copy link
Copy Markdown
Contributor

From the closed duplicate #3111: one addition you could consider. On the Linux leg, also fail when unittest's summary reports any skipped=, not only when SPIRV-Tools is missing. Then a test that later skips on something else can't go green silently either. The step I had:

log="$RUNNER_TEMP/semantic.log"
python -m unittest discover -s tests/semantic -v 2>&1 | tee "$log"
if [[ "$FAIL_ON_SKIP" == true ]] && grep -Eq '^(OK|FAILED) \(.*skipped=[0-9]+' "$log"; then
  echo "::error::semantic tests were skipped on a runner that has every tool they need:"
  grep -E '\.\.\. skipped' "$log" || true
  exit 1
fi

(shell: bash, PYTHONUTF8: "1", FAIL_ON_SKIP: ${{ runner.os == 'Linux' }}.) With SPIRV-Tools on PATH the full suite has 0 skips today: 4,142 tests on Windows 11. It's your call; feel free to ignore it.

@Etoile-Bleu

Copy link
Copy Markdown
Contributor Author

Thanks @Vyral1978. I checked the idea against our fork run: on the Linux leg the suite is 4143 tests with no skips today, so a fail-on-skip step would pass now.

I did not add it, because it turns any test that later skips on Linux for a legitimate reason (a missing GPU or driver, a platform check) into a red job for whoever adds it, and the cost of that falls on contributors rather than on the tests that were going quiet. The SPIRV-Tools case, which was the silent one, is covered by the install step plus test_spirv_tools_required.py, and the guard in tests/test_ci_registration.py keeps ci.yml doing both.

If @ItsNotRexed or @KoertLichtendonk would rather have the blanket rule, I'll add your step (with an allowlist for skips that are expected on a runner) on this PR. Your note on test_cmp_class_f32_mods.py is already covered: the guard's scan picks it up through its which("spirv-as") and skipTest. (Written with AI assistance.)

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 8d56b13 on Windows 11 (Python 3.13.7, Vulkan SDK 1.4.363 SPIRV-Tools on PATH, no game files): pass for the Python side; the workflow step itself can't run locally

  • python -I tests/test_ci_registration.py at the head: 7 tests, OK. The scan finds 4 tests/semantic files gated on spirv-as/spirv-val.
  • Same test file on the merge base 1628210 (its ci.yml): 2 failures, both new tests, with it does not apt-get install spirv-tools; it never sets LEONIDA_REQUIRE_SPIRV_TOOLS to 1, so the guard does catch the old job.
  • tests/semantic/test_spirv_tools_required.py: without the variable, and with LEONIDA_REQUIRE_SPIRV_TOOLS=0: skipped. With =1 and the tools on PATH: OK. With =1 and a PATH holding only Python: fails with spirv-as is not on PATH: the tests gated on SPIRV-Tools would all skip.
  • Merged locally with current main (f847748; tests/test_ci_registration.py auto-merges): python -I tests/test_ci_registration.py still 7 tests, OK.

Not run: the apt-get install spirv-tools step and the Linux leg of semantic-tests (GitHub Actions only; I did not look at the fork run the description cites). AI-assisted check (Claude Code).

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.

4 participants