docs(debt): measure DIM 3D stores through 2D and 2D-array T#s #17807
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17807"
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 boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-09T16:50:49Z.
What
Measures the stores item of the gap clause in the 3D image accesses bound to a 2D or 2D-array T# entry of
docs/dev/debt/shader.md: what a DIM 3Dimage_storedoes through a 2D T# and through a 2D-array T#.Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle, wave32, one work-group, 64 rows, 8x8
32_FLOAT(format 22), 256-byte pitch, one mip,dmask 0x1, a 64 KiB0xCDmarker backing read back in full (16,384 dwords) after every leg, each texel stored with its own fingerprint0x3F800000 + layer*64 + y*8 + x:image_store_mipat mip 0 writes the same 64 texels as the plain store.image_store_mipat mip 0 writes the same 64 texels as the plain store.image_loadrule reproduced on this rig before any store (2D T#: (x,y) texel at z 0, zero for z 1, 4 and -1; 2D-array: z is the layer, 64/64 lanes each). That is a same-SKU reproduction of CouchRiv's gfx1036 rule on a different rig and driver, not a re-measurement of their numbers.out.bindeleted and verified absent before every one of the 32 dispatches and the rig's code-object SHA-256 equal to the locally assembled one 32/32.The measured 2D-array rule (layer select, a past-the-end layer writes nothing) agrees with what the recompiler already implements for that case (
arrayStoreinResourceMaterializer.cpp,ArraySliceAddress+VolumeSliceInRangeinSpirvImageEmitter.cpp, execution testImageStoreVolumeThroughArray.cpp), so the entry's "stores ... keep throwing" was already stale for the 2D-array half. For a 2D T# the flat-volume runtime modes are!storageandflatVolumeCompatibleadmits only loads,image_sample_lzand queries, so that store still throws; the entry now says which half is implemented. Both of those are code readings, not measurements; no code changes in this PR.Evidence (fixture, scripts, all six dumps, verifiers, claims worksheet, full results): https://gist.github.com/brumskysb/1dbfc6a1dddebdc046e43762747372ac
Tested
gfx1036, driver 31.0.22044.1, Windows 11; harnesstools/hw-oraclethroughrig_runner.py, wave32, 64 rows, one work-group.image_store v4, v[5:7], s[8:15] dmask:0x1 dim:SQ_RSRC_IMG_3D(encodingF0200110 00020405) andimage_store_mip v4, v[5:8], ...with the mip level inv8, the fourth address component (encodingF0240110 00020405), thens_waitcnt vmcnt(0)and the readback.c1600000 0001c001 90000fac 00000000(2D) andc1600000 0001c001 d0000fac 00000001(2D-array), re-decoded from every leg's own stored body text (format 22, 8x8, type 9 / 13, DEPTH 0 / 1, BASE_ARRAY 0) before any count was taken.step2_verify.py,step3_verify.pyandstep4_verify.pyrecompute every count from the archived dumps (DUMP RECOMPUTE OK). Dump SHA-256: step 275c1a26d…0768f8, step 3650dc644…736432da, matching the gist's raw files.2D(type 9) and2D-array(type 13), the two the entry names; no other descriptor type is claimed.The replaced region, copied from
check_entry_edit.py's REPLACED REGION:before:
... Every other access of such an image, including samples with an LOD, bias, derivatives, offset or comparison, gathers,image_get_lodand stores, keeps throwing because it is not measured.after:
... Every other access of such an image, including samples with an LOD, bias, derivatives, offset or comparison, gathers andimage_get_lod, keeps throwing because it is not measured. DIM 3Dimage_storeandimage_store_mipat mip 0 were measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle,dmask0x1 on an 8x8 32_FLOAT T#: on a 2D T# a lane writes its (x,y) texel when z is 0 and nothing when z is 1; on a two-layer 2D-array T# z is the layer and z 2 writes nothing. The recompiler implements the 2D-array store; a store through a 2D T# keeps throwing.Removed phrases declared to the gate:
gathers,image_get_lod`` andstores,— the list loses only "and stores"; samples with an LOD, bias, derivatives, offset or comparison, gathers andimage_get_lodstay named as unmeasured, and the CouchRiv/adriadam10 provenance and "not the PS5's gfx1013" are untouched.Notes
debt-lengthwarning: the entry grows from 836 to 1,225 characters, 225 over the 1,000 guideline. No measured condition was compressed to fit; trimming the entry is its own PR.dmask, z other than 0 and 1 on a 2D T#, negative z, arrays of more than two layers, mip levels other than 0, and the PS5's gfx1013.docs/dev/debt/shader.md(#17733, #17701, #17623, #17611, #17606, #17605, #17523) and none of them edits this entry.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attached to this PR)Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-09T17:17:23Z.
Review: APPROVED
Checked the new sentence about the recompiler against
main. InResourceMaterializer.cpp,arrayStore(line 2258) adds only aDim2DArrayruntime mode for a DIM 3D storage write. A two-layer 2D-array T# is therefore served (layer = z, and a past-the-end layer writes nothing throughVolumeSliceInRange, matching your z 2 leg). A 2D T# has no matching mode and still throws. So "the recompiler implements the 2D-array store; a store through a 2D T# keeps throwing" is accurate.The measured 2D-T# rule also gives a small follow-up a precise spec: z 0 writes the (x,y) texel, z ≠ 0 writes nothing, decided per lane. A
Dim2Dmode for these stores, with az == 0store predicate, would mirror what the DIM 3Dimage_loadthrough a 2D T# already does for z ≠ 0 (volumeLoad, returning zero).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:49:34Z.
Review: COMMENTED
Read
7ece1d9203againstmain.Correctness.
ResourceMaterializer.cpp:RuntimeImageModes(lines 2258-2262 at this head) adds aDim2DArraymode for aDim3Dshader image only when it is a storage image that is written, not read, not atomic and notDynamicStorage. There is noDim2Dmode for a 3D store, so a store through a 2D T# still throws and the 2D-array store is implemented, as the added text says. The earlier "and stores" in the list of throwing accesses is removed, which is consistent with that. The gfx1036 measurements cannot be checked from the code. The entry text on main is identical to the PR base, and the other shader.md PRs in this set (#17974, #18026) edit different entries.Non-blocking. The kept sentence "Every other access of such an image ... keeps throwing" no longer says that stores outside the measured case (read-write or atomic images, mip above 0 on a dynamic-mip image, depth, packed or BY formats, per
RuntimeImageModes:2258-2259) also still throw. One short clause would keep the gap list complete.Not run here; this is from reading the code.
AI-assisted: yes.