Repository navigation
compute: lower buffer_store_format_d16_x to FLOAT1 heap views - #2340
Merged
tedin7 merged 1 commit intoNov 25, 2026
Merged
Conversation
tedin7
reviewed
Nov 25, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head 481ff71 (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.- The partial-store read-modify-write is skipped for heap views, so no raw UAV Load is emitted for d16_x.
- No other open or recently merged PR covers d16_x heap-view stores.
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-> clean- Mutation 1: format word 22 -> 20 in the d16_x HLSL: controls FAIL (killed).
- Mutation 2: drop "d16_x" from the allowed channel list: controls FAIL (killed).
- Mutation 3: low half ->
value >> 16u: not caught by the Linux controls; it is only covered by the WARP draw readback (CI job below). - CI at this head:
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.
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.