Repository navigation
rdna2spirv: extend image_load_mip to 1D, 2D, 2D_ARRAY, CUBE, and 3D with a16 and d16 - #4206
SweatierKey wants to merge 2 commits into
Conversation
|
Automated test:
Same machine and setup as my earlier manual reports. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude). No game files. |
|
At d89648d this refuses forms that Translated with
No semantic test on Otherwise the full |
Flyander
left a comment
There was a problem hiding this comment.
The mip-dependent coordinate mapping and A16 packing are consistent with the RDNA3 instruction layout, and the existing typed-load helper is reused for D16. The translator and semantic test coverage is strong; I found no blocker. There is not yet a direct GPU fixture for image_load_mip, so runtime behavior remains unverified end to end.
|
Apple M2 no-regression check at head d89648d (macOS 26.4, MoltenVK 1.4.2 direct, subgroup 4..32, llvm-mc 23.1.6, clean full build exit 0 on AppleClang 17).
As requiemsnkrp noted, no GPU fixture uses AI-assisted. |
whattheflop
left a comment
There was a problem hiding this comment.
AI-assisted Windows CPU review at d89648d2. WSL LLVM 21.1.8 assembled 20 new gfx1030 fixtures across dimensions and A16/D16 modes. Six translated on the exact parent and all 20 on this head, with every emitted module passing Vulkan 1.2 validation. Tracing the actual FLOAT/UINT/SINT fetch operands gave packed 2D (21, 32786) at LOD 3, ignoring the unused high half, and packed 3D (33, 57, 32817) at LOD 5. Stubbed-texel CPU checks also confirmed integer saturation and preservation of the final D16 destination's high half.
A scratch merge with #3045 at e34b0c7b resolved the one conflict by keeping the unified mip helper and emitting the sampled access with self.dynamic_sampled_access(ip, f"%{iptr}", iarr, idx). All 20 CLI modules validated and all 20 metadata entries reported SampledImageArrayDynamicIndexing and shaderSampledImageArrayDynamicIndexing. Scratch tree dc25315af4b8b645c233ea8c30a3a9006d8490f1.
Please update the design-contract rows with the expanded dimension, mip and binding layouts and their test basis. For the status behavior already reported, two LLVM-assembled D32 TFE probes confirmed that the parent translates while leaving the seeded status word untouched, and this head rejects them. That distinction is worth recording. Full semantic discovery showed the same seven failures and two errors as the parent. No native texture readback was measured.
|
Thank you @CaravelaLabs, @requiemsnkrp, @ray3242, @bobcatchris, @Flyander, and @whattheflop for the thorough checks and reviews! Addressed @ray3242's and @whattheflop's feedback in
|
whattheflop
left a comment
There was a problem hiding this comment.
The design-contract update is in place at 9bdb3c11, and all four revised mip-dimension tests passed from the exact tracked tree on Windows with uv CPython 3.12.13. Both A16+D16 2D-array fragment binaries rebuilt byte-for-byte, including the #3045 variants used for the RTX 3080 readback. The two draws matched all 4,096 pixels each, including the mip-0 control, with zero core or synchronization validation diagnostics.
One status corner remains. The follow-up preserves acceptance for the five tested legacy 2D/3D cases, but also accepts TFE for 1D, 2D-array and cube where both the parent and the original PR refused it. In four LLVM-assembled probes (including 2D-array+D16), the validated SPIR-V left the seeded status VGPR at 0x11223344. Could the compatibility exception stay limited to the legacy 2D/3D forms unless the newly accepted dimensions implement the status result? That retains the previous coverage without extending the unwritten result. Status checks were offline only. AI-assisted.
|
Re-tested at 9bdb3c1: the AI-assisted (Devin), CPU-only. |
|
Independent image readback on Windows 11 build 28000, RTX 4070 Ti SUPER / NVIDIA 617.14, exact head
GPU coverage is limited to these 2D and 2D-array fixtures. No Vulkan validation layer enabled during rendering. Synthetic inputs only. AI-assisted. |
… update design contract
9bdb3c1 to
0662ad3
Compare
|
Rebased cleanly onto |
|
Tested Reproduction details: I adapted a scratch copy of AI-assisted; synthetic textures and instruction listings. |
Claimed in #4084 (claim).
What and why
image_loadalready supports all five sampled image dimensions (1D,2D,2D_ARRAY,CUBE,3D) witha16packed unsigned 16-bit coordinates andd16packed 16-bit results throughimage_load_typed(bindings 0, 3, 5, 6; no storage-image capability).image_load_mipwas split into two ad-hoc paths inGen.image_misc(2D with/withouta16, and 3D only withouta16) and raisedUnsupportedon2D_ARRAY,3D a16,1D, andCUBE, while also accidentally settinguses_query = True(OpCapability ImageQuery) on 2Dimage_load_mip.Change
tools/rdna2spirv.py(Gen.image_load_mip/Gen.image_misc): unified allimage_load_miphandling intoGen.image_load_mip:SQ_RSRC_IMG_1D(binding 5,x, mip),SQ_RSRC_IMG_2D(binding 0,x, y, mip),SQ_RSRC_IMG_2D_ARRAY(binding 3,x, y, slice, mip),SQ_RSRC_IMG_CUBE(binding 3 via2D_ARRAYview,x, y, face, mip), andSQ_RSRC_IMG_3D(binding 6,x, y, z, mip);a16packed unsigned 16-bit coordinate+mip operands viaunpack_image_a16_uints, and both 32-bit andd16packed outputs viaimage_load_typed;glc,tfe/lwestatus returns, short coordinate lists, and dimensions without sampled bindings (1D_ARRAY, etc.) refused asUnsupported;OpCapability ImageQueryonimage_load_mip.tests/semantic/test_image_load_mip_dims.py: verifies all 5 dimensions × (32-bit,a16) × (normal,d16) for bindings, SPIR-V image dims, float/uint/sint typed fetch aliases, coordinate/LOD extraction, absence of storage-image /ImageQuerycapabilities,spirv-val --target-env vulkan1.2validity, and refusal of unsupported forms.Tested
Linux (WSL2), Python 3.13.5,
spirv-as+spirv-val --target-env vulkan1.2onPATH, CPU only, no game files:tests/semantic/test_image_load_mip_dims.py: 3/3 OK (20 valid sub-cases all validated byspirv-val+ 7 refused sub-cases)tests/test_image_load_typed.py: 21/21 OKtests/test_image_query_translate.py: 10/10 OKtests/semantic/test_image_coherent.py: all OKtests/test_semantic_translator_use.py(3/3),tests/test_text_write_line_endings.py(3/3),tests/test_text_encoding.py(2/2): all OK.