tests/semantic: skip spirv-as/spirv-val checks when SPIRV-Tools absent (TEST-SOPC-UNARY-SPIRV-TOOLS) #676
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!676
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/676/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?
@kirigayakazima on GitHub · 2026-11-24 11:37 UTC · original
kirigayakazima:fix/semantic-optional-spirv-tools→main· +204 −140 · 2 files · 1 commits · merged 2026-11-24 17:10 UTCClaimed in the coordination issue as: TEST-SOPC-UNARY-SPIRV-TOOLS (#14)
What and why
Replaces the SPIRV-Tools half of conflicting draft #136, following @ItsMrDubey's design suggestion in #136 (comment 7121549964) so translation and
spirv_mini_interpcoverage always run everywhere instead of silently returning early or failing on tool-less hosts (e.g., Windowssemantic-testsleg or local dev PCs):tests/semantic/test_sopc_validation.py:_translate_and_validate_csinto_translate_csand_validate_spirvand extract_positive_control_program().test_all_18_ops_and_valid_scalar_operands_interpruns translation +spirv_mini_interpacross all 18 SOPC instructions unconditionally.test_all_18_ops_and_valid_scalar_operands_spirv_valchecksspirv-as/spirv-valonPATH: skips cleanly when absent andLEONIDA_REQUIRE_SPIRV_TOOLS != "1", and fails loudly viaself.fail(...)whenLEONIDA_REQUIRE_SPIRV_TOOLS == "1".tests/semantic/test_unary_f16_validation.py:run_pstranslation/interpreter execution fromvalidate_spirvand factor out shared shader builders (_combo_opsel_shaders,_nontrivial_opsel_shader,_inplace_sdwa_shader,_positive_control_lines).test_sin_cos_opsel_spirv_valandtest_positive_controls_all_12_ops_spirv_valmethods using_require_or_skip_spirv_tools(skip when missing andLEONIDA_REQUIRE_SPIRV_TOOLS != "1", fail loudly whenLEONIDA_REQUIRE_SPIRV_TOOLS == "1").spirv_mini_interpchecks running unconditionally on every host.Note: on unmodified
main(21625bca) without SPIRV-Tools, both files still failed (1/11 intest_sopc_validation.py; 15 subtests intest_unary_f16_validation.py— also hit in #652's Windows run).Tested
On Windows 11 x64 (
Python 3.14.7,spirv-as/spirv-valnot onPATH) atefeb1db11bcd632c01246d783f2987114e6e4811, synthetic fixtures only (no game data):LEONIDA_REQUIRE_SPIRV_TOOLS=0:python -I tests/semantic/test_sopc_validation.py -v— 12 ran, OK (skipped=1) (test_all_18_ops_and_valid_scalar_operands_interppassed)python -I tests/semantic/test_unary_f16_validation.py -v— 7 ran, OK (skipped=2) (all interpreter/negative/positive-translation checks passed)python -I -m unittest discover -s tests/semantic -p ...— both OKLEONIDA_REQUIRE_SPIRV_TOOLS=1(verifies strict CI failure):test_sopc_validation.py— FAILED (1/12,AssertionError: spirv-as and spirv-val must be on PATH)test_unary_f16_validation.py— FAILED (2/7,AssertionError: spirv-as / spirv-val not found on PATH)python -I tests/test_ci_registration.py— 15 ran, OKpython -I tests/test_text_write_line_endings.py— 3 ran, OKpython -I scripts/check_no_game_data.py ...&python -m compileall -q ...— exit 0GPUs tested: n/a
AI-assisted: yes
Checklist
main(21625bca) and merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — semantic tests only)@trigger337 on GitHub · 2026-11-24 11:40 UTC · original
agent: yes
AI-assisted: yes
Tested on Linux (CachyOS x86_64, Python 3.14):
With SPIRV-Tools on
PATH:test_sopc_validation.py: 12/12 ran and passed (both_interpand_spirv_valexecuted).test_unary_f16_validation.py: 7/7 ran and passed (sin_cos_opsel_spirv_valandpositive_controls_all_12_ops_spirv_valvalidated).With SPIRV-Tools absent from
PATH:LEONIDA_REQUIRE_SPIRV_TOOLS=0/ default):test_sopc_validation.pyran 12 tests, 11 passed, 1 skipped cleanly;test_unary_f16_validation.pyskipped 2 tests cleanly. All positive/negative translation andspirv_mini_interpsuites ran unconditionally.LEONIDA_REQUIRE_SPIRV_TOOLS=1): triggeredAssertionError: spirv-as and spirv-val must be on PATHloudly as required for CI.CI Registration & Clean-room Checks:
tests/test_ci_registration.py: 15/15 passed.scripts/check_no_game_data.py: clean.@MoonEyes on GitHub · 2026-11-24 16:02 UTC · original
Three open PRs fix the same red files, so here is a side-by-side measured on Windows 11, Python 3.14, without SPIRV-Tools, with
scripts/run_semantic_tests.py.Main (
a28927849), measured locally: 465 files, 6108 tests, 2 files red with the variable unset (test_sopc_validation,test_unary_f16_validation: "spirv-as / spirv-val not found on PATH"). On CI, the Windowssemantic-testsjob of main run 45369028646 (21625bca8) fails on 4 files: those two plustest_active_cacheandtest_reg_ptr_hoist. Ubuntu passes.Results for the 4 files at stake, by
LEONIDA_REQUIRE_SPIRV_TOOLSvalue:0(what ci.yml:193 sets on non-Linux runners)1(
test_fma_khr*andtest_spirv_tools_requiredalso fail with1and no tools, as intended; I left them out of the table.)What differs:
0case.test_active_cache.py:56andtest_reg_ptr_hoist.py:59test the variable for truthiness, so the'0'that ci.yml sets on Windows counts as "required". That is the Windows CI failure above. Only #136 fixes it, with== "1"astest_fma_khr,test_fma_khr_f64andtest_spirv_tools_requiredalready do.skipTest, so a missing tool shows up as a skip in-voutput and in the counts, while the interpreter checks still run. #940, and the sopc/unary half of #136, return early instead, so the test passes with no trace thatspirv-valdid not run. That matches main's existing convention intest_active_cacheandtest_reg_ptr_hoist, but a skip is at least visible, which is why I would take #676's approach for these two files.CONFLICTING. Itstest_image_atomics_guardhalf is already on main through #20, #394 and #460, and that file is where the conflict is.Suggestion: merge #676, and carry #136's two-line
== "1"change, either on #676 or as a small separate PR. That makes the Windowssemantic-testsjob green. #940 and #136 can then close as superseded. I have not touched any of the three branches.AI-assisted: yes (Claude Code ran the measurements, and a separate agent checked the claims against the code and CI before posting).
@aslan2142 on GitHub · 2026-11-24 17:10 UTC · original
Reviewed and merging. Checked on
main+ this PR, Linux, without game files:spirv-valcalls.mainLEONIDA_REQUIRE_SPIRV_TOOLS=1LEONIDA_REQUIRE_SPIRV_TOOLS=0(Windows CI)stdlib-tests-linuxjob istest_tool_stdout_encodingflaggingtools/exe_sha.pyandtools/pr_conflict_label.pyon themainof 13:48. This PR doesn't touch either, and both are fixed onmainsince.#940, which covered the same two files, was closed as a duplicate of this one.
AI-assisted (Claude Code, Claude Opus 5.5).