[PR #20] [MERGED] tests: the image atomics guard accepts the folded %true when no lane can be inactive #74

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

📋 Pull Request Information

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

Base: main ← Head: test-image-atomics-folded-true


📝 Commits (1)

  • c1bcf15 tests: the image atomics guard accepts the folded %true when no lane can be inactive

📊 Changes

1 file changed (+7 additions, -2 deletions)

View changed files

📝 tests/semantic/test_image_atomics_guard.py (+7 -2)

📄 Description

Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. This is the image-atomics half of #15; no open pull request touches tests/semantic/test_image_atomics_guard.py.

Depends on: none.

What and why

tests/semantic/test_image_atomics_guard.py fails 47 of 49 subtests on main@9ec34cdff, one of the two files that keep the semantic-tests job red:

FAIL: test_all_image_atomics_2d_and_3d_guarded_and_valid ... (op='image_atomic_add', dim='dim:SQ_RSRC_IMG_2D', glc=False)
AssertionError: OpImageTexelPointer in unguarded block %t86_do

The test models the translator's guard around OpImageTexelPointer as "a branch on an OpLoad of %active". Since #4473 the translator folds if (%active) to if (%true) when the shader writes no EXEC (no lane can be inactive), so the walker no longer finds its load and calls a guarded access unguarded.

The walker now also accepts the constant %true, and only when the module has no OpStore %active — a shader that can deactivate lanes still has to branch on the real load. Test file only; no translator change.

This patches in the old project's never-merged pr/7292 (be65e0611, same tree) against today's main; authorship is kept (kett1m), and the commit is cherry-picked with -x. Say so here and I will withdraw it in favour of a fresh one from its author.

Tested

main@9ec34cdff, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files:

tree tests/semantic/test_image_atomics_guard.py full tests/semantic
main@9ec34cdff FAILED (failures=47) 2 files failed: this and test_exec_computed
this commit Ran 3 tests ... OK 1 file failed: test_exec_computed (#15)

python -m compileall -q make_game.py tools tests clean, python -I scripts/check_no_game_data.py tests/semantic/test_image_atomics_guard.py clean. Not run: Windows, any GPU test.

AI-assisted: yes (the patch is kett1m's; carried over and re-verified here).

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. (Not applicable: test-only.)

🔄 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/20 **Author:** [@wavehs](https://github.com/wavehs) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `test-image-atomics-folded-true` --- ### 📝 Commits (1) - [`c1bcf15`](https://github.com/ubiquitarianism/leonida/commit/c1bcf15f8fe94ce5e6997d0eb844dbd51a84f6a5) tests: the image atomics guard accepts the folded %true when no lane can be inactive ### 📊 Changes **1 file changed** (+7 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_image_atomics_guard.py` (+7 -2) </details> ### 📄 Description Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. This is the image-atomics half of #15; no open pull request touches `tests/semantic/test_image_atomics_guard.py`. Depends on: none. ### What and why `tests/semantic/test_image_atomics_guard.py` fails 47 of 49 subtests on `main@9ec34cdff`, one of the two files that keep the `semantic-tests` job red: ``` FAIL: test_all_image_atomics_2d_and_3d_guarded_and_valid ... (op='image_atomic_add', dim='dim:SQ_RSRC_IMG_2D', glc=False) AssertionError: OpImageTexelPointer in unguarded block %t86_do ``` The test models the translator's guard around `OpImageTexelPointer` as "a branch on an `OpLoad` of `%active`". Since #4473 the translator folds `if (%active)` to `if (%true)` when the shader writes no EXEC (no lane can be inactive), so the walker no longer finds its load and calls a guarded access unguarded. The walker now also accepts the constant `%true`, and only when the module has no `OpStore %active` — a shader that can deactivate lanes still has to branch on the real load. Test file only; no translator change. This patches in the old project's never-merged `pr/7292` (`be65e0611`, same tree) against today's `main`; authorship is kept (kett1m), and the commit is cherry-picked with `-x`. Say so here and I will withdraw it in favour of a fresh one from its author. ### Tested `main@9ec34cdff`, macOS 15 arm64 (Apple M3 Pro), CPython 3.15.2, CPU only, no game files: | tree | `tests/semantic/test_image_atomics_guard.py` | full `tests/semantic` | |---|---|---| | `main@9ec34cdff` | `FAILED (failures=47)` | 2 files failed: this and `test_exec_computed` | | this commit | `Ran 3 tests ... OK` | 1 file failed: `test_exec_computed` (#15) | `python -m compileall -q make_game.py tools tests` clean, `python -I scripts/check_no_game_data.py tests/semantic/test_image_atomics_guard.py` clean. Not run: Windows, any GPU test. AI-assisted: yes (the patch is kett1m's; carried over and re-verified here). ### Checklist - [x] 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. (Not applicable: test-only.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:16:42 +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#74
No description provided.