[GH-ISSUE #31] AMD Radeon 780M (RDNA3 iGPU, driver 26.10.2): cs_imgload_tfe and cs_imgload_d16_tfe fail on main - the tfe fetch status VGPR is read but never written #5

Closed
opened 2026-11-26 20:13:57 +01:00 by 4ld0 · 5 comments
Owner

Originally created by @Mby159 on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/31

AMD Radeon 780M (RDNA3 iGPU, gfx1103), AMD proprietary driver 26.10.2 (LLPC), Vulkan 1.4.359, Windows 11: cs_imgload_tfe and cs_imgload_d16_tfe fail on main (9ec34cdff) - the tfe fetch status VGPR is read but never written.

What happens

Both fixtures load an image with the tfe modifier and add the fetch status VGPR into the result, so a stale status moves every texel. On this GPU every texel of the r32 sint view moves by exactly 2000:

$ vk_store_test cs_imgload_tfe.spv load
device: AMD Radeon 780M Graphics
rgba8 unorm (float view): 0 bad, texel(5,3) = 182 109 128 255
r32 uint (uint view): 0 bad, texel(5,3) = 129
r32 sint (sint view): 64 bad, texel(5,3) = 2071

The expected value is 100 - (8y + x) = 71 at texel(5,3), so 2071 is 71 + 2000. The fixture seeds the status VGPR with 2000 before the load, so the shader reads back the seed: the status VGPR is never written.

The two other views are exact, because they do not add the status into the result.

cs_imgload_d16_tfe fails the same way (64 bad, texel(5,3) = 2071).

Where to look

tools/rdna2spirv.py allocates the extra destination VGPR for tfe when it counts the instruction's destinations:

for r in vgpr_dest_registers(ins, extra=int("tfe" in ins["mods"])):

but the typed image load emits a plain OpImageFetch (image_load_typed -> image_read_typed), and nothing writes that extra VGPR. On hardware, an MIMG read with TFE returns the fetch status in the dword after the data; in SPIR-V there is no such status, so the translator has to write it itself (0 for a resident texel, which is what the fixture expects).

Notes

  • No game files; the fixture is hand-written in runtime/test/shaders/ and the test is the project's own.
  • AI-assisted (MiniMax Code).
  • The fixture comment says the companion was run on gfx1036 and an RTX 5090 in #8968; this report is from gfx1103.
Originally created by @Mby159 on GitHub (Nov 24, 2026). Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/31 **AMD Radeon 780M (RDNA3 iGPU, gfx1103), AMD proprietary driver 26.10.2 (LLPC), Vulkan 1.4.359, Windows 11:** `cs_imgload_tfe` and `cs_imgload_d16_tfe` fail on `main` (9ec34cdff) - the tfe fetch status VGPR is read but never written. ## What happens Both fixtures load an image with the `tfe` modifier and add the fetch status VGPR into the result, so a stale status moves every texel. On this GPU every texel of the r32 sint view moves by exactly 2000: ``` $ vk_store_test cs_imgload_tfe.spv load device: AMD Radeon 780M Graphics rgba8 unorm (float view): 0 bad, texel(5,3) = 182 109 128 255 r32 uint (uint view): 0 bad, texel(5,3) = 129 r32 sint (sint view): 64 bad, texel(5,3) = 2071 ``` The expected value is `100 - (8y + x)` = 71 at texel(5,3), so 2071 is 71 + 2000. The fixture seeds the status VGPR with 2000 before the load, so the shader reads back the seed: the status VGPR is never written. The two other views are exact, because they do not add the status into the result. `cs_imgload_d16_tfe` fails the same way (64 bad, texel(5,3) = 2071). ## Where to look `tools/rdna2spirv.py` allocates the extra destination VGPR for `tfe` when it counts the instruction's destinations: ``` for r in vgpr_dest_registers(ins, extra=int("tfe" in ins["mods"])): ``` but the typed image load emits a plain `OpImageFetch` (`image_load_typed` -> `image_read_typed`), and nothing writes that extra VGPR. On hardware, an MIMG read with TFE returns the fetch status in the dword after the data; in SPIR-V there is no such status, so the translator has to write it itself (0 for a resident texel, which is what the fixture expects). ## Notes - No game files; the fixture is hand-written in `runtime/test/shaders/` and the test is the project's own. - AI-assisted (MiniMax Code). - The fixture comment says the companion was run on gfx1036 and an RTX 5090 in #8968; this report is from gfx1103.
4ld0 closed this issue 2026-11-26 20:13:57 +01:00
Author
Owner

@superartyom commented on GitHub (Nov 24, 2026):

Additional confirmation on an NVIDIA GeForce RTX 5070:

Tested on Leonida commit ece4ba5b3 on Windows. Both cs_imgload_tfe and cs_imgload_d16_tfe translate successfully and pass spirv-val, but fail when run on the GPU.

For both tests:

  • rgba8 unorm: 0 bad texels
  • r32 uint: 0 bad texels
  • r32 sint: 64 bad texels
  • At texel (5,3), actual value is 2071; expected value is 71.

Direct commands:
vk_store_test cs_imgload_tfe.spv load
vk_store_test cs_imgload_d16_tfe.spv load-d16

The full GPU test run reported 197 passed, 49 skipped, and these 2 failures. This reproduces the TFE status VGPR issue on an RTX 5070 as well.

<!-- gh-comment-id:7122526615 --> @superartyom commented on GitHub (Nov 24, 2026): Additional confirmation on an NVIDIA GeForce RTX 5070: Tested on Leonida commit ece4ba5b3 on Windows. Both cs_imgload_tfe and cs_imgload_d16_tfe translate successfully and pass spirv-val, but fail when run on the GPU. For both tests: - rgba8 unorm: 0 bad texels - r32 uint: 0 bad texels - r32 sint: 64 bad texels - At texel (5,3), actual value is 2071; expected value is 71. Direct commands: vk_store_test cs_imgload_tfe.spv load vk_store_test cs_imgload_d16_tfe.spv load-d16 The full GPU test run reported 197 passed, 49 skipped, and these 2 failures. This reproduces the TFE status VGPR issue on an RTX 5070 as well.
Author
Owner

@superartyom commented on GitHub (Nov 24, 2026):

Correction: I reproduced the 2071 result on an RTX 5070 at commit ece4ba5b3, but I initially described it as proof of a translator bug. After seeing the discussion around closed PR #98, I understand the fixtures’ expected value may be incorrect. My run confirms the output on this GPU; it does not establish that the translator is wrong.

<!-- gh-comment-id:7122610957 --> @superartyom commented on GitHub (Nov 24, 2026): Correction: I reproduced the 2071 result on an RTX 5070 at commit ece4ba5b3, but I initially described it as proof of a translator bug. After seeing the discussion around closed PR #98, I understand the fixtures’ expected value may be incorrect. My run confirms the output on this GPU; it does not establish that the translator is wrong.
Author
Owner

@iiiirokuuug-rgb commented on GitHub (Nov 24, 2026):

Same two failures on an Intel Arc A770 (Alchemist, 16 GB; Intel Windows driver 32.0.101.9033, Vulkan 1.4.356; Windows 11 26200) on 21625bc, so this is not RADV-specific and not RDNA3-specific — it reproduces across vendors:

FAIL  cs_imgload_d16_tfe    exit 1: r32 sint (sint view): 64 bad, texel(5,3) = 2071
FAIL  cs_imgload_tfe        exit 1: r32 sint (sint view): 64 bad, texel(5,3) = 2071

180/248 passed, 66 skipped on this GPU, and these are the only two failures.

That is consistent with the cause you name — the fetch status VGPR is read but never written — rather than with anything the driver does: the same 64 words and the same texel(5,3) = 2071 on a different vendor point at the translated program, not at the driver's readback.

<!-- gh-comment-id:7132170340 --> @iiiirokuuug-rgb commented on GitHub (Nov 24, 2026): Same two failures on an **Intel Arc A770** (Alchemist, 16 GB; Intel Windows driver 32.0.101.9033, Vulkan 1.4.356; Windows 11 26200) on `21625bc`, so this is not RADV-specific and not RDNA3-specific — it reproduces across vendors: ``` FAIL cs_imgload_d16_tfe exit 1: r32 sint (sint view): 64 bad, texel(5,3) = 2071 FAIL cs_imgload_tfe exit 1: r32 sint (sint view): 64 bad, texel(5,3) = 2071 ``` `180/248 passed, 66 skipped` on this GPU, and these are the only two failures. That is consistent with the cause you name — the fetch status VGPR is read but never written — rather than with anything the driver does: the same 64 words and the same `texel(5,3) = 2071` on a different vendor point at the translated program, not at the driver's readback.
Author
Owner

@LewisStephens99 commented on GitHub (Nov 24, 2026):

Additional independent result on main d0da7dade: NVIDIA RTX A2000 12GB, Windows 11, NVIDIA 32.0.16.2114, Vulkan 1.4.363, LLVM-MC 21.1.8.nnFull synthetic suite: 258 shaders translated, 258 pass spirv-val; 198/249 runnable cases passed, 49 skipped. The only two failures were cs_imgload_tfe and cs_imgload_d16_tfe, both at 64 bad r32 sint texels and texel(5,3) = 2071 instead of 71.nnAll 4 imgload fixtures pass with PR #291 applied. 3 TFE semantic tests and 23 typed-image tests pass on the branch. Synthetic inputs only; no game files or retail assets used. AI-assisted.

<!-- gh-comment-id:7134396144 --> @LewisStephens99 commented on GitHub (Nov 24, 2026): Additional independent result on `main` d0da7dade: NVIDIA RTX A2000 12GB, Windows 11, NVIDIA 32.0.16.2114, Vulkan 1.4.363, LLVM-MC 21.1.8.`n`nFull synthetic suite: 258 shaders translated, 258 pass spirv-val; 198/249 runnable cases passed, 49 skipped. The only two failures were `cs_imgload_tfe` and `cs_imgload_d16_tfe`, both at 64 bad r32 sint texels and texel(5,3) = 2071 instead of 71.`n`nAll 4 `imgload` fixtures pass with PR #291 applied. 3 TFE semantic tests and 23 typed-image tests pass on the branch. Synthetic inputs only; no game files or retail assets used. AI-assisted.
Author
Owner

@iiiirokuuug-rgb commented on GitHub (Nov 24, 2026):

Confirmed fixed on the Intel Arc A770 from my earlier comment. 3295055 (which merges #892), same machine, same driver 32.0.101.9033:

PASS  cs_imgload_d16_tfe    r32 sint (sint view): 0 bad, texel(5,3) = 71
PASS  cs_imgload_tfe        r32 sint (sint view): 0 bad, texel(5,3) = 71
2/2 passed

Before the merge the same two printed 64 bad, texel(5,3) = 2071 here. So it was the fixtures' expectations and not the Intel driver, which the identical failure on both vendors already pointed at. The GPU suite on this device should now be 182 passed / 66 skipped / 0 failed, and the only remaining suspects on Arc are the two tests #725 lists.

<!-- gh-comment-id:7139339249 --> @iiiirokuuug-rgb commented on GitHub (Nov 24, 2026): Confirmed fixed on the Intel Arc A770 from my earlier comment. `3295055` (which merges #892), same machine, same driver 32.0.101.9033: ``` PASS cs_imgload_d16_tfe r32 sint (sint view): 0 bad, texel(5,3) = 71 PASS cs_imgload_tfe r32 sint (sint view): 0 bad, texel(5,3) = 71 2/2 passed ``` Before the merge the same two printed `64 bad, texel(5,3) = 2071` here. So it was the fixtures' expectations and not the Intel driver, which the identical failure on both vendors already pointed at. The GPU suite on this device should now be 182 passed / 66 skipped / 0 failed, and the only remaining suspects on Arc are the two tests #725 lists.
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#5
No description provided.