[PR #136] tests/semantic: green without the game or SPIRV-Tools (image atomics guard after #4473, optional spirv-val) #188

Open
opened 2026-11-26 20:17:04 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/136
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9866


📝 Commits (1)

  • abd6173 tests/semantic: green without the game or SPIRV-Tools

📊 Changes

5 files changed (+39 additions, -9 deletions)

View changed files

📝 tests/semantic/test_active_cache.py (+1 -1)
📝 tests/semantic/test_image_atomics_guard.py (+31 -5)
📝 tests/semantic/test_reg_ptr_hoist.py (+1 -1)
📝 tests/semantic/test_sopc_validation.py (+3 -1)
📝 tests/semantic/test_unary_f16_validation.py (+3 -1)

📄 Description

Carried over from old PR 9866 by QuentinDanblon in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9866, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
QuentinDanblon: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116564579 (new item: semantic suite red on main without the game).

On main@2d53a805, python -I scripts/run_semantic_tests.py tests/semantic fails 4 of 459 files on a machine without llvm-mc or SPIRV-Tools. This PR fixes three of them. All three are test-side problems; no translator change.

The fourth, test_exec_computed (SHADER-1264), is a missing import: #8995's fixtures are in main (717f011a), but neither fix is. #8424 and #8353 were both closed unmerged. Either one, applied on main, makes that file pass. Not touched here; the finding is in the claim comment.

test_image_atomics_guard: red since #3559 landed

  • The file passes on #3559's own head (f02a7ea9) and fails in main from its squash (f469596f) on, with 47 failing subtests.
  • git bisect (with #3559's diff applied at each step) names #4473 (92417d59). For a program that never writes EXEC, #4473 sets exec_static_true, and Gen.active_b() returns the constant %true, so the guard is OpBranchConditional %true ....
  • That output is correct: with no EXEC write every lane is active. But find_guarded_texel_block only accepted a condition that is an OpLoad %bool %active.
  • The fixtures now start with s_mov_b32 exec_lo, 0x55555555, so the guard reads the real %active again, which is what the tests mean to check.
  • A new test, test_no_exec_write_guards_with_static_true, covers #4473's constant form on its own. Without an EXEC write, %active is never loaded, and the atomic sits in a block guarded by %true.
  • Mutation: replacing the atomic guard's self.active_b() with "%true" in tools/rdna2spirv.py (the if (active) block around OpImageTexelPointer) makes 37 subtests fail. With the source restored, all pass.

Tests that need SPIRV-Tools when it is optional

  • test_sopc_validation and test_unary_f16_validation failed when spirv-as / spirv-val are not on PATH. AGENTS.md says the suite needs none.
  • They now skip only the spirv-val step, as test_active_cache and test_reg_ptr_hoist do. The translation and interpreter checks still run.
  • With LEONIDA_REQUIRE_SPIRV_TOOLS=1 they still fail without the tools (checked).
  • test_active_cache and test_reg_ptr_hoist read the variable for truthiness. The "Translator semantic tests" step in ci.yml sets it to 0 on its non-Linux runners, which counted as "required". They now compare with "1", as test_fma_khr, test_fma_khr_f64 and test_spirv_tools_required already do.

Tested

  • Windows 11 Pro (26300), Python 3.13, no llvm-mc, no SPIRV-Tools, no GPU involved (these are CPU tests).
  • python -I scripts/run_semantic_tests.py tests/semantic: 459 files, 6,047 tests, 1 file failed: test_exec_computed only (the missing SHADER-1264 import above). Before this PR, 4 files failed.
  • python -m compileall -q make_game.py tools tests: clean.
  • The spirv-val step of the touched tests was not run here (no SPIRV-Tools); CI's Linux leg runs it with LEONIDA_REQUIRE_SPIRV_TOOLS=1.

No game data, nothing from the executable or the package. AI-assisted (Claude Code).

🤖 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/136 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9866` --- ### 📝 Commits (1) - [`abd6173`](https://github.com/ubiquitarianism/leonida/commit/abd6173fb988ce85c4b615d54f697b7c5fce0f2d) tests/semantic: green without the game or SPIRV-Tools ### 📊 Changes **5 files changed** (+39 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_active_cache.py` (+1 -1) 📝 `tests/semantic/test_image_atomics_guard.py` (+31 -5) 📝 `tests/semantic/test_reg_ptr_hoist.py` (+1 -1) 📝 `tests/semantic/test_sopc_validation.py` (+3 -1) 📝 `tests/semantic/test_unary_f16_validation.py` (+3 -1) </details> ### 📄 Description > Carried over from **old PR 9866** by `QuentinDanblon` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9866`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `QuentinDanblon`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116564579 (new item: semantic suite red on `main` without the game). On `main@2d53a805`, `python -I scripts/run_semantic_tests.py tests/semantic` fails 4 of 459 files on a machine without llvm-mc or SPIRV-Tools. This PR fixes three of them. All three are test-side problems; no translator change. The fourth, `test_exec_computed` (SHADER-1264), is a missing import: `#8995`'s fixtures are in `main` (`717f011a`), but neither fix is. `#8424` and `#8353` were both closed unmerged. Either one, applied on `main`, makes that file pass. Not touched here; the finding is in the claim comment. ### `test_image_atomics_guard`: red since `#3559` landed - The file passes on `#3559`'s own head (`f02a7ea9`) and fails in `main` from its squash (`f469596f`) on, with 47 failing subtests. - `git bisect` (with `#3559`'s diff applied at each step) names `#4473` (`92417d59`). For a program that never writes EXEC, `#4473` sets `exec_static_true`, and `Gen.active_b()` returns the constant `%true`, so the guard is `OpBranchConditional %true ...`. - That output is correct: with no EXEC write every lane is active. But `find_guarded_texel_block` only accepted a condition that is an `OpLoad %bool %active`. - The fixtures now start with `s_mov_b32 exec_lo, 0x55555555`, so the guard reads the real `%active` again, which is what the tests mean to check. - A new test, `test_no_exec_write_guards_with_static_true`, covers `#4473`'s constant form on its own. Without an EXEC write, `%active` is never loaded, and the atomic sits in a block guarded by `%true`. - Mutation: replacing the atomic guard's `self.active_b()` with `"%true"` in `tools/rdna2spirv.py` (the `if (active)` block around `OpImageTexelPointer`) makes 37 subtests fail. With the source restored, all pass. ### Tests that need SPIRV-Tools when it is optional - `test_sopc_validation` and `test_unary_f16_validation` failed when `spirv-as` / `spirv-val` are not on PATH. AGENTS.md says the suite needs none. - They now skip only the `spirv-val` step, as `test_active_cache` and `test_reg_ptr_hoist` do. The translation and interpreter checks still run. - With `LEONIDA_REQUIRE_SPIRV_TOOLS=1` they still fail without the tools (checked). - `test_active_cache` and `test_reg_ptr_hoist` read the variable for truthiness. The "Translator semantic tests" step in `ci.yml` sets it to `0` on its non-Linux runners, which counted as "required". They now compare with `"1"`, as `test_fma_khr`, `test_fma_khr_f64` and `test_spirv_tools_required` already do. ### Tested - Windows 11 Pro (26300), Python 3.13, no llvm-mc, no SPIRV-Tools, no GPU involved (these are CPU tests). - `python -I scripts/run_semantic_tests.py tests/semantic`: 459 files, 6,047 tests, 1 file failed: `test_exec_computed` only (the missing SHADER-1264 import above). Before this PR, 4 files failed. - `python -m compileall -q make_game.py tools tests`: clean. - The `spirv-val` step of the touched tests was not run here (no SPIRV-Tools); CI's Linux leg runs it with `LEONIDA_REQUIRE_SPIRV_TOOLS=1`. No game data, nothing from the executable or the package. AI-assisted (Claude Code). 🤖 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#188
No description provided.