[PR #1468] OLD-9919: wave64_halves: clear ('vote', 'exec', ...) on EXEC writes and propagate SCC uses taint (SHADER-820) #1498

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1468
Author: @Tortoche
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: old-9919


📝 Commits (2)

  • eb1638a wave64_halves: clear ('vote', 'exec') on SCC-preserving EXEC writes and add ps_w64_c_vote_{rewrite,exec} (OLD-9919, SHADER-820)
  • 284cbfa wave64_halves: clear 3-tuple ('vote', 'exec', ...) tags and propagate SCC uses taint in exec_write (OLD-9919)

📊 Changes

7 files changed (+169 additions, -3 deletions)

View changed files

📝 docs/design.md (+1 -1)
➕ runtime/test/shaders/ps_w64_c_vote_exec.asm (+31 -0)
➕ runtime/test/shaders/ps_w64_c_vote_rewrite.asm (+33 -0)
📝 runtime/test/shaders/w64_graphics.py (+2 -0)
📝 tests/semantic/test_wave64_halves_soundness.py (+85 -0)
📝 tests/test_wave64_halves_fixtures.py (+2 -0)
📝 tools/wave64_halves.py (+15 -2)

📄 Description

Item ID: OLD-9919 (SHADER-820)
Carries forward Draft #187 (old-pr/9919 by Luiz Neves / LouisRiverstone, with original commit authorship preserved at ed9ea453e), rebased onto main (364ab4eab), plus follow-up soundness fix (2ab9758e0) for 3-tuple ("vote", "exec", "empty") clearing and uses SCC taint propagation in exec_write.
Claimed in #14: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147742087

AI-assisted: yes

Summary

  • tools/wave64_halves.py (Analysis.exec_write):
    • Clear both 2-tuple ("vote", "exec") and 3-tuple ("vote", "exec", "empty") tags on st["g"]["scc"] whenever EXEC is rewritten by an SCC-preserving instruction (v_cmpx, s_mov_b64, s_cselect_b64, s_cmov_b64, or any op without scc in defs) or on fallback EXEC writes.
    • Propagate taint and staleness from implicit uses (e.g., scc on s_cselect_b64 exec, ... / s_cmov_b64 exec, ...) into mt on the non-v_cmpx exec_write path.
  • runtime/test/shaders/ps_w64_c_vote_rewrite.asm, runtime/test/shaders/ps_w64_c_vote_exec.asm, runtime/test/shaders/w64_graphics.py, tests/test_wave64_halves_fixtures.py: add and register the two SHADER-820 GPU fixtures (Tier C, tainted-branch).
  • tests/semantic/test_wave64_halves_soundness.py: add VS soundness/divergence tests and pure-Python PS classification tests covering vote-on-EXEC reset, 3-tuple s_cmp_eq_u64 exec, 0 clearing (vs_exec_vote_cmp_eq_mov, vs_exec_vote_cmp_eq_cselect), s_cselect_b64 exec SCC taint/staleness (test_s_cselect_exec_reads_scc_taint), clean scalar-compare s_cselect_b64 exec invariant (vs_clean_cselect_exec), rewritten mask, and v_cmpx.
  • docs/design.md: document the EXEC vote reset rule in the SHADER-10 contract row.

Tests Executed (Linux x86_64 CPU, no GPU/retail corpus run)

  • python3 -I tests/semantic/test_wave64_halves_soundness.py -v: 37/37 passed
  • python3 -I tests/semantic/test_wave64_halves.py: 126/126 passed
  • python3 -I tests/semantic/test_wave64_halves_wqm_uvote.py: 18/18 passed
  • python3 -I tests/semantic/test_wave64_halves_partial_dst.py: 13/13 passed
  • python3 -I tests/semantic/test_wave64_halves_readlane_uniform.py: 2/2 passed
  • python3 -m pytest tests/test_wave64_halves_fixtures.py -v: 9 passed / 1 skipped (test_fixtures_are_classified_as_their_headers_say skipped due to llvm-mc absent on PATH)
  • python3 -I tests/test_design_contract_rows.py: 5/5 passed
  • python3 -I tests/test_docs_links.py: 16/16 passed
  • python3 -I tests/test_text_write_line_endings.py: 3/3 passed
  • python3 -m compileall -q make_game.py tools tests: OK (exit 0)
  • python3 -I scripts/check_no_game_data.py on all 7 modified/added files: OK (exit 0, zero game data)

🔄 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/1468 **Author:** [@Tortoche](https://github.com/Tortoche) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-9919` --- ### 📝 Commits (2) - [`eb1638a`](https://github.com/ubiquitarianism/leonida/commit/eb1638ab1751eb667796a6141b37d57a34a7724b) wave64_halves: clear ('vote', 'exec') on SCC-preserving EXEC writes and add ps_w64_c_vote_{rewrite,exec} (OLD-9919, SHADER-820) - [`284cbfa`](https://github.com/ubiquitarianism/leonida/commit/284cbfacf70e050ac11d71c9dd1a17c77f87d712) wave64_halves: clear 3-tuple ('vote', 'exec', ...) tags and propagate SCC uses taint in exec_write (OLD-9919) ### 📊 Changes **7 files changed** (+169 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) ➕ `runtime/test/shaders/ps_w64_c_vote_exec.asm` (+31 -0) ➕ `runtime/test/shaders/ps_w64_c_vote_rewrite.asm` (+33 -0) 📝 `runtime/test/shaders/w64_graphics.py` (+2 -0) 📝 `tests/semantic/test_wave64_halves_soundness.py` (+85 -0) 📝 `tests/test_wave64_halves_fixtures.py` (+2 -0) 📝 `tools/wave64_halves.py` (+15 -2) </details> ### 📄 Description Item ID: `OLD-9919` (`SHADER-820`) Carries forward Draft `#187` (`old-pr/9919` by `Luiz Neves` / `LouisRiverstone`, with original commit authorship preserved at `ed9ea453e`), rebased onto `main` (`364ab4eab`), plus follow-up soundness fix (`2ab9758e0`) for 3-tuple `("vote", "exec", "empty")` clearing and `uses` SCC taint propagation in `exec_write`. Claimed in `#14`: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147742087 AI-assisted: yes ### Summary - `tools/wave64_halves.py` (`Analysis.exec_write`): - Clear both 2-tuple `("vote", "exec")` and 3-tuple `("vote", "exec", "empty")` tags on `st["g"]["scc"]` whenever `EXEC` is rewritten by an `SCC`-preserving instruction (`v_cmpx`, `s_mov_b64`, `s_cselect_b64`, `s_cmov_b64`, or any op without `scc` in `defs`) or on fallback `EXEC` writes. - Propagate taint and staleness from implicit `uses` (e.g., `scc` on `s_cselect_b64 exec, ...` / `s_cmov_b64 exec, ...`) into `mt` on the non-`v_cmpx` `exec_write` path. - `runtime/test/shaders/ps_w64_c_vote_rewrite.asm`, `runtime/test/shaders/ps_w64_c_vote_exec.asm`, `runtime/test/shaders/w64_graphics.py`, `tests/test_wave64_halves_fixtures.py`: add and register the two `SHADER-820` GPU fixtures (Tier `C`, `tainted-branch`). - `tests/semantic/test_wave64_halves_soundness.py`: add VS soundness/divergence tests and pure-Python PS classification tests covering vote-on-`EXEC` reset, 3-tuple `s_cmp_eq_u64 exec, 0` clearing (`vs_exec_vote_cmp_eq_mov`, `vs_exec_vote_cmp_eq_cselect`), `s_cselect_b64 exec` SCC taint/staleness (`test_s_cselect_exec_reads_scc_taint`), clean scalar-compare `s_cselect_b64 exec` invariant (`vs_clean_cselect_exec`), rewritten mask, and `v_cmpx`. - `docs/design.md`: document the `EXEC` vote reset rule in the `SHADER-10` contract row. ### Tests Executed (Linux x86_64 CPU, no GPU/retail corpus run) - `python3 -I tests/semantic/test_wave64_halves_soundness.py -v`: **37/37 passed** - `python3 -I tests/semantic/test_wave64_halves.py`: **126/126 passed** - `python3 -I tests/semantic/test_wave64_halves_wqm_uvote.py`: **18/18 passed** - `python3 -I tests/semantic/test_wave64_halves_partial_dst.py`: **13/13 passed** - `python3 -I tests/semantic/test_wave64_halves_readlane_uniform.py`: **2/2 passed** - `python3 -m pytest tests/test_wave64_halves_fixtures.py -v`: **9 passed / 1 skipped** (`test_fixtures_are_classified_as_their_headers_say` skipped due to `llvm-mc` absent on `PATH`) - `python3 -I tests/test_design_contract_rows.py`: **5/5 passed** - `python3 -I tests/test_docs_links.py`: **16/16 passed** - `python3 -I tests/test_text_write_line_endings.py`: **3/3 passed** - `python3 -m compileall -q make_game.py tools tests`: **OK** (exit 0) - `python3 -I scripts/check_no_game_data.py` on all 7 modified/added files: **OK** (exit 0, zero game data) --- <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#1498
No description provided.