rdna2spirv: translate image_get_lod on a cube (IMAGE-GET-LOD-CUBE) #2099
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2099"
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?
Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T20:35:52Z.
A cube binds as the 6-layer 2D-array view
cube_coordsalready builds forimage_sample: the query takes the projecteds - 1andt - 1(the 2D-array u and v) and does not read the third word (8 * slice + face).a16packs the three coordinates differently, so a16 cube staysUnsupported.No corpus shader uses cube
image_get_lod(705 in the 26,503-shader set: 702 2D, 3 2D array), so no title output changes; a 2,651-shader shard translates to byte-identical.spvbefore and after. Confirmed by the RDNA2 ISA MIMG GET_LOD form and the existing cube sample mapping (docs/design.md).Claimed in the coordination issue as:
IMAGE-GET-LOD-CUBE(ubiquitarianism/leonida#1608).What and why
tools/rdna2spirv.pyrefusedimage_get_lodon every dimension but 2D and 2D array. A cube is the same 6-layer 2D-array viewcube_coordsuses: the hardwaresandtare the projected coordinates in [1, 2] and the third word is 8 * slice + face; the LOD comes from the s/t derivatives, so the translator queriesOpImageQueryLodon%simg2daat(s - 1, t - 1)and does not read the face word. This translation is byte-identical for the existing 2D and 2D-array uses.a16cube remains refused because a16 packs the three coordinates differently.Tested
tests/semantic/test_image_get_lod_cube.py: 5/5 (SPIR-V shape, source VGPRs, face word unread, refusals,spirv-as/spirv-val).tests/semantic: 6,317 tests pass.image_get_lodin the 26,503-shader set (702 2D, 3 2D array); a 2,651-shader shard translated to byte-identical.spvbefore and after.GPUs tested: n/a (translator-only; CPU and
spirv-as/spirv-val, no GPU needed).AI-assisted: yes.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-26T13:55:28Z.
Tested
1b2720ba4merged ontomaina73a57e13(it merges cleanly), on an Apple M3 (macOS 26.5.1). I ran the fullscripts/run_gpu_tests.pyin auto mode, with test programs built frommain. I tested the merge rather than the branch alone because a branch from before9f98dcc61failsps_texagainstmain'svk_bindless_test(the tagged descriptor table), which says nothing about this change.mainmain+ this PRLEONIDA_W64_EMULATE=1The counts are identical to
mainon all three. No new failure. The ones left are the same on both sides:cs_fma_fused(#1724),ps_ssharp(#1774) andcs_imgatomic_ext(#1518) on MoltenVK; KosmicKrisp's(NAN)-constant fixtures (#2229) andcs_imgatomic_extthere.AI-assisted (Claude Code). No game data.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:50:19Z.
Review: COMMENTED
Draft review note: cube
image_get_lodlowering (IMAGE-GET-LOD-CUBE) is cleanly scoped and currently mergeable onmain, but remains a draft with no CI run. Please run CI to green and mark ready for review when you want this merged.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:19:21Z.
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:03:18Z.
Review: APPROVED
Now ready for review and
MERGEABLE. Clean-room verified: cubeimage_get_lodlowering intools/rdna2spirv.py,docs/design.mdcontract update, andtests/semantic/test_image_get_lod_cube.pyare clean and GPU-verified on Apple M3 (@Tauwni).Approving — ready to merge once CI runs green on current
main.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:17:29Z.
Verified all three result masks for cube LOD with
1b2720ba4+ed867d7b2. I assembled and validated six synthetic modules withspirv-asandspirv-valtargeting Vulkan 1.2: masks0x1,0x2and0x3for both 2D array and cube. Main validated the three 2D-array controls and refused the cube form. The PR validated all six and left the three array modules byte-identical to main. Each cube module read the projected coordinates and omitted the face word. All five checked-in tests also passed. This checks emitted SPIR-V, with no GPU readback in this comparison.AI-assisted with OpenAI Codex.