shader: lower aligned gfx1030 packed D16 typed-buffer stores #1200
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1207"
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-24T03:33:21Z.
Scope
Add D16 x, xy, xyz and xyzw for packed 16-bit UINT. Odd counts preserve the last high half using an invocation-exclusive DWORD. Verify record ownership and assume no concurrent access and dispatch only along the indexed axis.
Follow-up to #1179. Rebased after #1206 merged, preserving the multichannel load bookkeeping. #1211 edits the adjacent load branch, so the second D16 PR may need a branch refresh after the first merges.
Validation
Tested
e5f4acf2d8ee0fdea45b03da2329c6a58b37b376on Windows 11 25H2 build 26200.9974 with the D3D12 debug layer enabled. The adapters were RX 7900 XTX driver 32.0.32029.2010 and Microsoft WARP 10.0.26100.9818.cmake --preset dev -DINTAKE_PYTHON=<dev-python>andcmake --build --preset dev --target offscreen_checkpassed.ctest --preset dev --no-tests=error -R '^compute_store_aot_(mtbuf_(load|store)|guard_read)_' -Vreported 6 passes, zero failures and zero skips. Clearing the preserved half changes word 1 from c5c54567 to 00004567 for x and word 2 from c5c5cdef to 0000cdef for xyz.python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1passed on LLVM 15.0.7.python -B tests/form_coverage_check.py,python -B tests/docs_links_check.pyandpython -B tests/bidi_controls_check.pypassed.python -B tools/form_coverage.py out/results.xmlrecorded the new instruction forms from passing readbacks.The GPU measurements execute translated desktop DXIL against CPU references.
A local integration checkout,
8b8a60a4d025ffbf06d0a9550642a0c8fbcfcc3b, kept the D16 load bookkeeping and the D16 store matcher when resolving their adjacent edits.ctest --preset dev --no-tests=error -R '^compute_store_aot_(mtbuf_(load|store)|guard_read)_' -Vreported 6 passes, zero failures and zero skips on WARP and RX 7900 XTX. The passing readbacks recorded all 16 gfx1030 MTBUF forms.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:45:30Z.
Review: COMMENTED
Reviewed
79beeb8con Linux (Windows build and D3D12ctestexecution were not run locally).Diff audit
tools/compute_store_aot.py: addstbuffer_store_format_d16_{x,xy,xyz,xyzw}lowering (cpu == "gfx1030",idxen, nooffen).x/xy/xyz/xyzwtoBUF_FMT_16_UINT,BUF_FMT_16_16_UINT,BUF_FMT_16_16_16_16_UINT(forxyzandxyzw), withcount = (components + 1) // 2DWORDs.offset(offset % 4 == 0),offset + 4 * count <= stride, and reserves the full[offset, offset + 4 * count)span inwritten_spansso no overlapping store can share the final DWORD.d16_x,d16_xyz), performs(outputData.Load(final_address) & 0xffff0000u) | (words[-1] & 0xffffu)to preserve the high 16 bits, relying on single-axis indexed dispatch and no concurrent UAV access (documented indocs/experiments.md).tests/compute_store_check.py: addsmtbuf_store_d16_{x,xy,xyz,xyzw}cases, negative controls, half-swap mutants, and& 0uhigh-half-clear mutants for odd counts.README.mdanddocs/experiments.md: consistent and title-neutral. Cleanly disjoint from #1206 and #1211.Linux checks (
/root/.local/share/x2w-rev-venv/bin/python -B)tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (0 failures)tests/form_coverage_check.py: passedtests/docs_links_check.py: passed (15 Markdown files, 268 links)tests/bidi_controls_check.py: passed (977 files)offscreen_checkandctest -R '^compute_store_aot_(mtbuf_store|guard_read)_'not run locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:48:09Z.
Review: COMMENTED
Retested
e5f4acf2(delta79beeb8c..e5f4acf2, merge/rebase ontomain) on Linux. Windows build and D3D12ctestexecution were not run locally.Delta audit (
79beeb8c..e5f4acf2)README.md,docs/experiments.md,tests/compute_store_check.py,tools/compute_store_aot.py) relative to79beeb8c; the delta only pulls inmainupdates (#1206,#1209,#1210,#1218,#1221, etc.).tbuffer_store_format_d16_{x,xy,xyz,xyzw}lowering, odd-count high-half preservation (& 0xffff0000u), span reservation, and test mutants remain intact and title-neutral.Linux checks (
/root/.local/share/x2w-rev-venv/bin/python -B)tests/compute_store_check.py binary /usr/bin/llvm-mc-19 /usr/bin/llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (0 failures, exit 0)tests/form_coverage_check.py: passed (form coverage checks passed, exit 0)tests/docs_links_check.py: passed (16 Markdown files, 278 links, exit 0)tests/bidi_controls_check.py: passed (1038 tracked files, exit 0)git diff --check origin/main..HEAD: passed (exit 0)offscreen_checkandctest -R '^compute_store_aot_': not run locally.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T04:37:50Z.
Windows Server 2025 retest at
79beeb8c(Windows Server 2025 Build 26100, MSVC 14.44.35207, AMD Ryzen 5 PRO 5650U, WARP):Debug (
devpreset)Commands:
Results: 26 passed, 0 failed, 0 skipped (Total Test time:
151.19 sec, includingcompute_store_aot_mtbuf_store_hardware(4.29 sec) andcompute_store_aot_mtbuf_store_warp(4.02 sec)).Release (
/O2,releasepreset)Commands:
Results: 26 passed, 0 failed, 0 skipped (Total Test time:
174.34 sec, includingcompute_store_aot_mtbuf_store_hardware(5.72 sec) andcompute_store_aot_mtbuf_store_warp(6.47 sec)).