shader: lower image_store on SQ_RSRC_IMG_2D_ARRAY in gfx2hlsl #2736

Merged
triggered02 merged 5 commits from upstream-pr/2744 into main 2026-11-26 07:53:28 +00:00
triggered02 commented 2026-11-26 05:23:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T05:23:25Z.


Lowers the plain image_store form on dim:SQ_RSRC_IMG_2D_ARRAY, which adds the full-mask FP32 compute translation. Refs #2742.

What changed

  • tools/startup/gfx2hlsl.py: op_image_store accepts SQ_RSRC_IMG_2D_ARRAY — three address registers (x, y, layer), uav(key, 'tex2da'), uint3 index — and the stored-image declaration map gains RWTexture2DArray<float4>. The compute manifest kind follows the UAV kind (tex2da for arrays, unchanged tex2d for 2D). Every existing restriction is untouched: dmask:0xf only, four data VGPRs (packed D16 array stores stay refused), integer coordinates, the EXEC guard, fixed_table_image for compute and the existing 2D pixel path. 1D/3D/CUBE keep the verbatim refusal.
  • Emitted for arrays: w0[uint3(v8, v9, v10)] = asfloat(uint4(v14, v15, v16, v17)); with RWTexture2DArray<float4> w0 : register(u0); and manifest uav 0 tex2da float table 1 64 channels 4. 2D output is byte-identical to before (w0[uint2(v8, v9)], RWTexture2D, uav 0 tex2d).
  • Fixtures: tests/startup_compute_image_store_check.py gains the array case — layer 1 (middle of a 4-layer, 3-mip array) and layer 3 (last), 16 texels × 4 words per layer with pinned values, verified against a 5,376-word sentinel-prefilled reference (first changed index 1344 / 4032, last 1503 / 4191, remaining 5,312 words untouched), plus refusals for 2-register and 4-register array addresses and for 1D/3D/CUBE. Dispatch cases are wired into the existing startup_compute_image_store_* test (selector 1<<31): layer 1 and 3 → 0 mismatches; omission → 64; one-layer-off → 128.
  • tests/startup_pixel_image_store_check.py: keeps the original pixel-stage array refusal and all 2D controls.
  • docs/experiments.md: one paragraph next to the existing image-store notes.

Verified on 38dec200 (parent fd033046)

startup_compute_image_store_check.py     0
startup_pixel_image_store_check.py       0
startup_image_2d_array_check.py          0
startup_translator_check.py              0
form_coverage_check.py                   0
docs_links_check.py                      0
startup_gfx2hlsl_refusals_check.py       0
git diff --check                         0

Fail-first mutants (temporary, reverted): 2 address registers for arrays → Unsupported: image_store with 3 address registers: x, y and layer expected; uint2 index with the slice dropped → AssertionError on the emitted-HLSL pin; dim guard widened to accept 1D/3D/CUBE → existing 3D control and the new 1D/3D/CUBE loop both fail.

NOT established

  • Array bounds/clamping: the translator does not clamp; D3D drops out-of-view writes and console behaviour is unmeasured.
  • The runtime view type/binding for a 2D-array UAV: the manifest now says tex2da, but the shipped runtime parser still accepts only uav … tex2d float table … channels 4 and pixel binding rejects arrays — this PR is translation-only.
  • Partial-dmask arrays (still refused, no fixture), compute d16 array stores (shared path, no fixture), and the GPU dispatch/reassembly cases — those dispatch cases are wired but were not executed locally (no DXC/offscreen_check/llvm-mc in that environment; the test's existing capability-skip convention applies).

Refs #2742. Refs #1545. No game data; synthetic ISA bytes and source-built fixtures only.

AI-assisted.

Maintainer retest at 7e5433a8

This is the standalone full-mask compute FP32 array emission slice. The startup runtime still needs the array UAV consumer in #2742. Packed D16 and pixel-stage array stores remain refused. Windows Release on WARP and RTX 4060 Laptop passed all 12 compute image-store, packed D16, pixel store and 2D-array CTests, zero skips. Both array cases compare 5,376 words. The omitted-store and wrong-layer controls fail at 64 and 128 words on each adapter. Windows 11 build 26200, debug layer enabled.

cmake --build --preset release --target offscreen_check
ctest --preset release --no-tests=error -j 1 -R "^(startup_compute_image_store(_d16)?(_warp|_hardware)?|startup_pixel_image_store_(controls|warp|hardware)|startup_image_2d_array_(controls|warp|hardware))$" -V
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6620131140 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T05:23:25Z. --- Lowers the plain `image_store` form on `dim:SQ_RSRC_IMG_2D_ARRAY`, which adds the full-mask FP32 compute translation. Refs #2742. ### What changed - **`tools/startup/gfx2hlsl.py`**: `op_image_store` accepts `SQ_RSRC_IMG_2D_ARRAY` — three address registers (x, y, layer), `uav(key, 'tex2da')`, `uint3` index — and the stored-image declaration map gains `RWTexture2DArray<float4>`. The compute manifest kind follows the UAV kind (`tex2da` for arrays, unchanged `tex2d` for 2D). Every existing restriction is untouched: `dmask:0xf` only, four data VGPRs (packed D16 array stores stay refused), integer coordinates, the EXEC guard, `fixed_table_image` for compute and the existing 2D pixel path. 1D/3D/CUBE keep the verbatim refusal. - Emitted for arrays: `w0[uint3(v8, v9, v10)] = asfloat(uint4(v14, v15, v16, v17));` with `RWTexture2DArray<float4> w0 : register(u0);` and manifest `uav 0 tex2da float table 1 64 channels 4`. 2D output is byte-identical to before (`w0[uint2(v8, v9)]`, `RWTexture2D`, `uav 0 tex2d`). - **Fixtures**: `tests/startup_compute_image_store_check.py` gains the array case — layer 1 (middle of a 4-layer, 3-mip array) and layer 3 (last), 16 texels × 4 words per layer with pinned values, verified against a 5,376-word sentinel-prefilled reference (first changed index 1344 / 4032, last 1503 / 4191, remaining 5,312 words untouched), plus refusals for 2-register and 4-register array addresses and for 1D/3D/CUBE. Dispatch cases are wired into the existing `startup_compute_image_store_*` test (selector `1<<31`): layer 1 and 3 → 0 mismatches; omission → 64; one-layer-off → 128. - `tests/startup_pixel_image_store_check.py`: keeps the original pixel-stage array refusal and all 2D controls. - `docs/experiments.md`: one paragraph next to the existing image-store notes. ### Verified on `38dec200` (parent `fd033046`) ``` startup_compute_image_store_check.py 0 startup_pixel_image_store_check.py 0 startup_image_2d_array_check.py 0 startup_translator_check.py 0 form_coverage_check.py 0 docs_links_check.py 0 startup_gfx2hlsl_refusals_check.py 0 git diff --check 0 ``` **Fail-first mutants** (temporary, reverted): 2 address registers for arrays → `Unsupported: image_store with 3 address registers: x, y and layer expected`; `uint2` index with the slice dropped → `AssertionError` on the emitted-HLSL pin; dim guard widened to accept 1D/3D/CUBE → existing 3D control and the new 1D/3D/CUBE loop both fail. ### NOT established - Array bounds/clamping: the translator does not clamp; D3D drops out-of-view writes and console behaviour is unmeasured. - The runtime view type/binding for a 2D-array UAV: the manifest now says `tex2da`, but the shipped runtime parser still accepts only `uav … tex2d float table … channels 4` and pixel binding rejects arrays — this PR is translation-only. - Partial-dmask arrays (still refused, no fixture), compute `d16` array stores (shared path, no fixture), and the GPU dispatch/reassembly cases — those dispatch cases are wired but were not executed locally (no DXC/`offscreen_check`/`llvm-mc` in that environment; the test's existing capability-skip convention applies). Refs #2742. Refs #1545. No game data; synthetic ISA bytes and source-built fixtures only. AI-assisted. ## Maintainer retest at 7e5433a8 This is the standalone full-mask compute FP32 array emission slice. The startup runtime still needs the array UAV consumer in #2742. Packed D16 and pixel-stage array stores remain refused. Windows Release on WARP and RTX 4060 Laptop passed all 12 compute image-store, packed D16, pixel store and 2D-array CTests, zero skips. Both array cases compare 5,376 words. The omitted-store and wrong-layer controls fail at 64 and 128 words on each adapter. Windows 11 build 26200, debug layer enabled. ```powershell cmake --build --preset release --target offscreen_check ctest --preset release --no-tests=error -j 1 -R "^(startup_compute_image_store(_d16)?(_warp|_hardware)?|startup_pixel_image_store_(controls|warp|hardware)|startup_image_2d_array_(controls|warp|hardware))$" -V ```
chatgpt-codex-connector[bot commented 2026-11-26 06:02:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T05:27:57Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38dec200fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068982239 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#pullrequestreview-6068982239). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T05:27:57Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `38dec200fa` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-26 06:02:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:28:02Z.

Review: COMMENTED


Review of head e7fafe57 (the PR's own diff is unchanged by the main merge; first read at 38dec200).

Checked:

  • op_image_store now accepts SQ_RSRC_IMG_2D_ARRAY, requires 3 address registers (x, y, layer), binds the view as tex2da and emits RWTexture2DArray<float4> plus uint3 indexing. The manifest line now carries the resource kind (uav N tex2da float ... channels 4). Sibling declaration table and manifest writer are both extended; the pixel path shares the same code.
  • Tests: the compute check adds an assembled 2D-array program (layers 1 and 3), HLSL and manifest assertions, and a full reference of the 4-layer, 3-mip array. Only mip 0 of the target layer may change, every other word keeps its sentinel. The pixel check gets the matching extension. The D3D12 readback side lives in the existing compute_check fixture path.
  • Mutations (each made the compute check fail, then reverted): forcing array = False; binding tex2d instead of tex2da.
  • No other open or merged PR covers the 2D-array store (#1649 and #2155 cover the other forms).

Commands run locally:

  • python3 tests/startup_compute_image_store_check.py and tests/startup_pixel_image_store_check.py: pass
  • python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD: pass
  • remote_pycheck.sh --compare origin/main: no failures caused by this PR (the two differing scripts exist only on newer main)

No blocking findings. Windows WARP receipt follows separately.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6068982769 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#pullrequestreview-6068982769). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:28:02Z. **Review:** COMMENTED --- Review of head e7fafe57 (the PR's own diff is unchanged by the main merge; first read at 38dec200). Checked: - `op_image_store` now accepts `SQ_RSRC_IMG_2D_ARRAY`, requires 3 address registers (x, y, layer), binds the view as `tex2da` and emits `RWTexture2DArray<float4>` plus `uint3` indexing. The manifest line now carries the resource kind (`uav N tex2da float ... channels 4`). Sibling declaration table and manifest writer are both extended; the pixel path shares the same code. - Tests: the compute check adds an assembled 2D-array program (layers 1 and 3), HLSL and manifest assertions, and a full reference of the 4-layer, 3-mip array. Only mip 0 of the target layer may change, every other word keeps its sentinel. The pixel check gets the matching extension. The D3D12 readback side lives in the existing `compute_check` fixture path. - Mutations (each made the compute check fail, then reverted): forcing `array = False`; binding `tex2d` instead of `tex2da`. - No other open or merged PR covers the 2D-array store (#1649 and #2155 cover the other forms). Commands run locally: - `python3 tests/startup_compute_image_store_check.py` and `tests/startup_pixel_image_store_check.py`: pass - `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD`: pass - `remote_pycheck.sh --compare origin/main`: no failures caused by this PR (the two differing scripts exist only on newer main) No blocking findings. Windows WARP receipt follows separately. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-26 06:02:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:32:22Z.

Review: COMMENTED


Correction to my earlier review of e7fafe57: CI is red on this head, so this PR is not ready to merge.

Failing job: "Assemble and translate gfx1013 fixtures" (run 45761748737).

  • tests/startup_compute_image_store_check.py --llvm-mc llvm-mc-15 stops at line 99 with AssertionError: 1:
    assemble(llvm_mc, ARRAY_SOURCE.format(layer=layer)) == array_program(layer) is false for layer 1.
  • So at least one hand-written word in ARRAY_PROLOGUE, ARRAY_SLICE, ARRAY_DATA, ARRAY_STORE or ARRAY_END differs from what LLVM 15 encodes for the matching line in ARRAY_SOURCE. My Linux run did not catch it because it has no llvm-mc, so that comparison was skipped; the earlier "pass" for this check only covered the translator side.
  • Likely suspects: the image_store word pair (280f20f0080e0600) and the two v_lshl_add_u32 words. Please diff the llvm-mc-15 output against each constant, word by word.

Left for the author: fix the bytes, push, and the Windows receipt above stays valid only if the translator is unchanged. Not merging.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6069016829 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#pullrequestreview-6069016829). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:32:22Z. **Review:** COMMENTED --- Correction to my earlier review of e7fafe57: CI is red on this head, so this PR is not ready to merge. Failing job: "Assemble and translate gfx1013 fixtures" (run 45761748737). - `tests/startup_compute_image_store_check.py --llvm-mc llvm-mc-15` stops at line 99 with `AssertionError: 1`: `assemble(llvm_mc, ARRAY_SOURCE.format(layer=layer)) == array_program(layer)` is false for layer 1. - So at least one hand-written word in `ARRAY_PROLOGUE`, `ARRAY_SLICE`, `ARRAY_DATA`, `ARRAY_STORE` or `ARRAY_END` differs from what LLVM 15 encodes for the matching line in `ARRAY_SOURCE`. My Linux run did not catch it because it has no llvm-mc, so that comparison was skipped; the earlier "pass" for this check only covered the translator side. - Likely suspects: the `image_store` word pair (`280f20f0080e0600`) and the two `v_lshl_add_u32` words. Please diff the llvm-mc-15 output against each constant, word by word. Left for the author: fix the bytes, push, and the Windows receipt above stays valid only if the translator is unchanged. Not merging. AI-assisted; commands listed were executed locally.
chatgpt-codex-connector[bot commented 2026-11-26 06:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T05:23:35Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T05:27:59.668551Z 38dec20 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183444462 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#issuecomment-7183444462). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T05:23:35Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"38dec200fac1b62eaa2557f92473908f8b2c55f5","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T05:27:59.668551Z">2026-11-26T05:27:59.668551Z</relative-time> | `38dec20` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
tedin7 commented 2026-11-26 06:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T05:28:26Z.


Win2025 WARP receipt for head e7fafe57 after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit e7fafe571c22f638a2264ff5d22ff9efc946d5bd:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 5.19s (configure 2.42s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2): 1.45s (configure 2.56s)
  • Windows Python checks: tests/startup_compute_image_store_check.py ok (0.8s), tests/startup_pixel_image_store_check.py ok (0.2s)
  • sccache: 3/5 hits; wall 21.4s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183516587 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#issuecomment-7183516587). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T05:28:26Z. --- Win2025 WARP receipt for head e7fafe57 after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `e7fafe571c22f638a2264ff5d22ff9efc946d5bd`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `5.19s` (configure `2.42s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_buffer_format_word3_check -- -j 2`): `1.45s` (configure `2.56s`) - **Windows Python checks**: `tests/startup_compute_image_store_check.py` ok (`0.8s`), `tests/startup_pixel_image_store_check.py` ok (`0.2s`) - `sccache`: 3/5 hits; wall `21.4s` AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-26 06:02:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T05:41:01Z.


In addition to the LLVM 15 byte mismatch already in review, please keep #2742 open while the emitted array manifest has no startup runtime consumer. For a narrow translator-only PR, use Refs #2742, retain the pixel and packed-half array refusals, and keep emission checks distinct from runtime acceptance. If you want this PR to finish the FP32 compute path, please add the corresponding production manifest/view binding and use that path for the readback. The fixture should bind a nonzero FirstArraySlice, check adjacent untouched slices, and catch a wrong-layer or dropped-EXEC mutation. The standalone offscreen UAV option alone does not validate startup binding.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183709825 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#issuecomment-7183709825). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T05:41:01Z. --- In addition to the LLVM 15 byte mismatch already in review, please keep #2742 open while the emitted array manifest has no startup runtime consumer. For a narrow translator-only PR, use Refs #2742, retain the pixel and packed-half array refusals, and keep emission checks distinct from runtime acceptance. If you want this PR to finish the FP32 compute path, please add the corresponding production manifest/view binding and use that path for the readback. The fixture should bind a nonzero FirstArraySlice, check adjacent untouched slices, and catch a wrong-layer or dropped-EXEC mutation. The standalone offscreen UAV option alone does not validate startup binding.
triggered02 commented 2026-11-26 06:02:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T05:48:25Z.


Fixed in 42637b0a (test: fix the 2D-array image_store fixture words for llvm-mc-15), on top of 38dec200 — fast-forward, the translator is unchanged so your WARP receipt still applies.

You were right that the check fails at line 99, but the failing words were not image_store or the v_lshl_add pair — both are verbatim LLVM-15 words (the image_store pair 280f20f0 080e0600 is byte-identical to compute_mimg_float_store_layers_check.ARRAY_WORDS, whose source line is the same MIMG store). The mismatch was the v14 data literal:

line old new
v_mov_b32_e32 v14, … ff021c7e 00000040 (0x40000000) ff021c7e 0000403f (0x3f400000)
v_mov_b32_e32 v15, … ff021e7e 00004040 (0x40400000) ff021e7e 0000803e (0x3e800000)

Root cause: 0x40000000 is one of LLVM's inline float constants (2.0, in INLINE_FLOAT_LITERALS), so llvm-mc-15 assembles v_mov_b32_e32 v14, 0x40000000 as the 4-byte inline form 0x7e1c02f4 rather than the 8-byte literal I had written. Assembled length 80 ≠ the fixture's 84, so the equality failed. The pure-Python decoder prints the same text for both encodings, which is why the local run never saw it. 0x40400000 (3.0) is not inline, but v15 was moved to another directly-CI-proof literal spelling (0x3e800000 = 0.25) so both data moves are covered by fixtures that already run llvm-mc-15 in CI.

Evidence behind the new bytes (no llvm-mc on this host, so this is derivation from CI-pinned fixtures plus a disassembler cross-check):

  • prologue + wait are byte-identical to the prefix of compute_mimg_image_uav_load_check.WORDS ("Little-endian instruction words from LLVM 15.0.7");
  • 8102147e (v10,1) is verbatim from compute_mimg_float_store_check.WORDS; 8302147e (v10,3) uses the same VOP1 inline-integer field;
  • v14/v15 come from startup_image_2d_array_check.SAMPLE_WORDS (that test assembles with llvm-mc-15 in CI), changing only the VOP1 vdst bits 24:17;
  • v16/v17 and s_endpgm are verbatim from the float-store fixture;
  • tools/disasm_rdna2.py decodes both array_program(1) and array_program(3) to 13 instructions whose text equals ARRAY_SOURCE line by line.

Also added a local guard: assert not set(ARRAY_VALUES) & set(G.D.INLINE_FLOAT_LITERALS) so a data word can never silently become an inline constant again without llvm-mc present. ARRAY_VALUES and the dispatch first-mismatch needles follow the new literals (counts unchanged: 64 omitted / 128 one-layer-off).

Not established locally: the real --llvm-mc llvm-mc-15 comparison (CI is the confirmation). If CI still fails, the one word not verbatim from an llvm-mc-pinned fixture is 8302147e (v10, 3) and that is where I would look next.

Checks on 42637b0a: startup_compute_image_store_check 0, startup_pixel_image_store_check 0, startup_image_2d_array_check 0, startup_translator_check 0, git diff --check 0.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7183822233 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#issuecomment-7183822233). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-26T05:48:25Z. --- Fixed in **`42637b0a`** (`test: fix the 2D-array image_store fixture words for llvm-mc-15`), on top of `38dec200` — fast-forward, the translator is unchanged so your WARP receipt still applies. You were right that the check fails at line 99, but the failing words were **not** `image_store` or the `v_lshl_add` pair — both are verbatim LLVM-15 words (the `image_store` pair `280f20f0 080e0600` is byte-identical to `compute_mimg_float_store_layers_check.ARRAY_WORDS`, whose source line is the same MIMG store). The mismatch was the `v14` data literal: | line | old | new | |---|---|---| | `v_mov_b32_e32 v14, …` | `ff021c7e 00000040` (`0x40000000`) | `ff021c7e 0000403f` (`0x3f400000`) | | `v_mov_b32_e32 v15, …` | `ff021e7e 00004040` (`0x40400000`) | `ff021e7e 0000803e` (`0x3e800000`) | Root cause: **`0x40000000` is one of LLVM's inline float constants** (`2.0`, in `INLINE_FLOAT_LITERALS`), so llvm-mc-15 assembles `v_mov_b32_e32 v14, 0x40000000` as the **4-byte inline form** `0x7e1c02f4` rather than the 8-byte literal I had written. Assembled length 80 ≠ the fixture's 84, so the equality failed. The pure-Python decoder prints the same text for both encodings, which is why the local run never saw it. `0x40400000` (3.0) is not inline, but v15 was moved to another directly-CI-proof literal spelling (`0x3e800000` = 0.25) so both data moves are covered by fixtures that already run `llvm-mc-15` in CI. Evidence behind the new bytes (no `llvm-mc` on this host, so this is derivation from CI-pinned fixtures plus a disassembler cross-check): - prologue + wait are byte-identical to the prefix of `compute_mimg_image_uav_load_check.WORDS` ("Little-endian instruction words from LLVM 15.0.7"); - `8102147e` (v10,1) is verbatim from `compute_mimg_float_store_check.WORDS`; `8302147e` (v10,3) uses the same VOP1 inline-integer field; - v14/v15 come from `startup_image_2d_array_check.SAMPLE_WORDS` (that test assembles with `llvm-mc-15` in CI), changing only the VOP1 vdst bits 24:17; - v16/v17 and `s_endpgm` are verbatim from the float-store fixture; - `tools/disasm_rdna2.py` decodes both `array_program(1)` and `array_program(3)` to 13 instructions whose text equals `ARRAY_SOURCE` line by line. Also added a local guard: `assert not set(ARRAY_VALUES) & set(G.D.INLINE_FLOAT_LITERALS)` so a data word can never silently become an inline constant again without llvm-mc present. `ARRAY_VALUES` and the dispatch first-mismatch needles follow the new literals (counts unchanged: 64 omitted / 128 one-layer-off). **Not established locally:** the real `--llvm-mc llvm-mc-15` comparison (CI is the confirmation). If CI still fails, the one word not verbatim from an llvm-mc-pinned fixture is `8302147e` (`v10, 3`) and that is where I would look next. Checks on `42637b0a`: `startup_compute_image_store_check` 0, `startup_pixel_image_store_check` 0, `startup_image_2d_array_check` 0, `startup_translator_check` 0, `git diff --check` 0.
chatgpt-codex-connector[bot commented 2026-11-26 06:02:09 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-26T05:27:57Z.

Code review location: tools/startup/gfx2hlsl.py; line 6257

@@ -6305,8 +6254,10 @@ def op_image_store(self, ops, mods):
         masks = [m[6:] for m in mods if m.startswith('dmask:')]
         if len(dims) != 1 or len(masks) != 1:
             raise Unsupported('%s without exactly one dim and dmask' % name)
-        if dims[0] != 'SQ_RSRC_IMG_2D':
+        if dims[0] not in ('SQ_RSRC_IMG_2D', 'SQ_RSRC_IMG_2D_ARRAY'):

P2 Badge Keep D16 array stores out of this accepted dimension set

For a compute shader using image_store d16 with dim:SQ_RSRC_IMG_2D_ARRAY, this broadened guard admits the instruction and the existing D16 path emits a packed two-VGPR conversion as a tex2da store. The repo's gfx1013 store profile rejects D16 on non-2D dimensions (tools/compute_store_aot.py:2863-65; tests/compute_mimg_float_store_d16_check.py:54-57), so this path reports success for a form the project treats as unsupported; keep this combination refused unless it is separately validated.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4704242637 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#discussion_r4704242637). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-26T05:27:57Z. **Code review location:** `tools/startup/gfx2hlsl.py`; line 6257 ~~~~diff @@ -6305,8 +6254,10 @@ def op_image_store(self, ops, mods): masks = [m[6:] for m in mods if m.startswith('dmask:')] if len(dims) != 1 or len(masks) != 1: raise Unsupported('%s without exactly one dim and dmask' % name) - if dims[0] != 'SQ_RSRC_IMG_2D': + if dims[0] not in ('SQ_RSRC_IMG_2D', 'SQ_RSRC_IMG_2D_ARRAY'): ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Keep D16 array stores out of this accepted dimension set** For a compute shader using `image_store d16` with `dim:SQ_RSRC_IMG_2D_ARRAY`, this broadened guard admits the instruction and the existing D16 path emits a packed two-VGPR conversion as a `tex2da` store. The repo's gfx1013 store profile rejects D16 on non-2D dimensions (`tools/compute_store_aot.py:2863-65`; `tests/compute_mimg_float_store_d16_check.py:54-57`), so this path reports success for a form the project treats as unsupported; keep this combination refused unless it is separately validated. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
upstream-sync closed this pull request 2026-11-26 08:01:46 +00:00
R0Y00 commented 2026-11-26 08:01:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T07:49:47Z.

Review: APPROVED


The enabled form is the full-mask compute FP32 array translator and manifest only. The previously accepted packed D16 array case now refuses before emission, and the original pixel array refusal is restored. All 12 independent Release image store and adjacent CTests passed with no skips on WARP and RTX 4060 Laptop. Each array case matched 5,376 words; omission and wrong layer differed at 64 and 128 words respectively on each adapter. #2742 remains open for the production array binding.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6070262559 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#pullrequestreview-6070262559). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T07:49:47Z. **Review:** APPROVED --- The enabled form is the full-mask compute FP32 array translator and manifest only. The previously accepted packed D16 array case now refuses before emission, and the original pixel array refusal is restored. All 12 independent Release image store and adjacent CTests passed with no skips on WARP and RTX 4060 Laptop. Each array case matched 5,376 words; omission and wrong layer differed at 64 and 128 words respectively on each adapter. #2742 remains open for the production array binding.
xiaoqi72665 commented 2026-11-26 08:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by xiaoqi72665 on 2026-11-26T07:46:17Z.


Hi @triggered02 and @R0Y00 — thanks for the translator work and review guidance. I have a local, AI-assisted runtime follow-up based on c6f140c, reusing the existing FP32 array lowering rather than duplicating it. It consumes the tex2da compute manifest, preserves the caller's array UAV range, and exercises the production startup slot-67/slot-14 binding and fenced GPU readback. Pixel and packed-half array stores remain refused.

On Windows 10 build 19045 (DXC 1.8.2502.11), both WARP (10.0.19041.5794) and RX 7900 XT (32.0.32029.2010) passed: a six-slice RGBA32_FLOAT resource with FirstArraySlice=1, ArraySize=4, relative layers 1 and 3 (physical slices 2 and 4), full and partial EXEC, all 6,144 words compared with zero mismatches in each positive case. Wrong-layer and dropped-EXEC mutants produced the expected 128 and 32 mismatches; an incompatible 2D UAV was refused and its 1,024 words remained unchanged. The new CTests passed on both adapters. Debug layer was unavailable; LLVM 15 assembly verification and integration with current main are still pending. Two existing 2D denied-view reason assertions also failed on the unmodified PR head and the local follow-up; I am checking them against main.

Would you prefer that I provide the incremental patch for this PR, or open a separate dependent runtime PR after the translator changes land? I will preserve the original contribution and avoid a competing implementation. No game data; source-built fixtures only. AI-assisted; the GPU tests above were actually run locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7185816260 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2744#issuecomment-7185816260). Originally posted by [xiaoqi72665](https://github.com/xiaoqi72665) on 2026-11-26T07:46:17Z. --- Hi @triggered02 and @R0Y00 — thanks for the translator work and review guidance. I have a local, AI-assisted runtime follow-up based on c6f140c, reusing the existing FP32 array lowering rather than duplicating it. It consumes the tex2da compute manifest, preserves the caller's array UAV range, and exercises the production startup slot-67/slot-14 binding and fenced GPU readback. Pixel and packed-half array stores remain refused. On Windows 10 build 19045 (DXC 1.8.2502.11), both WARP (10.0.19041.5794) and RX 7900 XT (32.0.32029.2010) passed: a six-slice RGBA32_FLOAT resource with FirstArraySlice=1, ArraySize=4, relative layers 1 and 3 (physical slices 2 and 4), full and partial EXEC, all 6,144 words compared with zero mismatches in each positive case. Wrong-layer and dropped-EXEC mutants produced the expected 128 and 32 mismatches; an incompatible 2D UAV was refused and its 1,024 words remained unchanged. The new CTests passed on both adapters. Debug layer was unavailable; LLVM 15 assembly verification and integration with current main are still pending. Two existing 2D denied-view reason assertions also failed on the unmodified PR head and the local follow-up; I am checking them against main. Would you prefer that I provide the incremental patch for this PR, or open a separate dependent runtime PR after the translator changes land? I will preserve the original contribution and avoid a competing implementation. No game data; source-built fixtures only. AI-assisted; the GPU tests above were actually run locally.
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!2736
No description provided.