compute: image_store / image_load_mip to typed UAVs, and buffer/image atomics #1538
Open
opened 2026-11-24 13:48:03 +00:00 by denn0x
·
12 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#1538
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 denn0x on 2026-11-24T13:48:03Z.
Problem
Measured on the 349 gfx1013 compute programs (device slot 67 pipelines) that the executable created in one run past start-up, and on the 627 dispatches of one busy frame after loading. Image stores and atomics have no lowering yet:
image_store(166 sites, withdmask,unorm,d16) into 1D/2D/2D array/3D images.image_load_mip(249 sites).buffer_atomic_add(7 of the busy frame's dispatches),buffer_atomic_cmpswap,image_atomic_umax.Proposal
RWTexture*<float4>(u register); a load from the same descriptor goes through theUAV (typed UAV load). A texture both sampled and stored is refused.
dmaskselects the stored channels, with 0 for the others. d16 data is two halves per VGPR.image_load_mip: the mip is the last address component,Load(int3/int4(..., mip))on an SRV. On a UAV theview's mip slice is used.
RWByteAddressBuffer.Interlocked*(withglcreturning the old value), image atomics toInterlocked*onRWTexture2D<uint>, which needs an R32_UINT view.Alternatives
None noted.
Verification
A source-built gfx1013 fixture (LLVM 15
llvm-mc, as the existingcompute_store_check.pyandpixel_aot_check.pyfixtures) that uses the instructions, translated and dispatched on WARP, with the UAV read back and compared with
expected words. Include a negative control (an operand form or modifier the lowering refuses).
Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T14:44:13Z.
Taking a first slice of this, AI-assisted (Codex, driven with Claude Code), with Windows 10 22H2, a GTX 1060 and WARP.
Slice: gfx1013
image_storeinto a 2D image, lowered toRWTexture2D<float4>(a u register), withdmaskselecting the stored channels. Thenimage_load_mipon an SRV, asLoad(int3(x, y, mip)).Fixture: a source-built gfx1013 program, dispatched on WARP and hardware, with readback compared against independently computed words. A negative control covers a form the lowering refuses (for example d16, or a texture that is both sampled and stored).
Not in this slice: buffer and image atomics, d16, 1D, arrays and 3D. #1587's gfx1030 float image atomics are separate.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T14:52:58Z.
Please go ahead. For the first store, start with full dmask on a typed 2D UAV, unique per-thread destinations, and sentinels outside the written area. Keep sparse masks refused unless the unwritten components and cross-lane behavior are proven. Keep image_load_mip on a separate read-only texture, with different mip contents and a wrong-mip control. These can land independently. Leave same-descriptor reads and writes and atomics outside this slice.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T16:20:50Z.
Next slice, AI-assisted (Codex, driven with Claude Code), with Windows 10 22H2, a GTX 1060 and WARP. #1611 and #1649 covered the image stores.
Slice: gfx1013
buffer_atomic_add,buffer_atomic_umaxandbuffer_atomic_cmpswapon a raw UAV, lowered toRWByteAddressBuffer.Interlocked*:off). This slice adds per-thread addresses throughoffenandidxen.glc, the old value is returned to the data VGPR and stored to a separate record.Fixture: a source-built gfx1013 program on WARP and hardware.
Negative controls:
_x2, an atomic on a source SRV, and a missingvmcntwait before aglcresult is used;Not in this slice: image atomics, float atomics, 64-bit atomics, and
inc,decandcsubon gfx1013.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T16:41:32Z.
This bounded raw-buffer atomics slice can proceed independently of the wider image work. For shared-address add, check the final word and the multiset of old values. For umax and compare-and-swap, use independent cases with deterministic addresses or an order-independent oracle, since their intermediate old values depend on ordering. Keep the guard words and missing-wait refusal.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T22:45:14Z.
Status of our slices of this issue:
image_store(full dmask) andimage_load_mipon a separate read-only textureimage_store(full dmask)a9fb1792buffer_atomic_add,umaxandcmpswapon a raw UAV5de96be9#1684 follows your conditions above:
umaxandcmpswap: each uses deterministic per-thread addresses.Still open in this issue, with nothing claimed by us:
dmaskandd16stores;image_atomic_umax, which needs anR32_UINTview;_x2) forms, which #1684 refuses on gfx1013.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T22:51:35Z.
Taking the next slice: gfx1013 image atomics. AI-assisted (Claude Code), tested on Windows 10 22H2 with a GTX 1060 and WARP. Now in #2013.
Slice: gfx1013
image_atomic_add,image_atomic_umaxandimage_atomic_cmpswapon a 2DR32_UINTUAV, lowered toInterlockedAdd,InterlockedMaxandInterlockedCompareStoreonRWTexture2D<uint>.glcwould return the old value). The shared lowering refusesglc, so these forms return nothing; the returning forms stay open. As a result, the fixtures check the final words, not a multiset of old values.umaxandcmpswap, plus a contended add with two lanes per texel;Overlap: none of the open PRs touching
tools/compute_store_aot.py(#1683, #1684 and the ALU slices) lowers image atomics. #1684 also touches the gfx1013 rules on different lines; I'll rebase onto whichever lands first.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T23:18:37Z.
Next slice: gfx1013 1D images. AI-assisted (Codex, driven with Claude Code), tested on Windows 10 22H2 with a GTX 1060 and WARP.
Slice:
dmaskimage_store ... dim:SQ_RSRC_IMG_1Dinto anRGBA32_FLOATRWTexture1D<float4>.image_load_mip ... dim:SQ_RSRC_IMG_1Dfrom a separate read-onlyTexture1D<float4>. The mip is the second address word.It follows the rules of #1611 and #1649:
Sparse
dmask,d16,a16, 1D arrays, same-descriptor reads and atomics stay refused.Dependency: this builds on #1649's image-dimension option (
--image-uav-dimension), so it will be stacked on that branch. I'll open it after #1649 merges, or as a stacked PR that names #1649.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T23:44:45Z.
Next slice: gfx1013
d16image stores. AI-assisted (Codex, driven with Claude Code), tested on Windows 10 22H2 with a GTX 1060 and WARP.Slice:
dmaskimage_store ... dmask:0xf dim:SQ_RSRC_IMG_2D d16into a 2DR16G16B16A16_FLOATUAV.v[n]holds x in its low half and y in its high half;v[n+1]holds z and w the same way.f16tof32, and the typed UAV narrows it back. The fixtures use finite binary16 values (normal, subnormal and signed zero) so that round trip is exact; NaN payloads are not claimed.Same rules as #1611: unique per-thread destinations, and sentinels outside the written texels and in the other mips. One control swaps the two halves of a VGPR and must mismatch. Sparse
dmaskstays refused, per your earlier condition, and so dod16loads,a16, other formats, non-2D views and atomics.New branch from main. It touches the same gfx1013 image rules in
tools/compute_store_aot.pyas #1649, #2013 and #2056, so I'll rebase onto whichever lands first.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-25T00:27:29Z.
Next slice: gfx1013 same-descriptor image loads through the UAV, the "a load from the same descriptor goes through the UAV (typed UAV load)" item of the proposal. AI-assisted (Codex, driven with Claude Code), tested on Windows 10 22H2 with a GTX 1060 and WARP.
Slice: on a 2D
R32G32B32A32_FLOATUAV, a full-dmaskimage_load(mip zero) from the store's own descriptor becomesoutputData[uint2(x, y)], a typed UAV load.Bounds, to keep it within what one lane can prove:
TypedUAVLoadAdditionalFormats).Fixture: each lane reads its texel, changes it and writes it back. Sentinels outside the written texels and in other mips must stay unchanged. One control reads a neighbouring texel and must be refused; another drops the read and must mismatch.
Sparse masks,
d16loads, mips other than zero, arrays and 3D stay refused.New branch from main. It touches the same gfx1013 image rules as #1649, #2056 and #2106, and I'll rebase onto whichever lands first.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T00:56:43Z.
The full-mask 2D D16 store slice is on main via #2106 (
84ce2942). I rebuilt the exact PR head and ran the Release fixture on WARP and RTX 4060 Laptop: 2/2, including the packed-half and untouched-mip controls. The typed-store coverage is for finite half inputs; the separate same-descriptor typed-load work can continue here.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T06:14:29Z.
The source-built gfx1030 replay in #2756 is on main (
c458bba9). It adds fixed-address finite-normal buffer compare-swap and the 64-bit compare-swap and min/max forms. WARP and RTX 4060 Laptop both matched the readbacks and detected all four mutations. It uses constant operands and a raw UAV. The independent typed-UAV load and production binding work in this tracker remain open.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T00:28:21Z.
Taking the next slice for direct C++ compute (target
main): non-D16image_storewith a prefixdmask(0x1,0x3or0x7) when the bound UAV format has exactly that many channels.Why. In the 882 untranslated requests ranked in #3224, 48 of the 54 programs that stop first at "direct image opcode or descriptor modifiers" do so on a non-D16 prefix-mask
image_store. The shapes aredmask:0x7(2D, 3D and 2D array),0x3and0x1(2D), all withunorm.Plan. This follows your note above: sparse masks stay refused unless the unwritten components and the cross-lane behaviour are proven.
float,float2orfloat3with every component written, as the D16 path already does for masks 1 and 3.R*,RG*andR11G11B10_FLOAT. That way there is no unwritten channel and no read-modify-write, so there is no race between invocations.0x7store keeps a named refusal.0x2,0x9,0xd) stay refused.0x7, and for a non-prefix mask.I do not know yet which formats the title binds to these stores, so the effect on the run is unknown until it is measured at run time.
AI-assisted.