Repository navigation
shader: lower 32-bit 2D compute image_store and unorm in gfx2hlsl - #2399
Conversation
|
Approved — solid lowering of 32-bit 2D image_store with unorm. Full test coverage with WARP/hardware readback and negative controls. Manifest version 2 binding correct. No game files. |
# Conflicts: # tests/startup_pixel_image_store_check.py # tools/startup/gfx2hlsl.py
R0Y00#2399 lowers 32-bit compute image_store and still refuses a16 there; the packed address form is only tested in the pixel stage (startup_pixel_image_store_check). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hardware run and Windows 11 MSVC build at head Environment: Windows 11 Pro build 26300.9974, Debug ( Build: Tests:
The hardware test dispatches 6 cases, each with
The WARP run ( Not covered by this run: this run is NVIDIA only (the PR body already lists an AMD run); the |
tedin7
left a comment
There was a problem hiding this comment.
Review of head bdcca315 (after updating with main). Comment review, no approval.
What I checked:
tools/startup/gfx2hlsl.py: the compute 32-bit path reuses the D16 checks (2D only, dmask 0xf, 4 data VGPRs, 2 full-width coordinate VGPRs, fixed table image, EXEC guard).unormis accepted on image_store in both stages, like image_load. Partial dmask, non-2D, a16/tfe/lwe/r128 and aliasing stay refused by name.- Sibling checks: the old
requires d16and pixelunormrefusal assertions were updated, and the new check is wired in CMake (CPU and per-adapter),windows.yml(both lists), AGENTS.md and docs. - No other open or merged PR covers this slice (#1649 is array/3D, #2106/#2300 are D16).
- Mutations: removing
unormfrom the allowed list makes the new check and the pixel check fail (Unsupported: image_store modifier unorm). Swapping channels in the emittedasfloat(uint4(...))makes the new check fail.
Commands run locally (Linux, llvm-mc 19):
python3 -B tests/startup_compute_image_store_check.py --llvm-mc llvm-mcPASSpython3 -B tests/startup_compute_image_store_d16_check.py --llvm-mc llvm-mcPASSpython3 -B tests/startup_pixel_image_store_check.py --llvm-mc llvm-mcPASSpython3 tests/docs_links_check.pyPASS,python3 tests/bidi_controls_check.pyPASSgit diff --check origin/main...HEADclean
Not run in this review: the WARP/hardware readback part, which needs Windows. Win2025 receipt follows separately.
AI-assisted; commands listed were executed locally.
|
Win2025 WARP receipt for head bdcca31 after updating with main. Targeted run: the new WARP GPU-readback test startup_compute_image_store_warp plus d16 and pixel image_store siblings, 5/5 passed in dev and in release. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
AI-assisted; commands listed were executed locally. |
Summary
Lower 32-bit 2D
image_storein startup compute shaders and accept theunorminteger-coordinate modifier on 2Dimage_storeintools/startup/gfx2hlsl.py.image_store: acceptsdim:SQ_RSRC_IMG_2D,dmask:0xf, four consecutive data VGPRs, two full-width coordinate VGPRs, and an unmodified eight-word image descriptor from a fixed table offset. Emitsasfloat(uint4(...))toRWTexture2D<float4>under the lane's EXEC bit and publishesuav N tex2d float table P O channels 4in the version 2 compute manifest (matching shader: translate packed D16 image stores in startup compute programs #2300).unormmodifier: accepted onimage_storein both compute and pixel stages, matchingimage_load(MIMGIMAGE_STOREalways addresses unnormalized integer texel coordinatesuint2(x, y)). Partialdmask, non-2D dimensions,a16,tfe,lwe,r128,image_store_mip, modified descriptors, and same-resource load/store aliasing remain refused by name.tests/startup_compute_image_store_check.py(pure-Python controls + WARP and hardware 3-mipR32G32B32A32_FLOATGPU readback reusing#2105's source-built fixture and CPU reference, plus four negative controls), updates the oldrequires d16andunormrefusal assertions intests/startup_compute_image_store_d16_check.pyandtests/startup_pixel_image_store_check.py, and wires the new check intoCMakeLists.txt,.github/workflows/windows.yml,AGENTS.md,docs/experiments.md, anddocs/startup-runtime.md.Refs #2274
Evidence
ea981f1a(based onupstream/maina4900150)10.0.26100.981832.0.32029.2010startup_compute_image_store,startup_compute_image_store_warp,startup_compute_image_store_hardware,startup_compute_image_store_d16,startup_compute_image_store_d16_warp,startup_compute_image_store_d16_hardware,startup_pixel_image_store_controls,startup_pixel_image_store_warp,startup_pixel_image_store_hardware).mismatches=0,debug_errors=0 debug_warnings=0) for full EXEC (unorm) and partial EXEC, and detected all four negative controls (omit store: 64 mismatches, swap R/B: 32 mismatches, swap RG/BA: 64 mismatches, drop EXEC guard: 32 mismatches).Scope
This covers translation and standalone source-built GPU readback for 32-bit 2D
image_store(with and withoutunorm). Slot-67 runtime UAV binding remains tracked in #2274 Part B.