shader: lower experimental gfx1030 packed D16 XYZ stores #1450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1457"
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 stan495 on 2026-11-24T11:52:22Z.
Summary
Add an opt-in lowering for gfx1030
buffer_store_format_d16_xyzwith an identity-selectorBUF_FMT_16_16_16_16_UINTdescriptor.--mubuf-d16-xyz-mode preserve-wdeclares that the native operation preserves W. The raw UAV lowering replaces XYZ and preserves the high halfword containing W. It requires an indexed, in-range record and exclusive ownership of the affected DWORDs. The default profile still rejects XYZ.Local checks
Tested
5dfcb3c653cc0c0f126e78cc2eb3cd7fcd1c75ba.LLVM/LLD 15 assembled, linked and disassembled both native targets. The CPU reference controls and the compute-container CLI regression passed. On Windows,
cmake --build --preset dev --target offscreen_checkpassed and the CTest filter listed four cases.docs_links_check.py,form_coverage_check.pyandbidi_controls_check.pypassed. The native CPU model distinguishes preserved W (8103) from overwritten W (ca5e) at halfword 3 and detects a missing record bound at halfword 256 (8200expected,1317written).Independent GPU validation requested
Please run the translated DXIL cases on WARP and a physical adapter from a Windows dev build.
The XYZ tests compare all 320 DWORDs at one and two workgroups. The XYZW mutant should first differ at DWORD index 2, expected
c5c54567, actual01234567.Please also run the original ISA on a Linux HIP device identified as gfx1030 by
rocminfo.The native fixture checks 448 halfwords at one, two and three workgroups.
gfx1100provides a separate RDNA 3 comparison. Report the tested SHA, adapter, driver, Windows build and D3D12 debug-layer status or Linux kernel and HIP version. Include pass, fail and capability-skip counts and the first mismatch, if any. GPU execution is pending. The candidate has no semantic coverage registration pending native gfx1030 readback.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:31:19Z.
Review: COMMENTED
Dual-platform review of PR #1457 at commit
5dfcb3c653cc0c0f126e78cc2eb3cd7fcd1c75ba:Code & Scope Audit
tools/compute_store_aot.pyadds opt-in--mubuf-d16-xyz-mode preserve-w, gated oncpu == "gfx1030"andoutput_format == "BUF_FMT_16_16_16_16_UINT".buffer_store_format_d16_xyz; withpreserve-w, the raw UAV lowering reserves the full second DWORD (written_spanscovers 8 bytes,offset + 8 <= stride) and preserves its high 16 bits (W) via read/modify/write.tests/compute_store_check.pycover missingpreserve-wcontract, mismatchedoutput_format,offen, unalignedoffset:8, out-of-range VGPR,glc, overlappingbuffer_store_shortin the preserved DWORD, missings_waitcnt, and an_xyzwmutant failing atword=2.m["typed"]branch (tbuffer_store_format_d16_xyz ... format:[BUF_FMT_16_16_16_16_UINT]),format_components = 4is used without checkingmubuf_d16_xyz_mode == "preserve-w"(unlike theformattedbranch). Not a blocker forMUBUFscope, though checkingpacked and components == 3uniformly would prevent bypassing the opt-in viatbuffer_store_format_d16_xyz.CMakeLists.txtomitsFORM_COVERAGE_RECORDoncompute_store_aot_mubuf_store_format_xyz_${adapter}, matching the documented pending nativegfx1030readback gate.Verification
llvm-mc-19,llvm-objcopy-19,libLLVM-19.so,ld.lld-19,llvm-objdump-19):python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed.sh tests/gfx1030_mubuf_d16/build.sh gfx1030andgfx1100(with LLVM 19 tools): assembled, linked, and disassembledxyzandxyzwfixtures.python3 -B tests/gfx1030_mubuf_d16/check.py --model-only: passed (wrong-W control at word 30x8103vs0xca5e, missing-bounds control at word 2560x8200vs0x1317).git diff --check origin/main...HEAD: passed.python3 -B tests/docs_links_check.py: passed (16 Markdown files, 325 links).python3 -B tests/bidi_controls_check.py: passed (1192 files).--preset dev):cmake --build --preset dev --target offscreen_check -- -j 6(4.38s);ctest --preset dev -R '^compute_store_aot_mubuf_store_format_' --parallel 4 --no-tests=error --output-on-failure: 4/4 passed (4.36s)./O2(--preset release):cmake --build --preset release --target offscreen_check -- -j 6(1.67s);ctest --preset release -R '^compute_store_aot_mubuf_store_format_' --parallel 4 --no-tests=error --output-on-failure: 4/4 passed (4.41s).gfx1030/gfx1100hardware (no AMD GPU in this environment).Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-24T12:40:51Z.
Independent GPU validation
Measured
5dfcb3c6merged onto2ae8a9e4(my merge97f84f2f, tree027790d6, working tree clean). Nothing below is a code change.Environment
10.0.26100.0user-mode)AMD Radeon RX 9070 XT vendor=1002 device=7550, driver32.0.32029.2010Microsoft Basic Render Driver vendor=1414 device=008c, driver10.0.26100.9818dev(Debug),debug_layer=unavailable— see the limitation belowCommands
Observed
Two entries, three runs each: 6 passed, 0 failed, 0 skipped.
On the physical adapter,
buffer_store_format_d16_xyz (BUF_FMT_16_16_16_16_UINT):The W halfword is part of that comparison: the reference writes only the six payload bytes of XYZ into the record and leaves the high halfword at the sentinel, so a lowering that clobbers W would show up as a mismatch at DWORD 2.
The mutant controls in the fixture were caught on both backends — for the
_xyz→_xyzwvariant it is the exact expected line:and the default-profile rejection of XYZ (
mubuf_d16_xyz_mode=None) still holds.Regression
^compute_store_aot_mubuf: 24 passed, 0 failed, 0 skipped.ctestcollects 24 entries on this tree — thecompute_store_aot_mubuf_counter*entries from the still-open #1458 are not registered here — and nothing else in the family moved.Limits
0x887a002d, SDK component missing; the Graphics Tools optional feature is absent and its install is refused from a remote session with0x80070005), so the run says nothing about D3D12 API validation — only that the readbacks match.BUF_FMT_16_16_16_16_UINT,idxen offset:4, stride 16). Other formats and non-identity selectors are not covered by this run.AI-assisted; runs executed locally on the adapter above.