compute: lower 2D a16 image_store with 32-bit data in direct compute #3372

Merged
Leyukaka merged 1 commit from upstream-pr/3372 into main 2026-11-29 08:35:03 +00:00
Leyukaka commented 2026-11-28 15:24:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T15:24:41Z.


Refs #3224.

Change

The direct compute path refused a16 image stores unless the data was d16 (store && !half in image_io). A16 selects 16-bit addresses independently of the data width (RDNA 2 ISA, MIMG A16). A 2D store with 32-bit data now uses the same packed coordinates as an a16 load: x is the low half and y the high half of the first address VGPR. Graphics stages keep the refusal for 32-bit data.

Test

tests/native_image_store_a16_check.py (new):

  • native_image_store_a16_controls: one textureStore.f32 whose coordinates are and ..., 65535 and lshr ..., 16 of the same value. An a16 image_load_mip and an a16 3D image_store still refuse with packed image addressing.
  • native_image_store_a16_hardware / _warp: a 32-lane source-built program with EXEC 0x55555555, read back from an RGBA32_FLOAT texture (1,344 words).

ctest --test-dir out/build/release -R native_image_store_a16, Windows 11 build 26300, RTX 5080 driver 32.0.16.2101 (debug layer unavailable):

main f5a6f6ba this branch
_controls fails (packed image addressing) passes
_hardware fails 1,344 words matched
_warp skip 77 (wave32 fixture) skip 77

Swapping x and y in the unpacking fails both _controls and _hardware.

Broad selection (ctest -R "native_|startup_compute|compile_dxil|salu"): 560/566. The same 6 tests fail on main f5a6f6ba.

Measurement

On the 873 compute requests of the run in my #3224 census, 3 shaders (1,017 dispatches) move from packed image addressing to compiled, and none is lost. One publishes a runtime manifest; two stop at SRV kind typed_buffer_srv.

Not covered: write masks other than 15; a16 stores with LOD, on 1D, 3D or array images, or in graphics stages (the graphics refusal is not tested).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5541683091 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T15:24:41Z. --- Refs #3224. ## Change The direct compute path refused `a16` image stores unless the data was `d16` (`store && !half` in `image_io`). A16 selects 16-bit addresses independently of the data width (RDNA 2 ISA, MIMG `A16`). A 2D store with 32-bit data now uses the same packed coordinates as an a16 load: x is the low half and y the high half of the first address VGPR. Graphics stages keep the refusal for 32-bit data. ## Test `tests/native_image_store_a16_check.py` (new): - `native_image_store_a16_controls`: one `textureStore.f32` whose coordinates are `and ..., 65535` and `lshr ..., 16` of the same value. An a16 `image_load_mip` and an a16 3D `image_store` still refuse with `packed image addressing`. - `native_image_store_a16_hardware` / `_warp`: a 32-lane source-built program with EXEC `0x55555555`, read back from an RGBA32_FLOAT texture (1,344 words). `ctest --test-dir out/build/release -R native_image_store_a16`, Windows 11 build 26300, RTX 5080 driver 32.0.16.2101 (debug layer unavailable): | | `main` `f5a6f6ba` | this branch | |---|---|---| | `_controls` | fails (`packed image addressing`) | passes | | `_hardware` | fails | 1,344 words matched | | `_warp` | skip 77 (wave32 fixture) | skip 77 | Swapping x and y in the unpacking fails both `_controls` and `_hardware`. Broad selection (`ctest -R "native_|startup_compute|compile_dxil|salu"`): 560/566. The same 6 tests fail on `main` `f5a6f6ba`. ## Measurement On the 873 compute requests of the run in my #3224 census, 3 shaders (1,017 dispatches) move from `packed image addressing` to compiled, and none is lost. One publishes a runtime manifest; two stop at `SRV kind typed_buffer_srv`. Not covered: write masks other than 15; a16 stores with LOD, on 1D, 3D or array images, or in graphics stages (the graphics refusal is not tested).
KelboLive commented 2026-11-28 20:46:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:46:27Z.

Review: APPROVED


LGTM — clean A16 image_store lowering for the direct compute path.

Changes the A16 guard from graphics_input && store && !half to graphics_input && store && !half (relaxed to allow compute-only A16 stores), with a clear ISA comment. The test fixture verifies coordinate packing, both refusal diagnostics, and hardware readback of RGBA32 texture words.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100016997 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100016997). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T20:46:27Z. **Review:** APPROVED --- LGTM — clean A16 image_store lowering for the direct compute path. Changes the A16 guard from `graphics_input && store && !half` to `graphics_input && store && !half` (relaxed to allow compute-only A16 stores), with a clear ISA comment. The test fixture verifies coordinate packing, both refusal diagnostics, and hardware readback of RGBA32 texture words. Ready to land.
KelboLive commented 2026-11-28 21:09:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:09:29Z.

Review: APPROVED


LGTM — clean fix with thorough tests.

Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100097634 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100097634). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:09:29Z. **Review:** APPROVED --- LGTM — clean fix with thorough tests. Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics. Ready to land.
KelboLive commented 2026-11-28 21:57:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:57:56Z.

Review: APPROVED


LGTM — clean fix with thorough tests.

Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100255612 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372#pullrequestreview-6100255612). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:57:56Z. **Review:** APPROVED --- LGTM — clean fix with thorough tests. Adds graphics_input guard to the A16 image addressing refusal so graphics input A16 stores are properly rejected. Test fixture covers packed coordinate extraction, valid RGBA32 store, and both refusal diagnostics. Ready to land.
R0Y00 commented 2026-12-02 17:24:26 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T17:24:26Z.


Thanks, Leyukaka. This is in main now. The RTX 5080 readback matched all 1,344 words, and the swapped-coordinate control caught the X/Y regression. WARP reported a wave32 capability skip. The two shaders that still stop at SRV kind typed_buffer_srv are a separate follow-up under #3224.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7353272219 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372#issuecomment-7353272219). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T17:24:26Z. --- Thanks, Leyukaka. This is in `main` now. The RTX 5080 readback matched all 1,344 words, and the swapped-coordinate control caught the X/Y regression. WARP reported a wave32 capability skip. The two shaders that still stop at `SRV kind typed_buffer_srv` are a separate follow-up under #3224.
R0Y00 commented 2026-12-03 06:19:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T06:19:23Z.


One follow-up on the two shaders that compiled after this change but stopped at SRV kind typed_buffer_srv: #3386 added published typed-buffer SRV bindings for 32-bit components, and #3460 added the corresponding in-process binding used by the default launch path. Those changes were verified with source-built fixtures. The remaining check under #3224 is to rerun the same two requests on current main and record whether each reaches a translated dispatch or hits another refusal.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7369705816 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3372#issuecomment-7369705816). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-03T06:19:23Z. --- One follow-up on the two shaders that compiled after this change but stopped at `SRV kind typed_buffer_srv`: #3386 added published typed-buffer SRV bindings for 32-bit components, and #3460 added the corresponding in-process binding used by the default launch path. Those changes were verified with source-built fixtures. The remaining check under #3224 is to rerun the same two requests on current `main` and record whether each reaches a translated dispatch or hits another refusal.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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!3372
No description provided.