shader: lower gfx1030 whole-texel D16 UINT buffer stores #1339

Merged
stan495 merged 1 commit from upstream-pr/1346 into main 2026-11-24 09:25:28 +00:00
stan495 commented 2026-11-24 08:49:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T08:49:18Z.


Summary

  • Lower indexed gfx1030 buffer_store_format_d16_x, _xy, and _xyzw with the corresponding identity-selected BUF_FMT_16_UINT, BUF_FMT_16_16_UINT and BUF_FMT_16_16_16_16_UINT output descriptors. Use the existing checked address and store-overlap rules.
  • Preserve the high half of the containing UAV DWORD for x. An overlapping store in either half is refused. The accepted subset writes whole texels. The xyz form needs a native check of the fourth channel when used with a four-channel descriptor.
  • Extend the formatted-store fixture from #1333 with a byte-copy CPU reference and compare all 320 output words at one and two group counts. Also add LLVM 15 assembler, disassembler, and compute-container CLI coverage for each new form.

Validation

Commit tested 6ebbcc586e91cc0e15155b46f3fc51bd7b3951fe.

cmake --preset dev
cmake --build --preset dev --target offscreen_check
$env:CTEST_PARALLEL_LEVEL = '2'
ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit "$PWD/out/compute-store-junit.xml"
python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py

46 passed, 0 failed, 0 capability skips. Both compute_store_aot_mubuf_store_format_* fixtures recorded all three new forms. The same run reports 32 of 73 gfx1030 MUBUF forms. The coverage and documentation checks passed.

Windows build 26300.9974, WARP on Microsoft Basic Render Driver (10.0.26100.9818) and hardware on Intel Arc B390 (32.0.101.8509). The debug layer was unavailable on both. The dispatches ran translated desktop DXIL.

The cleared-preservation mutation failed on both adapters at word 1 with expected c5c5cdef, actual 0000cdef. The first-pair swap for xy and xyzw failed at word 1 with expected 89abcdef, actual cdef89ab. Rejection fixtures cover offset alignment, bounds, width and descriptor wait mismatches, a write to the companion half, and xyz with the four-channel descriptor.

python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

Passed on Ubuntu 22.04.5 with LLVM 15.0.7.

git diff --check and the merge-tree checks against main and the independent D16 load PR #1343 passed.

The tested merge base on upstream main was d6cbd5d7c9ac3f1c4583fc459ccbd990689af903.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6578039171 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1346). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T08:49:18Z. --- ## Summary - Lower indexed gfx1030 `buffer_store_format_d16_x`, `_xy`, and `_xyzw` with the corresponding identity-selected `BUF_FMT_16_UINT`, `BUF_FMT_16_16_UINT` and `BUF_FMT_16_16_16_16_UINT` output descriptors. Use the existing checked address and store-overlap rules. - Preserve the high half of the containing UAV DWORD for `x`. An overlapping store in either half is refused. The accepted subset writes whole texels. The `xyz` form needs a native check of the fourth channel when used with a four-channel descriptor. - Extend the formatted-store fixture from #1333 with a byte-copy CPU reference and compare all 320 output words at one and two group counts. Also add LLVM 15 assembler, disassembler, and compute-container CLI coverage for each new form. ## Validation Commit tested `6ebbcc586e91cc0e15155b46f3fc51bd7b3951fe`. ```powershell cmake --preset dev cmake --build --preset dev --target offscreen_check $env:CTEST_PARALLEL_LEVEL = '2' ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit "$PWD/out/compute-store-junit.xml" python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json python -B tests/form_coverage_check.py python -B tests/docs_links_check.py ``` 46 passed, 0 failed, 0 capability skips. Both `compute_store_aot_mubuf_store_format_*` fixtures recorded all three new forms. The same run reports 32 of 73 gfx1030 MUBUF forms. The coverage and documentation checks passed. Windows build `26300.9974`, WARP on Microsoft Basic Render Driver (`10.0.26100.9818`) and hardware on Intel Arc B390 (`32.0.101.8509`). The debug layer was unavailable on both. The dispatches ran translated desktop DXIL. The cleared-preservation mutation failed on both adapters at word 1 with expected `c5c5cdef`, actual `0000cdef`. The first-pair swap for `xy` and `xyzw` failed at word 1 with expected `89abcdef`, actual `cdef89ab`. Rejection fixtures cover offset alignment, bounds, width and descriptor wait mismatches, a write to the companion half, and `xyz` with the four-channel descriptor. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` Passed on Ubuntu 22.04.5 with LLVM 15.0.7. `git diff --check` and the merge-tree checks against main and the independent D16 load PR #1343 passed. The tested merge base on upstream main was `d6cbd5d7c9ac3f1c4583fc459ccbd990689af903`.
upstream-sync closed this pull request 2026-11-24 10:02:24 +00:00
tedin7 commented 2026-11-24 10:02:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:07:37Z.

Review: COMMENTED


Technical peer-review at commit 6ebbcc586e91cc0e15155b46f3fc51bd7b3951fe:

Verification

  • Linux / LLVM 19:
    • git diff --check origin/main...HEAD: clean.
    • tests/docs_links_check.py: passed (16 Markdown files, 300 links).
    • tests/bidi_controls_check.py: passed (1113 tracked files).
    • tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed.
    • tests/rdna2_tools_check.py: passed (138 tests, 18 skipped).
    • tests/form_coverage_check.py: passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): cmake --build --preset dev --target offscreen_check succeeded (3.85s); ctest --preset dev -R '^compute_store_aot_mubuf_store_format_warp$' 1/1 passed (3.47s).
    • Release /O2 (--preset release): build succeeded (1.04s); ctest --preset release -R '^compute_store_aot_mubuf_store_format_warp$' 1/1 passed (3.35s).

Code & Test Notes

  • tools/compute_store_aot.py: extends --output-format and formatted MUBUF store lowering to accept buffer_store_format_d16_x, _xy, and _xyzw with matching BUF_FMT_16_UINT, BUF_FMT_16_16_UINT, and BUF_FMT_16_16_16_16_UINT descriptors, idxen without offen, and DWORD-aligned offsets. d16_x reserves the containing DWORD (partial = True) and preserves its high 16 bits via RMW while rejecting overlapping stores. d16_xyz is explicitly rejected.
  • tests/compute_store_check.py: exercises all three packed widths at 1 and 2 groups (16 threads/group) against a CPU byte reference, plus negative controls for offen, unaligned/out-of-bounds offsets, overlapping buffer_store_short, mismatched --output-format, missing lgkmcnt(0), d16_xyz, and mutant shaders clearing the preserved halfword or swapping packed channels.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6036406449 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1346#pullrequestreview-6036406449). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T09:07:37Z. **Review:** COMMENTED --- Technical peer-review at commit `6ebbcc586e91cc0e15155b46f3fc51bd7b3951fe`: ### Verification - **Linux / LLVM 19**: - `git diff --check origin/main...HEAD`: clean. - `tests/docs_links_check.py`: passed (16 Markdown files, 300 links). - `tests/bidi_controls_check.py`: passed (1113 tracked files). - `tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so`: passed. - `tests/rdna2_tools_check.py`: passed (138 tests, 18 skipped). - `tests/form_coverage_check.py`: passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `cmake --build --preset dev --target offscreen_check` succeeded (`3.85s`); `ctest --preset dev -R '^compute_store_aot_mubuf_store_format_warp$'` **1/1 passed** (`3.47s`). - **Release `/O2` (`--preset release`)**: build succeeded (`1.04s`); `ctest --preset release -R '^compute_store_aot_mubuf_store_format_warp$'` **1/1 passed** (`3.35s`). ### Code & Test Notes - `tools/compute_store_aot.py`: extends `--output-format` and formatted MUBUF store lowering to accept `buffer_store_format_d16_x`, `_xy`, and `_xyzw` with matching `BUF_FMT_16_UINT`, `BUF_FMT_16_16_UINT`, and `BUF_FMT_16_16_16_16_UINT` descriptors, `idxen` without `offen`, and DWORD-aligned offsets. `d16_x` reserves the containing DWORD (`partial = True`) and preserves its high 16 bits via RMW while rejecting overlapping stores. `d16_xyz` is explicitly rejected. - `tests/compute_store_check.py`: exercises all three packed widths at 1 and 2 groups (16 threads/group) against a CPU byte reference, plus negative controls for `offen`, unaligned/out-of-bounds offsets, overlapping `buffer_store_short`, mismatched `--output-format`, missing `lgkmcnt(0)`, `d16_xyz`, and mutant shaders clearing the preserved halfword or swapping packed channels.
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!1339
No description provided.