shader: lower compute buffer_store_format_d16_x in gfx2hlsl #2470

Merged
Vladimir-Human merged 8 commits from upstream-pr/2478 into main 2026-11-25 21:36:10 +00:00
Vladimir-Human commented 2026-11-25 17:55:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vladimir-Human on 2026-11-25T17:55:39Z.


AI-assisted PR. (Claimed buffer_store_format_d16_x on #2274.)

Summary

Lowers compute buffer_store_format_d16_x (MUBUF) in tools/startup/gfx2hlsl.py:

  • Implements RDNA 2 ISA OOB_SELECT handling (0 = SQ_OOB_INDEX_AND_OFFSET requiring stride != 0; 3 = SQ_OOB_COMPLETE requiring stride == 0), refusing invalid modes 1/2 and mismatched strides cleanly.
  • Keeps inline/SGPR soffset separate from rec_off = voff + imm_off bounds checks with 32-bit overflow guards.
  • Uses a lock-free InterlockedCompareExchange CAS loop for 16-bit half-word read-modify-write under concurrent thread contention.
  • Validates CACHE_SWIZZLE, SWIZZLE_ENABLE, lds/reserved MUBUF bits, lane-mask soffset, and RDNA 2 binary16 -> unorm16/snorm16 rounding.

Verification (commit 93da95ef)

  • tools/run_checks_parallel.py (6 checks including startup_compute_store_d16_x_check.py): 6/6 PASS
  • ctest --test-dir build-store-d16x -C Release -j 1 -R "^startup_compute_store_d16_x" --output-on-failure -V: 19/19 PASS, 0 failed, 0 skipped (WARP & RTX 4070 SUPER with D3D12 debug layer: debug_errors=0 debug_warnings=0)
  • Exhaustive 65,536-input binary16 -> unorm16/snorm16 check: 0 RNE diffs.
  • git merge-tree --write-tree clean against latest origin/main (1a0e506d) and PR #2404.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6610480843 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-25T17:55:39Z. --- AI-assisted PR. (Claimed `buffer_store_format_d16_x` on #2274.) ### Summary Lowers compute `buffer_store_format_d16_x` (MUBUF) in `tools/startup/gfx2hlsl.py`: - Implements RDNA 2 ISA `OOB_SELECT` handling (`0` = `SQ_OOB_INDEX_AND_OFFSET` requiring `stride != 0`; `3` = `SQ_OOB_COMPLETE` requiring `stride == 0`), refusing invalid modes `1`/`2` and mismatched strides cleanly. - Keeps inline/SGPR `soffset` separate from `rec_off = voff + imm_off` bounds checks with 32-bit overflow guards. - Uses a lock-free `InterlockedCompareExchange` CAS loop for 16-bit half-word read-modify-write under concurrent thread contention. - Validates `CACHE_SWIZZLE`, `SWIZZLE_ENABLE`, `lds`/reserved MUBUF bits, lane-mask `soffset`, and RDNA 2 `binary16` -> `unorm16`/`snorm16` rounding. ### Verification (commit `93da95ef`) - `tools/run_checks_parallel.py` (6 checks including `startup_compute_store_d16_x_check.py`): **6/6 PASS** - `ctest --test-dir build-store-d16x -C Release -j 1 -R "^startup_compute_store_d16_x" --output-on-failure -V`: **19/19 PASS, 0 failed, 0 skipped** (WARP & RTX 4070 SUPER with D3D12 debug layer: `debug_errors=0 debug_warnings=0`) - Exhaustive 65,536-input `binary16` -> `unorm16`/`snorm16` check: 0 RNE diffs. - `git merge-tree --write-tree` clean against latest `origin/main` (`1a0e506d`) and PR `#2404`.
tedin7 commented 2026-11-25 19:03:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:41:17Z.

Review: COMMENTED


Review of head 93da95ef (comment only, no approval or merge).

Scope. Lowers compute buffer_store_format_d16_x in tools/startup/gfx2hlsl.py. Adds one test file, CTest entries in CMakeLists.txt, a short docs/experiments.md note, and two lines in .github/workflows/windows.yml.

CI workflow change. The two added lines register tests/startup_compute_store_d16_x_check.py in the existing list and in the Linux checks. They follow sibling entries. The PR's own CI run on this exact head (93da95ef) passed "Assemble and translate gfx1013 fixtures", "Build and test on Windows" and "Run platform-independent Python checks on Linux", so the changed workflow was exercised.

Duplicates. No other open or merged PR lowers this opcode. #2165 covers d16 buffer loads, a different slice. The claim is on #2274 by the author.

Mutations I ran (then reverted with git checkout -- .).

  • Accepting OOB_SELECT 1 in validate_store_d16_x_word3: the offline check fails ("accepted, expected a refusal naming 'OOB_SELECT 1'"). Caught.
  • Removing the rec_off > stride - elem_bytes bound from the emitted HLSL: the offline check still passes. That is expected, because the emitted HLSL is only exercised by the WARP dispatch and control tests. Those are the tests that need Windows, and I did not run them.

Things to know.

  • Windows results: the author reports WARP and hardware results for 93da95ef (19/19). I did not run Win2025 and did not verify those numbers. A Win2025 WARP pass on this head is still needed.
  • The test has a tfe snippet that my local llvm-mc-19 rejects ("invalid operand"). I could not run llvm-mc-15 locally. CI's fixture job, which uses llvm-mc-15, passed on this head, so I treat it as a local tool version difference.
  • The PR is 33 commits behind main (behind=33). I did not run update-branch, because it would change the head SHA and void the author's test results.
  • Open design question for @R0Y00: none found. This PR does not claim to advance game startup, and I did not check any startup behaviour.

Commands run locally.

  • python3 -B tests/startup_compute_store_d16_x_check.py (no arguments): pass.
  • python3 tests/docs_links_check.py and python3 tests/bidi_controls_check.py: pass.
  • git diff --check origin/main...HEAD: clean.
  • The two mutations above.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6063064080 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#pullrequestreview-6063064080). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T18:41:17Z. **Review:** COMMENTED --- Review of head `93da95ef` (comment only, no approval or merge). **Scope.** Lowers compute `buffer_store_format_d16_x` in `tools/startup/gfx2hlsl.py`. Adds one test file, CTest entries in `CMakeLists.txt`, a short `docs/experiments.md` note, and two lines in `.github/workflows/windows.yml`. **CI workflow change.** The two added lines register `tests/startup_compute_store_d16_x_check.py` in the existing list and in the Linux checks. They follow sibling entries. The PR's own CI run on this exact head (`93da95ef`) passed "Assemble and translate gfx1013 fixtures", "Build and test on Windows" and "Run platform-independent Python checks on Linux", so the changed workflow was exercised. **Duplicates.** No other open or merged PR lowers this opcode. #2165 covers d16 buffer loads, a different slice. The claim is on #2274 by the author. **Mutations I ran (then reverted with `git checkout -- .`).** - Accepting `OOB_SELECT 1` in `validate_store_d16_x_word3`: the offline check fails ("accepted, expected a refusal naming 'OOB_SELECT 1'"). Caught. - Removing the `rec_off > stride - elem_bytes` bound from the emitted HLSL: the offline check still passes. That is expected, because the emitted HLSL is only exercised by the WARP dispatch and `control` tests. Those are the tests that need Windows, and I did not run them. **Things to know.** - Windows results: the author reports WARP and hardware results for `93da95ef` (19/19). I did not run Win2025 and did not verify those numbers. A Win2025 WARP pass on this head is still needed. - The test has a `tfe` snippet that my local `llvm-mc-19` rejects ("invalid operand"). I could not run `llvm-mc-15` locally. CI's fixture job, which uses `llvm-mc-15`, passed on this head, so I treat it as a local tool version difference. - The PR is 33 commits behind main (`behind=33`). I did not run `update-branch`, because it would change the head SHA and void the author's test results. - Open design question for @R0Y00: none found. This PR does not claim to advance game startup, and I did not check any startup behaviour. **Commands run locally.** - `python3 -B tests/startup_compute_store_d16_x_check.py` (no arguments): pass. - `python3 tests/docs_links_check.py` and `python3 tests/bidi_controls_check.py`: pass. - `git diff --check origin/main...HEAD`: clean. - The two mutations above. AI-assisted; commands listed were executed locally.
ChazY11 commented 2026-11-25 19:04:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:35:32Z.


Six mutations on the descriptor validation, all caught

Baseline: buffer_store_format_d16_x unit, format, bounds, CAS, provenance and refusal checks pass, exit 0 — and this check runs with no arguments, so it is in the cross-platform list rather than needing a GPU.

mutation of validate_store_d16_x_word3 result
the zero-flag mask not applied (STORE_D16_X_WORD3_ZERO_MASK) caught
the DST_SEL_X identity rule removed caught
the OOB_SELECT rule removed caught
the legacy format table bypassed (always take the modern code) caught
an unknown FORMAT accepted instead of refused caught
the word3 int/range check removed caught

The fourth row is the one worth having. code = field if ((word3 >> 24) & 1) else STORE_D16_X_LEGACY_FORMATS.get(field) is a two-generation encoding: the same numeric FORMAT field means a different format depending on one bit, so a fixture that only exercises the modern half would pass with the table bypassed. Both halves are covered.

The last row matters for a different reason: not isinstance(word3, int) or isinstance(word3, bool) is the guard against a bool arriving where a word is expected, which is exactly the kind of thing a caller can do by accident (True is 1). Removing it is caught, so the fixture feeds something that is not a plain int.

What the set says about the shape of this check

Six independent refusal conditions per descriptor word, all pinned — this is a validation surface tested as a validation surface, not just "the happy path stores the right value". For a store that can silently write the wrong element size into a title's buffer, that is the right emphasis: every one of the six is a way to write the right value in the wrong place, which no later comparison would catch.

One note

STORE_D16_X_WORD3_ZERO_MASK = 0xcef80000 is asserted only through its effect. If a future descriptor gains a flag inside that mask that should be accepted, the constant has to change and the fixture will say so — good. But the constant's name says what it is applied to, not what the set of bits means; a one-line comment listing which V# word 3 fields those bits are (or a link to the ISA table) would let a reader verify the mask rather than trust it.

AI-assisted; the six mutations were run locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171120658 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7171120658). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:35:32Z. --- ## Six mutations on the descriptor validation, all caught Baseline: `buffer_store_format_d16_x unit, format, bounds, CAS, provenance and refusal checks pass`, exit 0 — and this check runs with no arguments, so it is in the cross-platform list rather than needing a GPU. | mutation of `validate_store_d16_x_word3` | result | |---|---| | the zero-flag mask not applied (`STORE_D16_X_WORD3_ZERO_MASK`) | **caught** | | the `DST_SEL_X` identity rule removed | **caught** | | the `OOB_SELECT` rule removed | **caught** | | the legacy format table bypassed (always take the modern code) | **caught** | | an unknown `FORMAT` accepted instead of refused | **caught** | | the `word3` int/range check removed | **caught** | The fourth row is the one worth having. `code = field if ((word3 >> 24) & 1) else STORE_D16_X_LEGACY_FORMATS.get(field)` is a two-generation encoding: the same numeric `FORMAT` field means a different format depending on one bit, so a fixture that only exercises the modern half would pass with the table bypassed. Both halves are covered. The last row matters for a different reason: `not isinstance(word3, int) or isinstance(word3, bool)` is the guard against a `bool` arriving where a word is expected, which is exactly the kind of thing a caller can do by accident (`True` is `1`). Removing it is caught, so the fixture feeds something that is not a plain int. ## What the set says about the shape of this check Six independent refusal conditions per descriptor word, all pinned — this is a validation surface tested as a validation surface, not just "the happy path stores the right value". For a store that can silently write the wrong element size into a title's buffer, that is the right emphasis: every one of the six is a way to write the right value in the wrong place, which no later comparison would catch. ## One note `STORE_D16_X_WORD3_ZERO_MASK = 0xcef80000` is asserted only through its effect. If a future descriptor gains a flag inside that mask that *should* be accepted, the constant has to change and the fixture will say so — good. But the constant's name says what it is applied to, not what the set of bits means; a one-line comment listing which V# word 3 fields those bits are (or a link to the ISA table) would let a reader verify the mask rather than trust it. AI-assisted; the six mutations were run locally on Windows 11 build 26300.9974.
R0Y00 commented 2026-11-25 19:04:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T18:52:05Z.


The CAS fixture tests neighboring halves and contention on a padded UAV. Please also cover the host backing boundary. The guest check can allow a 2-byte write, but the translated Load and CompareExchange need the entire aligned DWORD inside the bound raw UAV. A short binding can otherwise drop the update or make the retry loop rely on an out-of-view atomic. Show how the runtime binding or shader proves the enclosing DWORD is present, and add a short-binding control beside a valid padded case. Keep this separate from the guest NumRecords/stride checks and from actual slot 67 runtime coverage.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171511550 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7171511550). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T18:52:05Z. --- The CAS fixture tests neighboring halves and contention on a padded UAV. Please also cover the host backing boundary. The guest check can allow a 2-byte write, but the translated Load and CompareExchange need the entire aligned DWORD inside the bound raw UAV. A short binding can otherwise drop the update or make the retry loop rely on an out-of-view atomic. Show how the runtime binding or shader proves the enclosing DWORD is present, and add a short-binding control beside a valid padded case. Keep this separate from the guest NumRecords/stride checks and from actual slot 67 runtime coverage.
Vladimir-Human commented 2026-11-25 20:04:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vladimir-Human on 2026-11-25T19:31:19Z.


AI-assisted update addressing the host-backing-boundary review feedback (@R0Y00) and descriptor bit-field note (@ChazY11) at commit 41bd92bf7e8cde64085c3d4d35287b51459bd6a8:

  1. Enclosing-DWORD host-backing check in store_format_d16_x (tools/startup/gfx2hlsl.py):

    • The translated helper now queries the bound raw UAV byte size with buf.GetDimensions(uav_bytes); and enforces host bounds separately from guest num_records/stride:
      • BUF_FMT_32_FLOAT (fmt == 22u): checks uav_bytes < 4u || addr > uav_bytes - 4u before buf.Store(addr, ...).
      • 16-bit atomic CAS paths: after uint base = addr & 0xfffffffcu;, checks uav_bytes < 4u || base > uav_bytes - 4u strictly before buf.Load(base) and the buf.InterlockedCompareExchange(base, ...) loop, so any 2-byte guest write whose enclosing aligned DWORD [base, base + 4) does not fit in the bound host raw UAV returns immediately without an out-of-view Load or CAS retry.
    • STORE_D16_X_WORD3_ZERO_MASK = 0xcef80000 now documents the zeroed V# word 3 fields inline (TYPE[31:30], reserved [27:25], ADD_TID_ENABLE[23], INDEX_STRIDE[22:21], reserved [20:19]).
  2. Separate host-backing test & short-binding control (tests/compute_check.cpp, tests/offscreen_check.cpp, tests/startup_compute_store_d16_x_check.py, CMakeLists.txt):

    • Extended --compute-store-sized-case (descriptor-table u0 raw UAV + t0 raw SRV + b0 CBV) with an optional 6th argument uav_words (1..320, validated via std::from_chars) sizing uav.Buffer.NumElements = output_words while retaining the full 320-word readback check, and switched startup_compute_store_d16_x_check.py to it (GetDimensions requires a view descriptor rather than a root UAV).
    • Added Case B (guest OOB_SELECT=3, stride=0, num_records=6 writing 2-byte halves at addr = 0, 2, 4):
      • Valid padded binding (uav_words = 2, 8 bytes): updates DWORD 0 and low half of DWORD 1 while preserving high-half/trailing sentinels.
      • Short-binding control (uav_words = 1, 4 bytes, b-short-binding): same shader and guest num_records = 6; verifies host-bounded readback (DWORD 1 untouched sentinel) in dispatch and rejects at word=1 (expected=c5c59abc actual=c5c5c5c5) when checked against the padded expectation.
      • Boundary mutant (b-tight-host-guard): tightening base > uav_bytes - 4u to base > uav_bytes - 8u on uav_words = 2 rejects at word=1 on both adapters.
  3. Local Verification (41bd92bf):

    • 29/29 CTest checks (^startup_compute_store_d16_x, compute_desc_numeric, compute_store_aot_desc_numeric, startup_gfx2hlsl_compute) passed across WARP (1414:008c) and NVIDIA GeForce RTX 4070 SUPER (10de:2783) with debug_errors=0 debug_warnings=0.
    • startup_compute_store_d16_x_check.py, compute_desc_numeric_check.py, startup_gfx2hlsl_compute_check.py, and startup_mesh57_skeleton_check.py all passed (awaiting GitHub Actions Windows + Linux CI on the new HEAD).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7172411862 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7172411862). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-25T19:31:19Z. --- AI-assisted update addressing the host-backing-boundary review feedback (@R0Y00) and descriptor bit-field note (@ChazY11) at commit `41bd92bf7e8cde64085c3d4d35287b51459bd6a8`: 1. **Enclosing-DWORD host-backing check in `store_format_d16_x` (`tools/startup/gfx2hlsl.py`)**: - The translated helper now queries the bound raw UAV byte size with `buf.GetDimensions(uav_bytes);` and enforces host bounds separately from guest `num_records`/`stride`: - `BUF_FMT_32_FLOAT` (`fmt == 22u`): checks `uav_bytes < 4u || addr > uav_bytes - 4u` before `buf.Store(addr, ...)`. - 16-bit atomic CAS paths: after `uint base = addr & 0xfffffffcu;`, checks `uav_bytes < 4u || base > uav_bytes - 4u` strictly **before** `buf.Load(base)` and the `buf.InterlockedCompareExchange(base, ...)` loop, so any 2-byte guest write whose enclosing aligned DWORD `[base, base + 4)` does not fit in the bound host raw UAV returns immediately without an out-of-view `Load` or CAS retry. - `STORE_D16_X_WORD3_ZERO_MASK = 0xcef80000` now documents the zeroed V# word 3 fields inline (`TYPE[31:30]`, reserved `[27:25]`, `ADD_TID_ENABLE[23]`, `INDEX_STRIDE[22:21]`, reserved `[20:19]`). 2. **Separate host-backing test & short-binding control (`tests/compute_check.cpp`, `tests/offscreen_check.cpp`, `tests/startup_compute_store_d16_x_check.py`, `CMakeLists.txt`)**: - Extended `--compute-store-sized-case` (descriptor-table `u0` raw UAV + `t0` raw SRV + `b0` CBV) with an optional 6th argument `uav_words` (`1..320`, validated via `std::from_chars`) sizing `uav.Buffer.NumElements = output_words` while retaining the full 320-word readback check, and switched `startup_compute_store_d16_x_check.py` to it (`GetDimensions` requires a view descriptor rather than a root UAV). - Added Case `B` (guest `OOB_SELECT=3, stride=0, num_records=6` writing 2-byte halves at `addr = 0, 2, 4`): - Valid padded binding (`uav_words = 2`, 8 bytes): updates DWORD 0 and low half of DWORD 1 while preserving high-half/trailing sentinels. - Short-binding control (`uav_words = 1`, 4 bytes, `b-short-binding`): same shader and guest `num_records = 6`; verifies host-bounded readback (DWORD 1 untouched sentinel) in dispatch and rejects at `word=1` (`expected=c5c59abc actual=c5c5c5c5`) when checked against the padded expectation. - Boundary mutant (`b-tight-host-guard`): tightening `base > uav_bytes - 4u` to `base > uav_bytes - 8u` on `uav_words = 2` rejects at `word=1` on both adapters. 3. **Local Verification (`41bd92bf`)**: - `29/29` CTest checks (`^startup_compute_store_d16_x`, `compute_desc_numeric`, `compute_store_aot_desc_numeric`, `startup_gfx2hlsl_compute`) passed across WARP (`1414:008c`) and NVIDIA GeForce RTX 4070 SUPER (`10de:2783`) with `debug_errors=0 debug_warnings=0`. - `startup_compute_store_d16_x_check.py`, `compute_desc_numeric_check.py`, `startup_gfx2hlsl_compute_check.py`, and `startup_mesh57_skeleton_check.py` all passed (awaiting GitHub Actions Windows + Linux CI on the new HEAD).
tedin7 commented 2026-11-25 21:01:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:43:53Z.

Review: COMMENTED


Review of head c03ecd69 (main merged in, CI green): not ready to merge, one blocking test problem.

Blocking: the dispatch fixtures require the D3D12 debug layer.
tests/startup_compute_store_d16_x_check.py:693 asserts 'debug_errors=0 debug_warnings=0' in run.stdout. On a machine without the debug layer the runner prints debug_layer=unavailable and no such line, so the test fails even though the data compare is clean. This matches the report from @RavenCurseBurg above.

Win2025 WARP (dev, Windows Server 2025, WARP only, debug layer unavailable), regex startup_compute_store_d16_x:

  • startup_compute_store_d16_x_warp FAIL at case F-f32: compared_words=320 mismatches=0, then the assertion above fires.
  • b-short-binding_warp and b-tight-host-guard_warp FAIL: the required control ... rejected at word= text is not printed (same cause: the earlier assertion aborts the run).
  • The same three fail on the _hardware variants (the VM has only WARP, so those are the same failure, not extra signal).
  • startup_compute_store_d16_x_controls and the other controls pass.
    Release phase did not run (dev phase failed).

How to fix: accept debug_layer=unavailable (check debug_errors=0 debug_warnings=0 only when the runner reports the layer as active), keeping the strict check where the layer exists. The data compare (mismatches=0) stays the main guard.

Checked and fine

  • OOB_SELECT 0/3 handling and stride pairing, 32-bit overflow guards on soff + rec_off and idx * stride, CAS loop on the enclosing dword, host-backing guard (uav_words), windows.yml entries (both lists), CMake controls list.
  • No other open or merged PR covers buffer_store_format_d16_x.
  • Mutation note (Linux only): removing rec_off > stride - elem_bytes or the oob_sel refusal from the generated HLSL is not caught by the Python-only check. These runtime guards are covered only by the GPU dispatch controls, so they must run green on a machine without the debug layer.

Commands run: python3 tests/startup_compute_store_d16_x_check.py (pass), python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD (all clean), x2w_pipe.py win2025 2478 --wait 7200 --keep-release --regex startup_compute_store_d16_x (dev: 6 failed, as above).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6064724950 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#pullrequestreview-6064724950). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:43:53Z. **Review:** COMMENTED --- Review of head c03ecd69 (main merged in, CI green): not ready to merge, one blocking test problem. **Blocking: the dispatch fixtures require the D3D12 debug layer.** `tests/startup_compute_store_d16_x_check.py:693` asserts `'debug_errors=0 debug_warnings=0' in run.stdout`. On a machine without the debug layer the runner prints `debug_layer=unavailable` and no such line, so the test fails even though the data compare is clean. This matches the report from @RavenCurseBurg above. Win2025 WARP (dev, Windows Server 2025, WARP only, debug layer unavailable), regex `startup_compute_store_d16_x`: - `startup_compute_store_d16_x_warp` FAIL at case `F-f32`: `compared_words=320 mismatches=0`, then the assertion above fires. - `b-short-binding_warp` and `b-tight-host-guard_warp` FAIL: the required `control ... rejected at word=` text is not printed (same cause: the earlier assertion aborts the run). - The same three fail on the `_hardware` variants (the VM has only WARP, so those are the same failure, not extra signal). - `startup_compute_store_d16_x_controls` and the other controls pass. Release phase did not run (dev phase failed). **How to fix:** accept `debug_layer=unavailable` (check `debug_errors=0 debug_warnings=0` only when the runner reports the layer as active), keeping the strict check where the layer exists. The data compare (`mismatches=0`) stays the main guard. **Checked and fine** - OOB_SELECT 0/3 handling and stride pairing, 32-bit overflow guards on `soff + rec_off` and `idx * stride`, CAS loop on the enclosing dword, host-backing guard (`uav_words`), windows.yml entries (both lists), CMake controls list. - No other open or merged PR covers `buffer_store_format_d16_x`. - Mutation note (Linux only): removing `rec_off > stride - elem_bytes` or the `oob_sel` refusal from the generated HLSL is not caught by the Python-only check. These runtime guards are covered only by the GPU dispatch controls, so they must run green on a machine without the debug layer. Commands run: `python3 tests/startup_compute_store_d16_x_check.py` (pass), `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD` (all clean), `x2w_pipe.py win2025 2478 --wait 7200 --keep-release --regex startup_compute_store_d16_x` (dev: 6 failed, as above). AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 21:01:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T20:34:16Z.


While testing the sized-UAV runner used by #2530, I found a fixture result that depends on the D3D12 debug layer being installed. This is in the d16 test inherited unchanged from d96ffa28 into 3014c7b7. The Server 2025 WARP run with the debug layer enabled passed all 12 d16 CTests. Server 2025 logs

On Windows 11 build 26100.9711 without the optional debug layer I ran the same Debug binary on Intel UHD 770 (32.0.101.5973), RTX 4060 (32.0.15.9579) and WARP (10.0.26100.9711). On each, dispatch produced compared_words=320 mismatches=0 for F-f32 and then raised at the assertion requiring the literal debug_errors=0 debug_warnings=0. The renderer prints debug_layer=unavailable in this environment. The eight ordinary mutation controls passed. b-short-binding and b-tight-host-guard each detected the expected mismatch at word 1, then raised at the same debug-counter assertion.

The reproduction command is python -B tests/startup_compute_store_d16_x_check.py dispatch <dxc> <offscreen_check> hardware. The positive readback and the ability to certify a clear D3D12 debug queue are independently observable. The fixture could keep word comparisons active on those machines and report the debug-only portion as unavailable. On a device with a debug queue the zero-error requirement remains testable.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7173867218 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7173867218). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T20:34:16Z. --- While testing the sized-UAV runner used by #2530, I found a fixture result that depends on the D3D12 debug layer being installed. This is in the d16 test inherited unchanged from `d96ffa28` into `3014c7b7`. The Server 2025 WARP run with the debug layer enabled passed all 12 d16 CTests. [Server 2025 logs](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45694557498) On Windows 11 build 26100.9711 without the optional debug layer I ran the same Debug binary on Intel UHD 770 (32.0.101.5973), RTX 4060 (32.0.15.9579) and WARP (10.0.26100.9711). On each, `dispatch` produced `compared_words=320 mismatches=0` for `F-f32` and then raised at the assertion requiring the literal `debug_errors=0 debug_warnings=0`. The renderer prints `debug_layer=unavailable` in this environment. The eight ordinary mutation controls passed. `b-short-binding` and `b-tight-host-guard` each detected the expected mismatch at word 1, then raised at the same debug-counter assertion. The reproduction command is `python -B tests/startup_compute_store_d16_x_check.py dispatch <dxc> <offscreen_check> hardware`. The positive readback and the ability to certify a clear D3D12 debug queue are independently observable. The fixture could keep word comparisons active on those machines and report the debug-only portion as unavailable. On a device with a debug queue the zero-error requirement remains testable.
Vladimir-Human commented 2026-11-25 21:01:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vladimir-Human on 2026-11-25T20:49:11Z.


Thank you @RavenCurseBurg for catching that and testing the sized-UAV runner across machines without the optional Windows Graphics Tools debug layer!

Fixed in f02b35cd (tests/startup_compute_store_d16_x_check.py):

  • Added _check_debug_layer(stdout, label) matching the repo's existing pattern:
    • When debug_layer=enabled is reported, it still strictly asserts debug_errors=0 debug_warnings=0.
    • When debug_layer=unavailable is reported, it keeps all GPU word comparisons (mismatches=0, Case C contention sentinels) and b-short-binding / b-tight-host-guard mismatch assertions active and notes (debug_layer=unavailable) in the summary output.
    • Missing debug_layer= still fails.
  • Added unit tests in check_controls() covering all debug-layer states (enabled clean, enabled non-zero/missing errors, unavailable, and missing status).
  • Verified locally after the commit: startup_compute_store_d16_x_check.py unit checks pass, docs_links_check.py + bidi_controls_check.py pass, and all startup_compute_store_d16_x CTests pass on WARP and RTX 4070 SUPER (debug_layer=enabled, debug_errors=0 debug_warnings=0).
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174230715 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7174230715). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-25T20:49:11Z. --- Thank you @RavenCurseBurg for catching that and testing the sized-UAV runner across machines without the optional Windows Graphics Tools debug layer! Fixed in `f02b35cd` (`tests/startup_compute_store_d16_x_check.py`): - Added `_check_debug_layer(stdout, label)` matching the repo's existing pattern: - When `debug_layer=enabled` is reported, it still strictly asserts `debug_errors=0 debug_warnings=0`. - When `debug_layer=unavailable` is reported, it keeps all GPU word comparisons (`mismatches=0`, Case `C` contention sentinels) and `b-short-binding` / `b-tight-host-guard` mismatch assertions active and notes `(debug_layer=unavailable)` in the summary output. - Missing `debug_layer=` still fails. - Added unit tests in `check_controls()` covering all debug-layer states (`enabled` clean, `enabled` non-zero/missing errors, `unavailable`, and missing status). - Verified locally after the commit: `startup_compute_store_d16_x_check.py` unit checks pass, `docs_links_check.py` + `bidi_controls_check.py` pass, and all `startup_compute_store_d16_x` CTests pass on WARP and RTX 4070 SUPER (`debug_layer=enabled`, `debug_errors=0 debug_warnings=0`).
Vladimir-Human commented 2026-11-25 21:01:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vladimir-Human on 2026-11-25T20:51:47Z.


Thank you @tedin7 for the thorough verification and Win2025 trace on c03ecd69!

Pushed f02b35cd to resolve that blocking debug_layer=unavailable failure in tests/startup_compute_store_d16_x_check.py:

  • _check_debug_layer() now asserts debug_errors=0 debug_warnings=0 strictly whenever debug_layer=enabled, allows debug_layer=unavailable while keeping all GPU word comparisons (mismatches=0, Case C contention sentinels) and b-short-binding / b-tight-host-guard mismatch controls active, and still fails if debug_layer= is missing.
  • Unit checks in check_controls() now test all four debug-layer states.
  • Re-verified locally on f02b35cd: Python unit + docs_links_check.py + bidi_controls_check.py pass, and all 23/23 startup_compute_store_d16_x CTests pass on WARP and RTX 4070 SUPER (debug_layer=enabled, debug_errors=0 debug_warnings=0). CI is currently re-running on f02b35cd.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174289432 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7174289432). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-25T20:51:47Z. --- Thank you @tedin7 for the thorough verification and Win2025 trace on `c03ecd69`! Pushed `f02b35cd` to resolve that blocking `debug_layer=unavailable` failure in `tests/startup_compute_store_d16_x_check.py`: - `_check_debug_layer()` now asserts `debug_errors=0 debug_warnings=0` strictly whenever `debug_layer=enabled`, allows `debug_layer=unavailable` while keeping all GPU word comparisons (`mismatches=0`, Case `C` contention sentinels) and `b-short-binding` / `b-tight-host-guard` mismatch controls active, and still fails if `debug_layer=` is missing. - Unit checks in `check_controls()` now test all four debug-layer states. - Re-verified locally on `f02b35cd`: Python unit + `docs_links_check.py` + `bidi_controls_check.py` pass, and all 23/23 `startup_compute_store_d16_x` CTests pass on WARP and RTX 4070 SUPER (`debug_layer=enabled`, `debug_errors=0 debug_warnings=0`). CI is currently re-running on `f02b35cd`.
upstream-sync closed this pull request 2026-11-25 22:01:56 +00:00
R0Y00 commented 2026-11-25 22:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T21:22:49Z.


I resolved the registration conflict in 465aeff4, preserving both the upstream FMA controls and all d16 rows. On the resulting tree the Release WARP and RTX 4060 Laptop suite passed 25/25. The short binding and tight host guard controls still report the expected mismatch, and both nonmutated dispatches check the protected words. Keeping this scoped to d16 and the sized UAV fixture. #2530 remains behind this parent.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7174998553 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7174998553). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T21:22:49Z. --- I resolved the registration conflict in `465aeff4`, preserving both the upstream FMA controls and all d16 rows. On the resulting tree the Release WARP and RTX 4060 Laptop suite passed 25/25. The short binding and tight host guard controls still report the expected mismatch, and both nonmutated dispatches check the protected words. Keeping this scoped to d16 and the sized UAV fixture. #2530 remains behind this parent.
MasterDomino commented 2026-11-25 22:02:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T21:27:39Z.


AMD run for 465aeff4, complementing @R0Y00's WARP and RTX 4060 Laptop result.

  • Environment: Windows 11 build 26300, --preset dev, full build at 465aeff4. AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, with the D3D12 debug layer installed, so the debug_errors=0 assertion applies here.
  • Command: ctest --preset dev --no-tests=error -R 'store_d16_x|compute_desc_numeric|compute_store_aot_desc_numeric|startup_gfx2hlsl_compute' -V
  • Result: 55/55 passed, with no skips. That includes startup_compute_store_d16_x_b-short-binding_{warp,hardware} and …_b-tight-host-guard_{warp,hardware}, which report their expected mismatches, as the WILL_FAIL-style controls should.

One thing before merge: main moved after 465aeff4. git merge-tree against current main (6c7a59a2) conflicts again in CMakeLists.txt (test registration), and GitHub shows the PR as dirty. Once it's rebased and CI is green I can recheck and merge, unless @R0Y00 prefers to merge it himself.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7175106544 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2478#issuecomment-7175106544). Originally posted by [MasterDomino](https://github.com/MasterDomino) on 2026-11-25T21:27:39Z. --- AMD run for `465aeff4`, complementing @R0Y00's WARP and RTX 4060 Laptop result. - **Environment:** Windows 11 build 26300, `--preset dev`, full build at `465aeff4`. **AMD Radeon RX 9070 XT** (1002:7550, driver 32.0.32029.2010) and WARP 10.0.26100.9818, with the D3D12 debug layer installed, so the `debug_errors=0` assertion applies here. - **Command:** `ctest --preset dev --no-tests=error -R 'store_d16_x|compute_desc_numeric|compute_store_aot_desc_numeric|startup_gfx2hlsl_compute' -V` - **Result: 55/55 passed, with no skips.** That includes `startup_compute_store_d16_x_b-short-binding_{warp,hardware}` and `…_b-tight-host-guard_{warp,hardware}`, which report their expected mismatches, as the `WILL_FAIL`-style controls should. One thing before merge: `main` moved after `465aeff4`. `git merge-tree` against current `main` (`6c7a59a2`) conflicts again in `CMakeLists.txt` (test registration), and GitHub shows the PR as dirty. Once it's rebased and CI is green I can recheck and merge, unless @R0Y00 prefers to merge it himself. AI-assisted; commands listed were executed locally.
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!2470
No description provided.