mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #2164] rdna2spirv: tfe on buffer_load* / tbuffer_load* (SHADER-BUFFER-TFE) #2168
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2168
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2164
Author: @vinceychu
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:shader-buffer-tfe📝 Commits (1)
4191a1drdna2spirv: tfe on buffer_load* / tbuffer_load* (SHADER-BUFFER-TFE)📊 Changes
8 files changed (+213 additions, -17 deletions)
View changed files
📝
docs/design.md(+1 -0)📝
runtime/test/shaders/check.py(+3 -1)➕
runtime/test/shaders/cs_buf_tfe.asm(+36 -0)📝
scripts/run_gpu_tests.py(+5 -1)📝
tests/semantic/test_buffer_load_sub.py(+0 -1)➕
tests/semantic/test_buffer_load_tfe.py(+146 -0)📝
tests/semantic/test_vector_mem_mubuf.py(+1 -1)📝
tools/rdna2spirv.py(+21 -13)📄 Description
Claimed in the coordination issue as: SHADER-BUFFER-TFE (#1608)
What and why
The translator refused
tfeon every buffer load (raise Unsupported(op + " form")). Image loads already taketfe(design.md, "Residentimage_load tfe", GPU-checked bycs_imgload_tfe); buffer loads now do the same.tfethe VDATA range holds one status dword after the data VGPRs (buffer_load_dword v[4:5],buffer_load_dwordx2 v[6:8], ...; the status register isvdst[data_count]).Vulkan buffer cannot NACK, so the status VGPR keeps its prior value: the resident case, the same as the measured
image one. The translator emits no write for it and checks that the operand range includes it.
buffer_load_dword[xN], the sub-dword loads,_d16,buffer_load_format_*andtbuffer_load_format_*.tfeon stores and atomics stays refused: the ISA defines no status dword for them (llvm-mc rejects it too).tbuffer_load_format_* tfe: llvm-mc gfx1013 cannot assemble it, but the ISA's MTBUF encoding has the TFE bit, soit is accepted and checked by the semantic test only (noted in the design.md row).
Tested
runtime/test/shaders/cs_buf_tfe.asm(registered incheck.pyandrun_gpu_tests.py): seedsthree status VGPRs, loads with
tfe(dword, dwordx2, ushort) and checks the data plus the untouched statuses.run_gpu_tests.py --filter cs_buf_tfe: PASS on an RTX 5090 (NVIDIA 595.99.02, Ubuntu 26.04) and on theRyzen 9 9950X's Radeon iGPU (RADV, Mesa 26.0.8), all 7 words as expected.
tests/semantic/test_buffer_load_tfe.py(6 tests, including the MTBUF form and the refused store/atomic).python -I scripts/run_semantic_tests.py tests/semantic: 496 files, 6,339 tests, 0 failed.pytest tests/test_translate.py: 714 passed; the 2 failures arecs_dpp_cmp.asmwith LLVM 21, failing on main too(#1375).
python -m compileall,tests/test_ci_registration.py: clean.GPUs tested: NVIDIA GeForce RTX 5090 (595.99.02, Ubuntu 26.04.1); AMD Radeon iGPU of the Ryzen 9 9950X (RADV, Mesa 26.0.8)
AI-assisted: yes (Claude Code, with a Devin draft reviewed, rebased and GPU-tested)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
https://claude.ai/code/session_01RAL8MMXUuNpQAVa1iiyAMP
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.