docs/design: contract row for the image fetch status VGPR (tfe/lwe), a resident read leaves it unchanged (SHADER-1266-DESIGN-ROW) #1067

Open
github-bot wants to merge 1 commit from github-bot/gh-1067 into main AGit
Owner

@⁠syntaxixr on GitHub · 2026-11-24 17:40 UTC · original
syntaxixr:docs/design-tfe-status → main · +1 −0 · 1 files · 1 commits · open

Claimed in the coordination issue as: SHADER-1266-DESIGN-ROW (#14).

This is the follow-up @⁠aslan2142 named when merging #892: a docs/design.md contract row saying that a resident image_load with tfe leaves the status VGPR unchanged, so the zeroing change does not come back.

The new row, Image fetch status (tfe, lwe) (SHADER-1266), comes right after "Typed image loads" and records:

  • where the status VGPR is (vdata[n], with n the data VGPR count, packed two per VGPR under d16), that the translator writes nothing there, and that read_before_write_vgprs still counts it as a destination;
  • not to write 0 there (#98, draft #291), and that with #291 both fixtures fail again (2111);
  • the native evidence (gfx1036 raw dispatch: 48 kernels, 192 lanes, three seeds) and the LLVM SIISelLowering reasoning, from #98 and #892;
  • the GPU fixtures and how they catch any write ((v8 ^ 0x3e8) | (v12 ^ 0x7d0)), and the GPUs and drivers they pass on in #892;
  • the forms that raise Unsupported with tfe/lwe, read from tools/rdna2spirv.py: image_store, a16 gather/sample with offsets, a16 image_get_lod, 3D image_sample_d/_cl, and the d16 3D image_load_mip.

Tested: every tests/test_docs_*.py and tests/test_i18n_index.py passes (the docs-only CI set), and scripts/check_no_game_data.py docs/design.md is clean. Docs only, no game files. AI-assisted.

**@⁠syntaxixr** on GitHub · 2026-11-24 17:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1067) `syntaxixr:docs/design-tfe-status` → `main` · +1 −0 · 1 files · 1 commits · open Claimed in the coordination issue as: SHADER-1266-DESIGN-ROW (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14). This is the follow-up @⁠aslan2142 named when merging #892: a `docs/design.md` contract row saying that a resident `image_load` with `tfe` leaves the status VGPR unchanged, so the zeroing change does not come back. The new row, **Image fetch status (`tfe`, `lwe`) (SHADER-1266)**, comes right after "Typed image loads" and records: - where the status VGPR is (`vdata[n]`, with n the data VGPR count, packed two per VGPR under `d16`), that the translator writes nothing there, and that `read_before_write_vgprs` still counts it as a destination; - not to write 0 there (#98, draft #291), and that with #291 both fixtures fail again (2111); - the native evidence (gfx1036 raw dispatch: 48 kernels, 192 lanes, three seeds) and the LLVM `SIISelLowering` reasoning, from #98 and #892; - the GPU fixtures and how they catch any write (`(v8 ^ 0x3e8) | (v12 ^ 0x7d0)`), and the GPUs and drivers they pass on in #892; - the forms that raise `Unsupported` with `tfe`/`lwe`, read from `tools/rdna2spirv.py`: `image_store`, `a16` gather/sample with offsets, `a16` `image_get_lod`, 3D `image_sample_d`/`_cl`, and the d16 3D `image_load_mip`. Tested: every `tests/test_docs_*.py` and `tests/test_i18n_index.py` passes (the docs-only CI set), and `scripts/check_no_game_data.py docs/design.md` is clean. Docs only, no game files. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:36:26 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 07:05 UTC · original

Reviewed 2981ead: ran python3 -I tests/test_image_load_typed.py in the sandbox on both trees (PR 23 OK, main 28 OK, 2 skipped each; PR adds no tests) and a translator probe on both trees. Confirmed that image_load/image_load_mip with tfe/lwe (d32/d16, plus main's coherent glc dlc and 1D_ARRAY paths) leave the status VGPR unwritten. A few items in the new row need fixing before merging: (1) read_before_write_vgprs does not call vgpr_dest_registers(ins, extra=int("tfe" in ins["mods"])) — that call is in interp_copy_sources (tools/rdna2spirv.py:18141, main :18614), where extra=1 counts one VGPR past status ([7, 8, 9] on image_load v[7:8] ... tfe because _mimg_data_count already returns n + 1), while read_before_write_vgprs calls plain vgpr_dest_registers(ins) and does not count the status VGPR for the decoder's lwe form (image_load v7 ... lwe, so a later v8 read is read-before-write); scope that sentence to tfe and fix the function/expression. (2) Under refused forms, a16 image_sample*_o with tfe/lwe translates rather than raising Unsupported (only a16 image_gather4_*_o is refused; a16 2D image_load_mip and image_sample_c_l also refuse tfe/lwe), and cs_imgload_d16_tfe.asm is run via vk_store_test load-d16, not load. (3) docs/design.md conflicts with origin/main, which already has a Resident image_load tfe row (line 446) at the same spot — please rebase and fold this SHADER-1266 detail into that row instead of adding a duplicate. GPU/native checks were not run here (no GPU in sandbox). AI-assisted review.
Recommendation: Fix first

**@⁠PierreEbele** on GitHub · 2026-11-25 07:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1067#issuecomment-7155485303) Reviewed 2981ead: ran `python3 -I tests/test_image_load_typed.py` in the sandbox on both trees (PR 23 OK, main 28 OK, 2 skipped each; PR adds no tests) and a translator probe on both trees. Confirmed that `image_load`/`image_load_mip` with `tfe`/`lwe` (d32/d16, plus main's coherent `glc dlc` and `1D_ARRAY` paths) leave the status VGPR unwritten. A few items in the new row need fixing before merging: (1) `read_before_write_vgprs` does not call `vgpr_dest_registers(ins, extra=int("tfe" in ins["mods"]))` — that call is in `interp_copy_sources` (`tools/rdna2spirv.py:18141`, main `:18614`), where `extra=1` counts one VGPR past status (`[7, 8, 9]` on `image_load v[7:8] ... tfe` because `_mimg_data_count` already returns `n + 1`), while `read_before_write_vgprs` calls plain `vgpr_dest_registers(ins)` and does not count the status VGPR for the decoder's `lwe` form (`image_load v7 ... lwe`, so a later `v8` read is read-before-write); scope that sentence to `tfe` and fix the function/expression. (2) Under refused forms, `a16` `image_sample*_o` with `tfe`/`lwe` translates rather than raising `Unsupported` (only `a16` `image_gather4_*_o` is refused; `a16` 2D `image_load_mip` and `image_sample_c_l` also refuse `tfe`/`lwe`), and `cs_imgload_d16_tfe.asm` is run via `vk_store_test load-d16`, not `load`. (3) `docs/design.md` conflicts with `origin/main`, which already has a `Resident image_load tfe` row (line 446) at the same spot — please rebase and fold this SHADER-1266 detail into that row instead of adding a duplicate. GPU/native checks were not run here (no GPU in sandbox). AI-assisted review. **Recommendation:** Fix first
This pull request has changes conflicting with the target branch.
  • docs/design.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1067/head:github-bot/gh-1067'
git switch 'github-bot/gh-1067'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1067'
git switch 'github-bot/gh-1067'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1067'
git switch 'github-bot/gh-1067'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1067'
git switch 'main'
git merge --squash 'github-bot/gh-1067'
git switch 'main'
git merge --ff-only 'github-bot/gh-1067'
git switch 'main'
git merge 'github-bot/gh-1067'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.