mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #850] rdna2spirv: 64-bit buffer addresses without Int64, so shaders run without shaderInt64 (SHADER-423) #888
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#888
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/850
Author: @c4k3ss
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:shader/addr-no-int64📝 Commits (6)
4f2628frdna2spirv: 64-bit buffer addresses without Int64 (SHADER-423)6112644Merge remote-tracking branch 'lc/main' into lc/addr-no-int64da9e749rdna2spirv: lower_addr64 takes the 48-bit sign extension's shifts by 163677e32Merge remote-tracking branch 'lc/main' into lc/addr-no-int64c621105rdna2spirv: lower_addr64 takes the swizzled offset's 64-bit multiply and variable left shift3f78e6dMerge remote-tracking branch 'lc/main' into lc/addr-no-int64📊 Changes
11 files changed (+489 additions, -13 deletions)
View changed files
📝
docs/design.md(+1 -0)📝
tests/semantic/spirv_mini_interp.py(+14 -0)📝
tests/semantic/spirv_wave_interp.py(+9 -0)➕
tests/semantic/test_addr64_lowering.py(+190 -0)📝
tests/semantic/test_buffer_atomic_fminmax_and_align.py(+3 -1)📝
tests/semantic/test_buffer_store_format.py(+3 -1)📝
tests/semantic/test_loop_ballot_barrier.py(+8 -1)📝
tests/semantic/test_wave64_emulate_opt.py(+13 -2)📝
tests/test_rdna2spirv_xdxr_rules.py(+3 -3)📝
tests/test_translate.py(+3 -1)📝
tools/rdna2spirv.py(+242 -4)📄 Description
Claimed in the coordination issue as: SHADER-423 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7134292009), carried over from the upstream repository, where it was open with ten independent GPU test reports when the repository went private.
What and why
Translated shaders declared
OpCapability Int64only because of buffer addresses: the translator builds each PhysicalStorageBuffer address as a 64-bit integer (zero-extend, shift by 32, OR, add an offset, convert to pointer). A device withoutshaderInt64(Intel) refuses every such module, although the shader's own arithmetic is 32-bit.lower_addr64(tools/rdna2spirv.py, run inassemble()on the finished module text) rewrites that address arithmetic into pairs of 32-bit words: adds and subtracts throughOpIAddCarry/OpISubBorrow, the shift-by-32 / OR / AND / narrowing / sign-extension / 64-bit bitcast forms the address idiom uses, pair compares, andOpConvertUToPtrof a 64-bit value asOpBitcastof a two-componentuintvector to the pointer. A value is either lowered completely or left alone; when nothing 64-bit remains, theInt64capability is dropped. Shaders that use 64-bit integers as data keep it.--int64-addresseskeeps the previous form.Also in this PR:
tests/semantic/test_addr64_lowering.py(7 tests, including negative offsets throughglobal_load), the two test interpreters learn the pair pointer form, six existing tests accept either address form, and thedocs/design.mdcontract row "64-bit addresses withoutInt64".Tested
On
maind0da7dade, Windows 11 26200, llvm-mc 23.1.6, Vulkan SDK 1.4.363, MSVC 14.44:test_addr64_lowering7,test_buffer_atomic_fminmax_and_align10,test_buffer_store_format39,test_loop_ballot_barrier15,test_wave64_emulate_opt31, all OK.pytest tests/test_translate.py tests/test_rdna2spirv_xdxr_rules.py: 675 passed.scripts/run_gpu_tests.py, test programs built from this head: 258 of 258 shaders translate and passspirv-val; 198/249 passed, 49 skipped, 2 failed. The two failures,cs_imgload_tfeandcs_imgload_d16_tfe, fail identically with thismain's own translator on the same programs (--filter cs_imgload: 2/4 both ways, same texel values), so they are not from this change.mainwithout conflicts) was run by ten independent testers with no regression against theirmain: NVIDIA RTX 2060, 4080, 5080, 5090; AMD RX 5700 XT (RDNA1), RX 6800 and a Steam Deck (RDNA2), RX 9070 XT (RDNA4), gfx1036 iGPUs on the Windows driver; Windows, Linux/RADV.GPUs tested: NVIDIA RTX 5070 Ti, driver 621.24, Windows 11
AI-assisted: yes (Claude Code); built and tested on the machine above.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.