compute: expand packed D16 into FLOAT4 heap views #2222
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2230"
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 R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T06:29:31Z.
Refs #2022, follow-up to the UINT4 store in #2224. The heap-view route now accepts gfx1013
buffer_store_format_d16_xyzwwith two source VGPRs and a live identityBUF_FMT_32_32_32_32_FLOATview (77). Each packed half expands to a binary32 component in X/Y/Z/W order. The bounds check uses the full 16-byte destination texel. Selecting a UINT4 view with the packed opcode leaves the destination untouched, as does selecting a FLOAT4 view with the ordinary UINT opcode. AMD RDNA 2 instruction set · Microsoft HLSL conversionVerification on Windows at
5971d011buffer_store_format_d16_xyzw v[10:11], v8, s[20:23], 0 idxen offset:4; the heap-view lowering refused it. On this branch the source assembly, LLVM-C disassembly lowering and container CLI emit identical HLSL for both the packed and original program.python -B tests/compute_heap_store_check.py draw <dxc> <offscreen_check> warpand repeated it withhardware. Each device passed all 12 D16 cases and detected 11 wrong shaders. The original UINT4 path passed all 12 cases and detected its 8 wrong shaders on both devices. Each case compares all 320 words. The packed inputs include successive binary16 values at 1.0, −2.0, the smallest positive binary16 subnormal and negative zero. Dropping the conversion, duplicating the low half or sourcing W from the wrong VGPR each caused a readback mismatch. Used DXC 1.9.2609 and the source-built renderer.python -B tests/compute_heap_store_check.py controls, the adjacent heap-load, format-load, entry-layout, population-count and integer-comparison controls passed. Documentation link and bidi checks andgit diff --checkpassed.python -B tests/compute_heap_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1.AI-assisted with Codex (GPT-6.2 Astra xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T06:33:47Z.
Review: COMMENTED
Review of head
5971d0110b982506d1fa18d8d0fa8be55608f475(files:tools/compute_store_aot.py,tests/compute_heap_store_check.py,docs/experiments.md).Result: 0 P1, 0 P2.
Semantics:
buffer_store_format_d16_xyzwwith two source VGPRs expands X/Y from the low/high half of the first VGPR and Z/W from the second. Each half goes throughf16tof32into a binary32 word of a live format 77 (BUF_FMT_32_32_32_32_FLOAT) view. This matches the RDNA2 D16 format-store model.spanreserves four bytes per component for the heap route.compute_store_aot.pyedits may need a trivial rebase if #2165 merges first.Linux checks executed locally:
python3 tests/docs_links_check.py: pass (18 files, 414 links)python3 tests/bidi_controls_check.py: passgit diff --check origin/main...HEAD: passpython3 -B tests/compute_heap_store_check.py controls: passMutation (restored with
git checkout -- .afterwards):d16_xyzwfrom the accepted heap-store channels makescontrolsfail withValueError: Heap store view requires buffer_store_format_xyzw or buffer_store_format_d16_xyzw. Killed.value.x: the Linuxcontrolstest does not catch it, since it only checks the HLSL text. The PR's WARP/hardware readback fixture is the guard for it, and it covers this mutation by design. Its runtime results come from the author and from CI.CI:
Build and test on Windows= SUCCESS (run 45560989329), Linux checks and gfx1013 fixtures = SUCCESS.AI-assisted; commands listed were executed locally.