compute: lower buffer_store_format_d16_x to FLOAT1 heap views #2332
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2340"
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 Vladimir-Human on 2026-11-25T12:50:17Z.
Refs #2022
Summary
Extend
--heap-store-viewintools/compute_store_aot.pyto lower gfx1013buffer_store_format_d16_x(one data VGPR,idxen, 4-byte alignedoffset, indexed by dispatch thread IDtid.<axis>) into live identityBUF_FMT_32_FLOAT(0x01016fac, format 22) side-table heap views (store_heap_word_d16), extending item B's heap-store path (#2230). (The separate#2274item Agfx2hlsl.pycompute-stagebuffer_store_format_d16_xpath is untouched.)outputData.Load(...)read-modify-write underheap_store_view(elif partial and not descriptor_store and heap_store_view is None:).heap_store_view_hlsl(..., single_d16=True)emitsstore_heap_word_d16(slot, index, offset, value)while leavingstore_heap_words4untouched: checksslot < view_count,HEAP_VIEW_LIVE == 1u,view.w == 0x01016facu(descriptor_format_word(22)),(view.y & 0xc000ffffu) == 0u, 4-byte alignedview.xandstride,stride >= offset + 4u,index < view.z,view.x <= bytes,offset + 4u <= bytes - view.x,index <= (bytes - view.x - offset - 4u) / stride, widens the low 16 bits viaasuint(f16tof32(value & 0xffffu)), and writes one 4-byte binary32 word viaoutputData.Store(...). (Per AMD RDNA 2 ISA DS/MUBUF format conversion and HLSLf16tof32.)buffer_store_format_d16_xy,d16_xyz,x,xy,xyz,offen, multi-VGPRv[10:11], unaligned offsets, unready slot constants, and wrong thread-ID indexing refused.D16_X_PROGRAMinllvm-mc-15binary verification, 12FLOAT1layout/bounds/format cases + 4 binary16 payload patterns with0x4200-poisoned high halves +UINT1/FLOAT4mismatch rejections + 11 GPU shader mutations) and documented the coverage indocs/experiments.md.Verification (
481ff717, Windows 11 Build 26300, DXCcs_6_0, D3D12debug_layer=enabled)Commands:
. .\tools\dev.ps1; cmake --preset release; cmake --build --preset release --target offscreen_checkpython -B tests/compute_heap_store_check.py(controls pass)ctest --preset release --no-tests=error -j 1 -R "^compute_(heap_store_controls|heap_view_controls|load_format_controls|store_aot_heap_view_(load|store)_(warp|hardware)|store_aot_descriptor_store_format_(warp|hardware)|store_aot_mubuf_store_format(|_xyz)_(warp|hardware))$" -V(13/13 passed, 0 failed, 0 skipped):Microsoft Basic Render Driver,vendor=1414 device=008c, driver10.0.26100.9818,debug_layer=enabled):UINT4(12cases +8mutations),D16-to-FLOAT4(12cases +11mutations),D16_X-to-FLOAT1(16cases +11mutations) passed; directD16_Xdispatchgroups=1 compared_words=320 mismatches=0 debug_errors=0 debug_warnings=0.NVIDIA GeForce RTX 4070 SUPER,vendor=10de device=2783, driver32.0.16.2114,debug_layer=enabled):UINT4(12cases +8mutations),D16-to-FLOAT4(12cases +11mutations),D16_X-to-FLOAT1(16cases +11mutations) passed; directD16_Xdispatchgroups=1 compared_words=320 mismatches=0 debug_errors=0 debug_warnings=0.ctest --preset release --no-tests=error -R "^compute_" -E "_(warp|hardware)$"(7/7 passed, 0 failed, 0 skipped)compute_heap_view_check.py,compute_load_format_check.py,docs_links_check.py,bidi_controls_check.py,startup_tools_lint_check.py,form_coverage_check.py,shader_census_check.py: all passed.Not Tested Locally
llvm-mc-15binary verification (tests/compute_heap_store_check.pywired in.github/workflows/windows.yml:46) was not run locally on Windows.d16_xy,d16_xyz, and non-FLOAT1packed targets.AI-assisted implementation and verification.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:54:24Z.
Review: COMMENTED
Review of head
481ff717a4(tools/compute_store_aot.py, tests/compute_heap_store_check.py, docs/experiments.md).Findings: 0 P1, 0 P2.
buffer_store_format_d16_xunder--heap-store-viewtakes the low 16 bits (& 0xffffu) throughf16tof32and writes one binary32 word. The format word is 22 (BUF_FMT_32_FLOAT), the check order matches the existing FLOAT4 path, and the extent math uses a 4-byte width. Siblingd16_xy/d16_xyzstay refused.Commands run locally on the exact head:
python3 tests/compute_heap_store_check.py-> heap-store controls passedpython3 tests/docs_links_check.py-> Checked 18 Markdown files and 451 linkspython3 tests/bidi_controls_check.py-> no bidirectional controlsgit diff --check origin/main...HEAD-> cleanvalue >> 16u: not caught by the Linux controls; it is only covered by the WARP draw readback (CI job below).Build and test on Windows= pass,Run platform-independent Python checks on Linux= pass,Assemble and translate gfx1013 fixtures= pass.Comment-only review; no approval.
AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-25 15:01:50 +00:00