shader: diagnose unsupported gfx1030 MUBUF cache invalidations #1379

Manually merged
github merged 1 commit from gh-pr/1379/head into gh-pr/1379/base 2026-11-26 23:02:32 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 09:53 UTC · original
stan495:codex/gfx1030-mubuf-cache-diagnostics → main · +55 −2 · 3 files · 1 commits · merged 2026-11-24 10:32 UTC

Behavior

Reject buffer_gl0_inv and buffer_gl1_inv with the opcode in the diagnostic. The desktop compute profile has no mapping for the native GL0 writeback and GL1 invalidate scopes or their acknowledgments. An assembled container fixture checks both rejections and verifies that neither emits HLSL. A control replaces the invalidation with s_nop 0 and compares the emitted HLSL with the original indexed-store program.

Verification

Tested clean head a819b80c2cdb8d9f6e7d1b840c14ea7c8b5d6cce.

  • python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 passed with LLVM 15.0.7. Each cache instruction disassembled by name and exited with code 1 and Unsupported MUBUF cache invalidation: <opcode>.
  • In the silent-drop mutant, the first buffer_gl0_inv case exited with code 0 and emitted the same HLSL as the NOP control. The fixture requires code 1 and no output file, so it detected the mutant.
  • cmake --preset dev -DINTAKE_PYTHON=<absolute-path-to-Python> and cmake --build --preset dev --target offscreen_check passed. With CTEST_PARALLEL_LEVEL=2, ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit out/cache-diagnostics-junit.xml passed 50 tests with zero failures and zero capability skips. These tests execute translated DXIL on Windows build 26300.9974 with WARP (Microsoft Basic Render Driver 10.0.26100.9818) and Intel Arc B390 (32.0.101.8509). The debug layer was unavailable on both adapters.
  • python -B tools/form_coverage.py out/cache-diagnostics-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/cache-diagnostics-coverage.json confirmed 45/73 gfx1030 MUBUF forms in this test run. Neither cache invalidation contributes semantic coverage.
  • python -B tests/form_coverage_check.py and python -B tests/docs_links_check.py passed. python -B tests/rdna2_tools_check.py ran 139 cases with 121 passes, zero failures and 18 skips.

git merge-tree --write-tree ea5884d3ef9be8ff3f571d90a5578fe5060dd419 HEAD and the combined simulation with the queued MUBUF batches both completed without conflicts.

**@⁠stan495** on GitHub · 2026-11-24 09:53 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1379) `stan495:codex/gfx1030-mubuf-cache-diagnostics` → `main` · +55 −2 · 3 files · 1 commits · merged 2026-11-24 10:32 UTC ## Behavior Reject `buffer_gl0_inv` and `buffer_gl1_inv` with the opcode in the diagnostic. The desktop compute profile has no mapping for the native GL0 writeback and GL1 invalidate scopes or their acknowledgments. An assembled container fixture checks both rejections and verifies that neither emits HLSL. A control replaces the invalidation with `s_nop 0` and compares the emitted HLSL with the original indexed-store program. ## Verification Tested clean head `a819b80c2cdb8d9f6e7d1b840c14ea7c8b5d6cce`. - `python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1` passed with LLVM 15.0.7. Each cache instruction disassembled by name and exited with code 1 and `Unsupported MUBUF cache invalidation: <opcode>`. - In the silent-drop mutant, the first `buffer_gl0_inv` case exited with code 0 and emitted the same HLSL as the NOP control. The fixture requires code 1 and no output file, so it detected the mutant. - `cmake --preset dev -DINTAKE_PYTHON=<absolute-path-to-Python>` and `cmake --build --preset dev --target offscreen_check` passed. With `CTEST_PARALLEL_LEVEL=2`, `ctest --preset dev --no-tests=error -R '^compute_store_aot_' -V --output-junit out/cache-diagnostics-junit.xml` passed 50 tests with zero failures and zero capability skips. These tests execute translated DXIL on Windows build 26300.9974 with WARP (Microsoft Basic Render Driver 10.0.26100.9818) and Intel Arc B390 (32.0.101.8509). The debug layer was unavailable on both adapters. - `python -B tools/form_coverage.py out/cache-diagnostics-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/cache-diagnostics-coverage.json` confirmed 45/73 gfx1030 MUBUF forms in this test run. Neither cache invalidation contributes semantic coverage. - `python -B tests/form_coverage_check.py` and `python -B tests/docs_links_check.py` passed. `python -B tests/rdna2_tools_check.py` ran 139 cases with 121 passes, zero failures and 18 skips. `git merge-tree --write-tree ea5884d3ef9be8ff3f571d90a5578fe5060dd419 HEAD` and the combined simulation with the queued MUBUF batches both completed without conflicts.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:02:31 +00:00
github manually merged commit a819b80c2c into gh-pr/1379/base 2026-11-26 23:02:32 +00:00
Author
Owner

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

Technical peer-review of commit a819b80c2cdb8d9f6e7d1b840c14ea7c8b5d6cce:

Verification

  • Linux (LLVM-19):
    • git diff --check origin/main...HEAD: clean.
    • tests/docs_links_check.py: passed (16 Markdown files, 308 links).
    • tests/bidi_controls_check.py: passed (1,153 files).
    • tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed (including Unsupported MUBUF cache invalidation: buffer_gl0_inv and buffer_gl1_inv).
    • tests/rdna2_tools_check.py: passed (139 tests, 18 skipped).
    • tests/form_coverage_check.py: passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): offscreen_check built (3.82s, configure 1.58s); ctest -R '^compute_store_aot_(warp|mubuf_reduction_warp|mubuf_format_warp|mubuf_subword_warp|mubuf_vector_warp)$' 5/5 passed (6.95s: compute_store_aot_mubuf_format_warp 3.56s, compute_store_aot_mubuf_subword_warp 3.61s, compute_store_aot_mubuf_reduction_warp 4.64s, compute_store_aot_warp 6.24s, compute_store_aot_mubuf_vector_warp 3.30s).
    • Release /O2 (--preset release): offscreen_check built (0.88s, configure 1.64s); ctest 5/5 passed (6.98s).

Findings

  • No defects found.
  • tools/compute_store_aot.py rejects buffer_gl0_inv and buffer_gl1_inv under cpu == "gfx1030" with ValueError(f"Unsupported MUBUF cache invalidation: {line}").
  • tests/compute_store_check.py (mubuf_cache_invalidate_binary) assembles each instruction with llvm-mc (-mcpu=gfx1030), verifies exact disassembly, checks CLI exit code 1, exact ValueError diagnostic, and absence of emitted HLSL, and uses s_nop 0 as a positive control producing identical HLSL to INDEXED.
**@⁠tedin7** on GitHub · 2026-11-24 10:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1379#pullrequestreview-6037241594) · **reviewed** Technical peer-review of commit `a819b80c2cdb8d9f6e7d1b840c14ea7c8b5d6cce`: ### Verification - **Linux (LLVM-19)**: - `git diff --check origin/main...HEAD`: clean. - `tests/docs_links_check.py`: passed (16 Markdown files, 308 links). - `tests/bidi_controls_check.py`: passed (1,153 files). - `tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so`: passed (including `Unsupported MUBUF cache invalidation: buffer_gl0_inv` and `buffer_gl1_inv`). - `tests/rdna2_tools_check.py`: passed (139 tests, 18 skipped). - `tests/form_coverage_check.py`: passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `offscreen_check` built (`3.82s`, configure `1.58s`); `ctest -R '^compute_store_aot_(warp|mubuf_reduction_warp|mubuf_format_warp|mubuf_subword_warp|mubuf_vector_warp)$'` **5/5 passed** (`6.95s`: `compute_store_aot_mubuf_format_warp` `3.56s`, `compute_store_aot_mubuf_subword_warp` `3.61s`, `compute_store_aot_mubuf_reduction_warp` `4.64s`, `compute_store_aot_warp` `6.24s`, `compute_store_aot_mubuf_vector_warp` `3.30s`). - **Release `/O2` (`--preset release`)**: `offscreen_check` built (`0.88s`, configure `1.64s`); `ctest` **5/5 passed** (`6.98s`). ### Findings - No defects found. - `tools/compute_store_aot.py` rejects `buffer_gl0_inv` and `buffer_gl1_inv` under `cpu == "gfx1030"` with `ValueError(f"Unsupported MUBUF cache invalidation: {line}")`. - `tests/compute_store_check.py` (`mubuf_cache_invalidate_binary`) assembles each instruction with `llvm-mc` (`-mcpu=gfx1030`), verifies exact disassembly, checks CLI exit code 1, exact `ValueError` diagnostic, and absence of emitted HLSL, and uses `s_nop 0` as a positive control producing identical HLSL to `INDEXED`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.