Skip to content

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

Merged
tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:compute/heap-d16-float2
Nov 25, 2026
Merged

tedin7 merged 1 commit into
R0Y00:mainfrom
RavenCurseBurg:compute/heap-d16-float2

Conversation

@RavenCurseBurg

Copy link
Copy Markdown
Contributor

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.

@RavenCurseBurg

Copy link
Copy Markdown
Contributor Author

The Windows Server 2025 WARP run pinned to 85e0453 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.

@tedin7 tedin7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of head 85e0453 (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.

@tedin7
tedin7 merged commit f489f93 into R0Y00:main Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants