Repository navigation
shader: translate packed D16 image stores in startup compute programs - #2300
Conversation
Share the typed UAV register allocation with raw buffer stores. Verify 2D full-mask half-float stores and per-lane EXEC against the three-mip RGBA16 fixture. Refs R0Y00#2274.
tedin7
left a comment
There was a problem hiding this comment.
Review of head 43822328746ab6eee06cca1349187f274018c03b.
Result: no P1, no P2.
Checked:
- Title is neutral. PR is mergeable. CI at review time: Linux checks pass, gfx1013 fixture job passes, Windows build pending, /O2 skipped.
- Packed D16 unpack in
op_image_storematches the cited layout: RG in VDATA, BA in VDATA+1, low half first. Full dmask, exactly two VGPRs, full-width VGPR XY and an intact fixed-table 8-word descriptor are all enforced. Other compute stores are refused. - Moving the descriptor check into
fixed_table_imageis a pure refactor forgather4. Its tests still pass. - Raw and typed UAVs now share one index space. The manifest lines come out in index order, because dict insertion order equals index order.
Commands run locally, with results:
python3 -B tests/startup_compute_image_store_d16_check.py: passed.python3 -B tests/startup_gfx2hlsl_compute_check.py: passed.python3 -B tests/compute_mimg_float_store_d16_check.py: passed.python3 tests/docs_links_check.py: passed, 438 links.python3 tests/bidi_controls_check.py: passed.git diff --check origin/main...HEAD: clean.- Mutation 1: swapped the low and high half unpack. The test failed on the expected HLSL line.
- Mutation 2: removed the
if (exec & 1)guard (this edit hit 3 emit sites). The test failed on the EXEC guard assertion. - Both mutations reverted with
git checkout -- ..
Nits:
- The mutation kills above come from string assertions in the Linux run. The WARP readback (
--dispatch ... warp) is where the half order and EXEC are checked numerically. I did not re-run it, because the PR body lists its own Windows verification and the Windows CI job was still pending. Please make sure that job is green before Ready. fixed_table_imagerejects a descriptor whose words were modified. A short comment saying that the manifest binds the original table view would help the next reader. The old comment was dropped in the refactor.
AI-assisted; commands listed were executed locally.
|
The final-head Windows 2025 run passed all four CTests at The first debug-layer run matched all 1,344 halves but reported warning 989 from the texture fixture's legacy format capability query. The follow-up uses the repository's SDK-version-aware |
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head c091eed70d1906b968be2b2ec37c6417561fb734 (previously reviewed at 43822328).
Result: no P1, no P2.
What changed since the last review:
tests/compute_check.cpp:547,551: the two texture-store capability queries (D3D12_FEATURE_FORMAT_SUPPORT,D3D12_FEATURE_D3D12_OPTIONS) now go through the sharedcheck_feature()helper (declared intests/desktop_gpu.h, defined intests/desktop_gpu.cpp:18, already included). Same queries, now made against the selected Agility SDK device. No logic change.tools/startup/gfx2hlsl.pyfixed_table_image: the docstring is reworded, and a comment now explains that a write through a second load of the descriptor can leave the SGPR symbols intact. This addresses my earlier nit about the dropped comment. Comment and docstring only.
Checked:
- CI on this head: Linux checks pass, gfx1013 fixture job passes, Windows build and test passes (2m30s). The /O2 job is skipped and the coverage chart job is skipping. This closes my earlier note about the pending Windows job.
- PR is mergeable. Title is neutral.
Commands run locally, with results:
python3 -B tests/startup_compute_image_store_d16_check.py: passed.python3 -B tests/startup_gfx2hlsl_compute_check.py: passed.python3 -B tests/compute_mimg_float_store_d16_check.py: passed.python3 tests/docs_links_check.py: passed, 438 links.python3 tests/bidi_controls_check.py: passed.git diff --check origin/main...HEAD: clean.- Mutation: changed the descriptor alignment check
first[3] % 8to% 4infixed_table_image. The D16 check failed with an AssertionError on the expected refusal text. Reverted withgit checkout -- ..
Nits: none new. The WARP readback is covered by the Windows CI job, which is green. I did not re-run Win2025, since the new commit does not touch the translated HLSL.
AI-assisted; commands listed were executed locally.
Refs #2274, item A, compute
image_store d16. At25317c63the startup compute translator refuses the source-built shader from #2106 withimage_store outside a pixel stage.The new path accepts a 2D full-RGBA-mask store with full-width XY and an intact eight-word descriptor from a fixed table location. It unpacks the low/high half-floats of VDATA and VDATA+1 into RGBA and writes under the lane's EXEC bit. The layout comes from the AMD RDNA 2 ISA, §§8.2.1 and 8.2.5.
The shared interface with item B is the version 2 compute manifest line
uav N tex2d float table P O channels 4. For the fixture it names table 1, byte 64. The translator assigns a single UAV index space to raw and typed views. Tests cover both discovery orders, conflicting raw/typed stores and conflicting SRV/UAV uses of the same descriptor. The standalone test supplies an RGBA16_FLOAT UAV. Slot-67 binding and its view-format checks remain with the runtime item.Verification
python -B tests/startup_compute_image_store_d16_check.py --dispatch <dxc> <offscreen_check> warpand the same command withhardwareran on Windows build 26100.9711, WARP 10.0.26100.9711 and a desktop RTX 4060 with driver 32.0.15.9579. Both positive cases matched all 1,344 halves on each adapter. The four controls removing the store, swapping R/G, swapping the packed registers and dropping EXEC protection differed in exactly 64, 32, 64 and 32 halves. The first three showed5000,c000and0000at mip 0, half 0 (expected3c00). The fourth showed3c08at half 128 (expected5080). The local debug layer was unavailable.python -B tools/startup/gfx2hlsl.py --pending <cache>path processed synthetic request keysd3cfb5c33473af1fand1bd251f34165a64e. Both manifests and HLSL matched the direct translator. All four dispatches of the CLI-produced CSOs matched 1,344/1,344 halves.tools/run_checks_parallel.py(startup D16 store, compute, gather, pixel store, compute translation, offline D16 store, docs links and bidi controls). All 51tests/startup_gfx2hlsl*_check.pyentries passed. The original offline D16 WARP draw also passed, including its two existing negative controls.git diff --checkpassed.To repeat the registered checks, build
offscreen_checkand runctest --preset release --no-tests=error -R '^startup_compute_image_store_d16' -V. The input shader and CPU oracle are the repository's MIT-licensed synthetic fixtures. AI-assisted with Codex.