rdna2spirv: decode scalar, image and buffer tuples that run into vcc from blob (OLD-10062) #744

Closed
github-bot wants to merge 1 commit from gh-pr/744/head into gh-pr/744/base
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:20 UTC · original
abnalstlll-byte:restore/old-10062-vcc-tuples → main · +190 −3 · 3 files · 1 commits · closed without merging

### Summary
Restores and updates work from draft PR #327 (old-pr/10062 / item OLD-10062).
Original commit by @⁠tedin7 (063f14dcd9).

llvm-mc skips the first word of s_buffer_load_dwordx8 into s[100:107], an image resource in s[100:107] or a buffer resource in s[104:107] and leaves the second word as junk, so translate() refused those shaders ("reachable instruction with normalized encoding" or "fall-through into undecodable words") or translated them without the load.

restore_vcc_tuples reads the uncovered words of the code range with rdna2_decode and keeps only instructions whose operands hold a VCCTuple list, the form the translator already takes. Other undecodable words remain unchanged and properly rejected.

Verification

  • python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_vcc_tuple_fallback.py docs/shader_library.md -> Clean (no game data)
  • python -m unittest discover -s tests/semantic -p test_vcc_tuple_fallback.py -> 4/4 PASS in 0.22s
  • Clean rebase onto latest ubi/main (21625bca8).

AI-assisted verification and rebase by Antigravity (Autonomous Direct Mode).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/744) `abnalstlll-byte:restore/old-10062-vcc-tuples` → `main` · +190 −3 · 3 files · 1 commits · closed without merging ### Summary Restores and updates work from draft PR #327 (`old-pr/10062` / item `OLD-10062`). Original commit by @⁠tedin7 (`063f14dcd9`). `llvm-mc` skips the first word of `s_buffer_load_dwordx8` into `s[100:107]`, an image resource in `s[100:107]` or a buffer resource in `s[104:107]` and leaves the second word as junk, so `translate()` refused those shaders ("reachable instruction with normalized encoding" or "fall-through into undecodable words") or translated them without the load. `restore_vcc_tuples` reads the uncovered words of the code range with `rdna2_decode` and keeps only instructions whose operands hold a `VCCTuple` list, the form the translator already takes. Other undecodable words remain unchanged and properly rejected. ### Verification - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_vcc_tuple_fallback.py docs/shader_library.md` -> Clean (no game data) - `python -m unittest discover -s tests/semantic -p test_vcc_tuple_fallback.py` -> 4/4 PASS in 0.22s - Clean rebase onto latest `ubi/main` (`21625bca8`). AI-assisted verification and rebase by Antigravity (Autonomous Direct Mode).
llvm-mc skips the first word of s_buffer_load_dwordx8 into s[100:107], an image resource in s[100:107] or a buffer resource in s[104:107] and leaves the second word as junk, so translate() refused those shaders (reachable instruction with normalized encoding) or translated them without the load. restore_vcc_tuples reads the uncovered words of the code range with rdna2_decode and keeps only instructions whose operands hold a VCCTuple list, the form the translator already takes. Other undecodable words are unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:19:05 +00:00
github-bot closed this pull request 2026-11-26 09:19:05 +00:00
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-24 13:26 UTC · original

Tested a0c9e956d on Apple M5 Pro, macOS 26.7.3 (25G342), Python 3.15.2, against main d42773d07:

  • tests/semantic/test_vcc_tuple_fallback.py: 4 tests OK at this head.
  • The same file against main's translator gives 9 errors, not assertion failures: main raises inside translate (tools/rdna2spirv.py:17262, reachable_code) while translating these listings, so the new fallback is what makes them translatable at all.

No GPU leg: this is a decode-level fallback for tuples llvm-mc truncates; no runtime/test/shaders fixture exercises it, and I did not run the suite on this head. AI-assisted; synthetic fixtures only, no game data.

**@⁠GeorgiyDemo** on GitHub · 2026-11-24 13:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/744#issuecomment-7132831707) Tested `a0c9e956d` on Apple M5 Pro, macOS 26.7.3 (25G342), Python 3.15.2, against `main` `d42773d07`: - `tests/semantic/test_vcc_tuple_fallback.py`: 4 tests OK at this head. - The same file against `main`'s translator gives 9 errors, not assertion failures: `main` raises inside `translate` (`tools/rdna2spirv.py:17262`, `reachable_code`) while translating these listings, so the new fallback is what makes them translatable at all. No GPU leg: this is a decode-level fallback for tuples llvm-mc truncates; no `runtime/test/shaders` fixture exercises it, and I did not run the suite on this head. AI-assisted; synthetic fixtures only, no game data.
Author
Owner

@⁠ubiquitarianism on GitHub · 2026-11-24 16:17 UTC · original

Closing: duplicates #596 (opened earlier) and conflicts with #674.

**@⁠ubiquitarianism** on GitHub · 2026-11-24 16:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/744#issuecomment-7137433958) Closing: duplicates #596 (opened earlier) and conflicts with #674.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.