shader: lower packed gfx1030 2D image stores #1405

Manually merged
github merged 1 commit from gh-pr/1405/head into gh-pr/1405/base 2026-11-26 23:04:41 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 10:42 UTC · original
stan495:codex/gfx1030-mimg-packed-stores → main · +142 −70 · 7 files · 1 commits · merged 2026-11-24 10:59 UTC

Scope

Extend the gfx1030 2D compute image UAV path from #1344 with image_store_pck and image_store_mip_pck. Use a linear R8G8B8A8_UINT view at u0. Each enabled channel consumes one VGPR in DMASK order and writes its low byte. The store overwrites the entire texel and zeroes omitted channels.

The caller supplies in-range, distinct coordinates and a base-mip-zero descriptor with identity channels. The translator accepts one image store per shader, 32-bit or a16 addresses, and a constant explicit mip that matches the bound UAV view. The format and opcode must agree. Rejection cases cover unsupported formats and flags, a malformed address tuple, an unresolved descriptor wait, a second store, and dynamic or mismatched mips.

Validation

Tested b898d3186bd8a6b285c50616272470cb6a895e52 on Windows 11 build 26300.9974. WARP used Microsoft Basic Render Driver 10.0.26100.9818. The physical adapter was Intel Arc B390 with driver 32.0.101.8509. Both reported debug_layer=unavailable.

. .\tools\dev.ps1
$py = (Resolve-Path out/pe-env/Scripts/python.exe).Path
$env:TEMP = (Resolve-Path out).Path
$env:TMP = $env:TEMP
$junit = Join-Path $env:TEMP 'mimg-ctest.xml'
cmake --preset dev "-DINTAKE_PYTHON=$py"
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V --output-junit $junit
& $py -B tools/form_coverage.py $junit --records out/build/dev/form_coverage --json out/mimg-coverage.json --gaps gfx1030
& $py -B tests/form_coverage_check.py
& $py -B tests/docs_links_check.py
& $py -B tests/bidi_controls_check.py

CTest reported 65 passed, 0 failed, and 0 skipped. Both packed-store tests recorded both new gfx1030 MIMG forms against the same passing JUnit run. Each backend passed 18 RGBA8 variants covering three mip levels, two address widths, DMASKs 0x1, 0xa and 0xf, and one or two groups. The CPU reference checks all 336 packed texels across three mips against the readback, including adjacent texels and unmodified mips.

Both adapters detected these executable mutations at mip 0, word 0.

Mutation Expected Actual
Take bits 15:8 e4007200 24002400
Write a nonzero omitted channel e4007200 e40072ef
Bind mip 0 for a mip 1 shader a89b8e81 e4ab7239
TMPDIR="$PWD/out" python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

The LLVM 15 regression passed. All 18 packed cases round-tripped through real gfx1030 assembly and disassembly and the synthetic-container CLI. The CLI HLSL matched the text path. For image_store_pck_0_1, DXC compiled the HLSL emitted by the container CLI and both adapters passed all 336 comparisons. The GPU fixtures executed translated desktop DXIL. Native execution was outside this test matrix.

**@⁠stan495** on GitHub · 2026-11-24 10:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1405) `stan495:codex/gfx1030-mimg-packed-stores` → `main` · +142 −70 · 7 files · 1 commits · merged 2026-11-24 10:59 UTC ## Scope Extend the gfx1030 2D compute image UAV path from #1344 with `image_store_pck` and `image_store_mip_pck`. Use a linear `R8G8B8A8_UINT` view at `u0`. Each enabled channel consumes one VGPR in DMASK order and writes its low byte. The store overwrites the entire texel and zeroes omitted channels. The caller supplies in-range, distinct coordinates and a base-mip-zero descriptor with identity channels. The translator accepts one image store per shader, 32-bit or `a16` addresses, and a constant explicit mip that matches the bound UAV view. The format and opcode must agree. Rejection cases cover unsupported formats and flags, a malformed address tuple, an unresolved descriptor wait, a second store, and dynamic or mismatched mips. ## Validation Tested `b898d3186bd8a6b285c50616272470cb6a895e52` on Windows 11 build 26300.9974. WARP used Microsoft Basic Render Driver 10.0.26100.9818. The physical adapter was Intel Arc B390 with driver 32.0.101.8509. Both reported `debug_layer=unavailable`. ```powershell . .\tools\dev.ps1 $py = (Resolve-Path out/pe-env/Scripts/python.exe).Path $env:TEMP = (Resolve-Path out).Path $env:TMP = $env:TEMP $junit = Join-Path $env:TEMP 'mimg-ctest.xml' cmake --preset dev "-DINTAKE_PYTHON=$py" cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^(compute_store_aot_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V --output-junit $junit & $py -B tools/form_coverage.py $junit --records out/build/dev/form_coverage --json out/mimg-coverage.json --gaps gfx1030 & $py -B tests/form_coverage_check.py & $py -B tests/docs_links_check.py & $py -B tests/bidi_controls_check.py ``` CTest reported 65 passed, 0 failed, and 0 skipped. Both packed-store tests recorded both new gfx1030 MIMG forms against the same passing JUnit run. Each backend passed 18 RGBA8 variants covering three mip levels, two address widths, DMASKs `0x1`, `0xa` and `0xf`, and one or two groups. The CPU reference checks all 336 packed texels across three mips against the readback, including adjacent texels and unmodified mips. Both adapters detected these executable mutations at mip 0, word 0. | Mutation | Expected | Actual | | --- | --- | --- | | Take bits 15:8 | `e4007200` | `24002400` | | Write a nonzero omitted channel | `e4007200` | `e40072ef` | | Bind mip 0 for a mip 1 shader | `a89b8e81` | `e4ab7239` | ```sh TMPDIR="$PWD/out" python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` The LLVM 15 regression passed. All 18 packed cases round-tripped through real gfx1030 assembly and disassembly and the synthetic-container CLI. The CLI HLSL matched the text path. For `image_store_pck_0_1`, DXC compiled the HLSL emitted by the container CLI and both adapters passed all 336 comparisons. The GPU fixtures executed translated desktop DXIL. Native execution was outside this test matrix.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:04:40 +00:00
github manually merged commit b898d3186b into gh-pr/1405/base 2026-11-26 23:04:41 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 10:54 UTC · original · reviewed

Reviewed commit b898d3186bd8a6b285c50616272470cb6a895e52:

  • Diff & scope: Cleanly extends tools/compute_store_aot.py to lower image_store_pck and image_store_mip_pck for R8G8B8A8_UINT by masking enabled channels with 0xffu (while rejecting _pck_sgn and format/opcode mismatches), updates check_compute_texture_store_file in tests/compute_check.cpp and tests/offscreen_check.cpp to handle R8G8B8A8_UINT via texture_rgba8_flag, and adds mimg_store_cases(packed=True), mimg_store_controls(packed=True), and draw-mimg-packed-store (with wrong byte, unmasked channel, and wrong UAV mip negative controls) in tests/compute_store_check.py, plus CMakeLists.txt, docs/experiments.md, and README.md.
  • Linux checks: git diff --check clean; tests/docs_links_check.py (16 Markdown files, 318 links), tests/bidi_controls_check.py (1180 files), and tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so all passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev, offscreen_check): 2/2 passed (compute_store_aot_mimg_store_warp, compute_store_aot_mimg_store_packed_warp).
    • Release /O2 (--preset release, offscreen_check): 2/2 passed.
**@⁠tedin7** on GitHub · 2026-11-24 10:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1405#pullrequestreview-6037918067) · **reviewed** Reviewed commit `b898d3186bd8a6b285c50616272470cb6a895e52`: - **Diff & scope**: Cleanly extends `tools/compute_store_aot.py` to lower `image_store_pck` and `image_store_mip_pck` for `R8G8B8A8_UINT` by masking enabled channels with `0xffu` (while rejecting `_pck_sgn` and format/opcode mismatches), updates `check_compute_texture_store_file` in `tests/compute_check.cpp` and `tests/offscreen_check.cpp` to handle `R8G8B8A8_UINT` via `texture_rgba8_flag`, and adds `mimg_store_cases(packed=True)`, `mimg_store_controls(packed=True)`, and `draw-mimg-packed-store` (with `wrong byte`, `unmasked channel`, and `wrong UAV mip` negative controls) in `tests/compute_store_check.py`, plus `CMakeLists.txt`, `docs/experiments.md`, and `README.md`. - **Linux checks**: `git diff --check` clean; `tests/docs_links_check.py` (16 Markdown files, 318 links), `tests/bidi_controls_check.py` (1180 files), and `tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so` all passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - Debug (`--preset dev`, `offscreen_check`): **2/2 passed** (`compute_store_aot_mimg_store_warp`, `compute_store_aot_mimg_store_packed_warp`). - Release `/O2` (`--preset release`, `offscreen_check`): **2/2 passed**.
This discussion has been locked. Commenting is limited to contributors.
No description provided.