Repository navigation
Conversation
…d image_load_mip_pck_sgn (measured on RDNA2) Raw texel dwords, dmask bit k selects dword k, _sgn sign extends a texel under 32 bits. Rebuilt from the typed fetch for 8, 16 and 32 bit integer, UNORM and FLOAT formats; others give 0. GPU fixtures cs_imgpck_* through vk_store_test. AI-assisted.
|
Apple M2 data point. Tested head e75901f on Apple M2 (Mac14,3), macOS 26.4 (25E246), MoltenVK 1.4.2 (direct), subgroup 4..32, llvm-mc 23.1.6, Python 3.13.18.
Build note: full build fails on AppleClang 17 at vk_pipeline_check.cpp:567 (BUILD-822, fixed by open PR #2927); all GPU binaries built, so the run above is valid. Head fetched unchanged into a separate worktree; no rebase/edit/push. Synthetic shaders and counts only; no game files. AI-assisted. |
|
Tested e75901f on AMD Radeon RX 9060 XT (RDNA4), AMD driver 26.10.44 (LLPC, Vulkan driver 2.0.395), Windows 11 Pro 10.0.26300, subgroup 32..64: pass. The checks above have no AMD run from outside the author; this adds an AMD card with native 64-wide subgroups.
Test programs: built from this head with MSVC 14.44 ( |
|
Tested e75901f on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass. Python tests:
Full GPU suite (built PR runtime in a separate build dir due to
AI-assisted (OpenCode). |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested
Not checked: the |
AI-assisted.
|
Tested
Not tested: wave64, AMD/Intel/Mesa/MoltenVK, the hardware oracle. Tested with AI assistance (Claude); synthetic programs only, no game data. |
docs/design.md tools/rdna2spirv.py AI-assisted.
|
Tested Ran the PR’s synthetic fixtures through
AI-assisted verification with synthetic inputs. |
docs/design.md tools/rdna2spirv.py AI-assisted.
|
Tested 17007df (the current head, newer than the runs above) on AMD Radeon 610M (RDNA2 iGPU, AMD 26.11.2 / 32.0.21045.29003, subgroup 32..64) and NVIDIA GeForce RTX 5070 Ti Laptop GPU (Blackwell, 621.24, subgroup 32..32), Windows 11 Home 26200: pass. Same laptop, one GPU at a time through
224 shaders translated, 224 pass spirv-val in each run. I did not run the CPU tests of this PR. One run of each. No game files. AI-assisted (Claude Code). |
|
Tested
New in this PR:
Every other test has the same result as on |
|
Tested
No game files. AI-assisted (Claude Code). |
Requested by Lucas · project thread
Claimed in the coordination issue as: #2891 (comment)
What and why
image_load_pck,image_load_pck_sgn,image_load_mip_pckandimage_load_mip_pck_sgnraisedUnsupported. What they do was not clear from the ISA text, so I measured it on the Radeon (gfx1036, driver 26.10.1) with raw kernels throughtools/hw_oracle(the T# kernel oftools/image_fuzz.py, wave32):0x2on a 4-byte texel gives 0, on a16_16_16_16texel its second dword)._sgnsign extends dword 0 of a texel under 32 bits (1 byte from bit 7, 2 bytes from bit 15); 4-byte and bigger texels are the raw dwords._mipforms with mip 0 are the same; an out of range coordinate gives 0 (all result VGPRs).Translation: the typed fetch of
image_load/image_load_mip(so the existing uint/sint/float views and lookup), then the components are put back into bytes with the FORMAT's own widths from a 512-entry table built fromtools/gfx10_formats.json: integers masked, UNORM rounded back to the integer (exact for 8 and 16 bits), FLOAT16 narrowed, FLOAT32 as is. Only formats of 8, 16 or 32-bit components of those kinds are rebuilt; every other FORMAT (packed bit fields like5_6_5and10_10_10_2, SNORM, sRGB, scaled, depth, block compressed) gives 0. The raw bits cannot be recovered exactly from the fetch (SNORM-128and-127both fetch as-1.0) and the runtime binds no raw integer view of an image; that is the limit of this approach and is in thedocs/design.mdrow.d16,a16,glc,tfeand the 3D / array mip forms stayUnsupported.image_store_pckis not here: it is not the trivial mirror (it needs the forward conversion per format).vk_store_testnow also creates an rgba8 image (also viewed as R8G8B8A8_UINT), an R16G16B16A16_UINT and an R8_UINT image, filled inwordsmode, as elements 5..7 of the sampled array (the sampled array grew from 5 to 8 elements); the existing tests are unchanged (rerun, below).Tested
tests/test_image_load_pck.py: the format table, the measured words through a model of the packing, translation of every form and dimension, the refusals, spirv-val. Onmainthe module does not import (no table, the ops raiseUnsupported).cs_imgpck_rgba8(rgba8 as UNORM and as a UINT view, plain and mip form),cs_imgpck_rgba16(dmask selecting dword 1,_sgnon an 8-byte texel) andcs_imgpck_r8(8_UINT, zero and sign extension), every one of the 64 texels of the uint and sint image, formulas in the headers. Onmainall three fail to translate. With the change, on both GPUs (device linesNVIDIA GeForce RTX 5080andAMD Radeon(TM) Graphics, selected withLEONIDA_VK_DEVICE): 3/3 exact.vk_store_testfixtures (cs_imgatomic,cs_imgatomic3d,cs_resinfo,cs_imgload,cs_imgload_d16,cs_imgstore) still pass on both GPUs._sgnfailscs_imgpck_r8(34 of 64 sint words, first word 1:0x89instead of0xffffff89); every dmask bit taking dword 0 failscs_imgpck_rgba16(64 of 64,0x6e5b4835instead of0xbaa79481); dropping the UNORM branch failscs_imgpck_rgba8(all zeros). All on both GPUs. Removing the +0.5 of the UNORM rounding does not fail on these values (they convert exactly).python -m unittest discover -s tests/semantic4142 tests OK (4 skipped);regen_fixtures.py --check,tests/test_shader_checks.py,tests/test_image_load_typed.py,tests/test_isa_coverage.py,tests/test_hw_oracle.pypass.Checklist
docs/design.md, with how it was confirmed (measured on gfx1036 and GPU fixtures).AI-assisted.