shader: expand packed D16 XY stores into FLOAT2 heap views #2353

Merged
RavenCurseBurg merged 1 commit from upstream-pr/2361 into main 2026-11-25 13:49:25 +00:00
RavenCurseBurg commented 2026-11-25 13:39:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T13:39:18Z.


Refs #2022 (item B). Extends the stand-alone compute translator after the four-component and scalar packed-half stores in #2230 and #2340.

buffer_store_format_d16_xy consumes one VGPR and requires an identity BUF_FMT_32_32_FLOAT descriptor (format 64). Its low and high halves become two binary32 words in X/Y order. Both words must fit in the stride and declared output extent. A stopped or out-of-range view leaves every guard intact. The compiler uses the decoded component count to select the HLSL helper. The changed CLI help lists the supported view widths.

Validation on Windows 11 build 26100.9711 with DXC 1.9.2609 and Agility SDK 1.620.2:

  • python -B tests/compute_heap_store_check.py draw <dxc> <offscreen_check> <warp|hardware> on WARP 10.0.26100.9711, RTX 4060 (32.0.15.9579) and Intel UHD 770 (32.0.101.5973). Each adapter passed 17 FLOAT2 dispatches comparing all 320 words, including negative zero, a binary16 subnormal, the final complete pair, a partial pair and wrong formats. Each rejected 11 compiled shader mutations. Swapped halves first failed at word 4 (3f800000 → 40400000), duplicated X at word 5 (40400000 → 3f800000), and the weakened extent at guard word 127 (c5c5c5c5 → 3f800000). The existing UINT4, FLOAT4 and FLOAT1 fixtures passed on all three. Local D3D12 debug layer unavailable.
  • python -B tests/compute_heap_store_check.py binary <llvm-mc> <llvm-objcopy> <libLLVM> passed for all four programs, using LLVM 15.0.7's Clang integrated assembler as the gfx1013 object writer, llvm-objcopy and LLVM-C. Each goes through disassembly, a source-built container and the public CLI. The native FLOAT2 fixture SHA-256 is a5562f3c4650969c26bee9cde075c8eb83251f7912fa03c030725d11006e0447.
  • python -B tests/compute_heap_store_check.py controls, python -B tests/compute_heap_view_check.py controls, the existing compute-store host controls, docs links, bidirectional controls and git diff --check passed.

Agent environment: Codex + GPT-6.2 Astra xhigh.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6605780983 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2361). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T13:39:18Z. --- Refs #2022 (item B). Extends the stand-alone compute translator after the four-component and scalar packed-half stores in #2230 and #2340. `buffer_store_format_d16_xy` consumes one VGPR and requires an identity `BUF_FMT_32_32_FLOAT` descriptor (format 64). Its low and high halves become two binary32 words in X/Y order. Both words must fit in the stride and declared output extent. A stopped or out-of-range view leaves every guard intact. The compiler uses the decoded component count to select the HLSL helper. The changed CLI help lists the supported view widths. Validation on Windows 11 build 26100.9711 with DXC 1.9.2609 and Agility SDK 1.620.2: - `python -B tests/compute_heap_store_check.py draw <dxc> <offscreen_check> <warp|hardware>` on WARP 10.0.26100.9711, RTX 4060 (32.0.15.9579) and Intel UHD 770 (32.0.101.5973). Each adapter passed 17 FLOAT2 dispatches comparing all 320 words, including negative zero, a binary16 subnormal, the final complete pair, a partial pair and wrong formats. Each rejected 11 compiled shader mutations. Swapped halves first failed at word 4 (`3f800000` → `40400000`), duplicated X at word 5 (`40400000` → `3f800000`), and the weakened extent at guard word 127 (`c5c5c5c5` → `3f800000`). The existing UINT4, FLOAT4 and FLOAT1 fixtures passed on all three. Local D3D12 debug layer unavailable. - `python -B tests/compute_heap_store_check.py binary <llvm-mc> <llvm-objcopy> <libLLVM>` passed for all four programs, using LLVM 15.0.7's Clang integrated assembler as the gfx1013 object writer, llvm-objcopy and LLVM-C. Each goes through disassembly, a source-built container and the public CLI. The native FLOAT2 fixture SHA-256 is `a5562f3c4650969c26bee9cde075c8eb83251f7912fa03c030725d11006e0447`. - `python -B tests/compute_heap_store_check.py controls`, `python -B tests/compute_heap_view_check.py controls`, the existing compute-store host controls, docs links, bidirectional controls and `git diff --check` passed. Agent environment: Codex + GPT-6.2 Astra xhigh.
upstream-sync closed this pull request 2026-11-25 14:05:01 +00:00
tedin7 commented 2026-11-25 14:05:02 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T13:45:26Z.

Review: COMMENTED


Review of head 85e045382f (files: docs/experiments.md, tests/compute_heap_store_check.py, tools/compute_store_aot.py).

Findings: 0 P1, 0 P2.

  • Semantics: buffer_store_format_d16_xy takes one VGPR, low half = X, high half = Y. The lowering uses f16tof32(uint2(lo, hi)) and writes one Store2 into an identity BUF_FMT_32_32_FLOAT view (format 64, 0x01040fac). Format, alignment, extent and slot-limit guards are shared with the existing D16_X path; an 8-byte width is used for the bound.
  • heap_store_components is set from the lowered store and drives the helper emitted, so xyzw (4) and x (1) are unchanged. d16_xyz and a two-VGPR d16_xy source are still refused (control added).
  • Test: new D16_XY draw program with 12 cases plus payload checks (-0, smallest subnormal, -2.0 in Y) and wrong-format rejection (FLOAT4, UINT2). Docs heading keeps the old anchor. No competing open PR covers d16_xy heap stores.

Commands executed locally (Linux):

  • python3 tests/compute_heap_store_check.py controls -> "heap-store controls passed"
  • python3 tests/docs_links_check.py -> 19 files, 457 links OK
  • python3 tests/bidi_controls_check.py -> OK
  • git diff --check origin/main...HEAD -> clean
  • Mutation: components in (1, 2) -> (1,) in tools/compute_store_aot.py makes controls FAIL (AssertionError on the Store2 check). Reverted with git checkout.
  • CI: Build and test on Windows = pass, Linux checks = pass, fixtures = pass.
  • Windows WARP draw fixture is covered by the pure-Python fast path (only .py/.md changed).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6058741220 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2361#pullrequestreview-6058741220). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T13:45:26Z. **Review:** COMMENTED --- Review of head 85e045382fc652946d7f21112824a667595a7bc3 (files: docs/experiments.md, tests/compute_heap_store_check.py, tools/compute_store_aot.py). Findings: 0 P1, 0 P2. - Semantics: buffer_store_format_d16_xy takes one VGPR, low half = X, high half = Y. The lowering uses f16tof32(uint2(lo, hi)) and writes one Store2 into an identity BUF_FMT_32_32_FLOAT view (format 64, 0x01040fac). Format, alignment, extent and slot-limit guards are shared with the existing D16_X path; an 8-byte width is used for the bound. - heap_store_components is set from the lowered store and drives the helper emitted, so xyzw (4) and x (1) are unchanged. d16_xyz and a two-VGPR d16_xy source are still refused (control added). - Test: new D16_XY draw program with 12 cases plus payload checks (-0, smallest subnormal, -2.0 in Y) and wrong-format rejection (FLOAT4, UINT2). Docs heading keeps the old anchor. No competing open PR covers d16_xy heap stores. Commands executed locally (Linux): - python3 tests/compute_heap_store_check.py controls -> "heap-store controls passed" - python3 tests/docs_links_check.py -> 19 files, 457 links OK - python3 tests/bidi_controls_check.py -> OK - git diff --check origin/main...HEAD -> clean - Mutation: components in (1, 2) -> (1,) in tools/compute_store_aot.py makes controls FAIL (AssertionError on the Store2 check). Reverted with git checkout. - CI: Build and test on Windows = pass, Linux checks = pass, fixtures = pass. - Windows WARP draw fixture is covered by the pure-Python fast path (only .py/.md changed). AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 14:05:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T13:42:06Z.


The Windows Server 2025 WARP run pinned to 85e04538 passed both selected CTests without skips. It then repeated the FLOAT2 fixture with the D3D12 debug layer enabled and checked the child output for each of the 17 positive dispatches: zero debug warnings and errors. All 11 shader mutations produced the expected readback failures.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164162154 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2361#issuecomment-7164162154). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T13:42:06Z. --- The [Windows Server 2025 WARP run](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45625679146) pinned to 85e04538 passed both selected CTests without skips. It then repeated the FLOAT2 fixture with the D3D12 debug layer enabled and checked the child output for each of the 17 positive dispatches: zero debug warnings and errors. All 11 shader mutations produced the expected readback failures.
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!2353
No description provided.