Skip to content

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 #31

Done

Description

@Mby159

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 (9ec34cd) - 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.

Activity

  1. superartyom commented on Nov 24, 2026

    @superartyom

    Additional confirmation on an NVIDIA GeForce RTX 5070:

    Tested on Leonida commit ece4ba5 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.

  2. superartyom commented on Nov 24, 2026

    @superartyom

    Correction: I reproduced the 2071 result on an RTX 5070 at commit ece4ba5, 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.

  3. added 2 commits that reference this issue on Nov 24, 2026
  4. 2 remaining items

  5. iiiirokuuug-rgb commented on Nov 24, 2026

    @iiiirokuuug-rgb

    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.

  6. LewisStephens99 commented on Nov 24, 2026

    @LewisStephens99

    Additional independent result on main d0da7da: 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.

  7. added a commit that references this issue on Nov 24, 2026
  8. added a commit that references this issue on Nov 24, 2026
  9. iiiirokuuug-rgb commented on Nov 24, 2026

    @iiiirokuuug-rgb

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions