runtime: bind published typed buffer outputs with 32-bit components #3397

Merged
Not-Saii merged 17 commits from upstream-pr/3397 into main 2026-11-29 14:39:22 +00:00
Not-Saii commented 2026-11-28 19:58:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-28T19:58:23Z.


Refs #3224

Stacked on #3386 (typed buffer inputs). It uses #3386's typed_bytes slot field and its gfx10 FORMAT helper, and turns #3386's descriptor checks into one function shared by inputs and outputs. Until #3386 merges, this diff also shows #3386's commits. This PR's own commits are 4598d597, 3d93cffa (docs), 31417719 and 75ceff67 (review cases) and d518ea38 (measurements). 3b5679f7, ef2b55db, 91beb2eb and 4932e061 merge #3386 and, through it, main up to 8a30428a. I'll rebase once #3386 lands.

Behavior

In @Leyukaka's measurement of #3386, 32 programs (2,001,657 dispatches) move from SRV kind typed_buffer_srv to UAV kind typed_buffer_uav, which makes it the largest remaining "compiles, but no runtime manifest" reason. These programs store with buffer_store_format_x to _xyzw (MUBUF, element index only), which the direct compiler writes as an RWBuffer<uint4>.

  • Manifest (src/direct_compute_cache.cpp): writes uav <register> typed table <parameter> <byte> bytes <n>, where n is 4 bytes per stored component. The compiler already refuses mixed store widths on one slot.
  • Stand-in (src/startup_stubs/d3d12_compute_dispatch.inl): binds a UINT typed UAV of the title's 32-bit components whose channel count equals the stored components. It reuses existing paths instead of adding a parallel one:
    • Hardware descriptor: #3302's published D16 output path, now with a typed element width. Every #3229 placement reason still applies. The FORMAT, stride, DST_SEL and bounds checks are the ones #3386 uses for inputs, now shared, plus an exact channel count.
    • Slot 19 token: native_buffer_store_view, the in-process native route's typed-store contract, so both routes accept the same views.
    • Typed UAV store support: D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE is checked by one helper for these outputs, #3302's half-float ones and #3389's packed D16 ones (moved from inline code; behavior unchanged). R32G32B32 has no typed UAV, so 3-component stores are refused by name.
  • Each refusal has its own reason, listed in docs/experiments/compute-typed-buffer-inputs.md. 8- and 16-bit formats, UNORM, SNORM and 16-bit FLOAT stay refused, because a UINT view does not convert.
  • tests/native_compute_manifest_reasons.cpp: the UAV kind typed_buffer_uav case now uses a 20-byte width that the line cannot carry. It used to rely on a zero width.
  • The merges with main keep #3389's packed_d16_x output path and #3454's indexed atomic UAV next to this one: their manifest branches, parser lines, token checks and messages are unchanged.

Manifest route only. As on #3386: a default run (X2W_NATIVE_SHADERS_ONLY=1, since #3449) does not read the uav typed line, and the in-process route still refuses typed_buffer_uav with view kind 8 is not bound for a natively translated program. The binding applies to runs with X2W_NATIVE_SHADERS_ONLY=0 and compile_dxil manifests. Binding the kind on the in-process route is a separate change.

Not in this PR: whether the 32 programs dispatch translated. A published manifest can still stop at a runtime input check, such as the placed-buffer check of #2860 / #2862.

Tests

tests/startup_compute_typed_buffer_uav_check.py (tests/cmake/startup_compute_typed_buffer_uav.cmake) uses the published route: compile_dxil --requests → <key>.txt → slot 14 Dispatch on the stand-in.

  • _controls (no GPU): source-built stores of 1 to 4 components publish uav 0 typed table 1 32 bytes 4n.
  • _warp / _hardware: each of the 384 lanes stores words computed from its element index through a 32-bit FLOAT descriptor of 50 elements, so only those elements change.
    • The 1-component case also stores through the consumer's slot 19 R32_UINT token (312 elements from element 4), and a structured token must be refused.
    • The 2- and 4-component cases also store through a slot 19 R32G32_UINT or R32G32B32A32_UINT token 16 bytes into the output (the consumer's view replaced through X2W_TEST_DISPATCH_UAV), and an R32_UINT token must be refused.
    • Each width also stores through its UINT and SINT FORMATs, and through a descriptor 8 bytes into the output (dispatch-records32-output-offset). 1 and 2 components store shifted by that much; 3 and 4 components are refused as not element-aligned.
    • Refusal controls, each with the output untouched: an 8_8_8_8_UNORM FORMAT, a wrong stride, word 1 bit 30, OOB_SELECT 3, a legacy FORMAT, a FORMAT of another width, and swapped X/Y DST_SEL. The other word 1 and word 3 bits and the indirect refusal are shared with the inputs and covered by #3386's checks.
    • Before publication the dispatch reports no translation.

Verification

Branch head 4932e061, on main 8a30428a. Measured at d518ea38 (main e3f9a64f) and again at 4932e061. Windows 11 build 26300, MSVC x64 Debug, Windows SDK 10.0.26100 DXC, D3D12 debug layer enabled.

.\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --target compile_dxil d3d12_xs_shim startup_stream_consumer offscreen_check native_compute_manifest_reasons
ctest --preset dev --no-tests=error -V -R "^(startup_compute_typed_buffer_(srv|uav)_(controls|hardware)|native_compute_manifest_reasons|startup_slot67_indirect_dispatch_hardware|startup_compute_packed_d16_x_uav_(controls|hardware)|startup_compute_half_buffer_uav_hardware|startup_compute_indexed_atomic_uav_.*)$"

At 4932e061, 11 passed and 1 skipped (startup_compute_indexed_atomic_uav_warp, 77), on NVIDIA GeForce RTX 4090, driver 32.0.16.1088, with no debug layer errors:

  • startup_compute_typed_buffer_uav_hardware: 1, 2 and 4 components stored their 50 elements, the UINT and SINT FORMATs stored the same words, an 8-byte base shifted the 1- and 2-component stores, the R32_UINT token stored 312, the 2- and 4-component tokens stored 50, and 7, 8, 8 and 9 refusal controls passed. The 3-component store was refused with an output typed buffer format does not support typed UAV stores.
  • startup_compute_typed_buffer_srv_hardware: 8, 11, 11 and 12 refusal controls, the token and the null descriptor (#3386's cases on the shared checks).
  • _controls, native_compute_manifest_reasons (38 cases), startup_slot67_indirect_dispatch_hardware, and the merged paths startup_compute_packed_d16_x_uav_controls / _hardware, startup_compute_indexed_atomic_uav_controls / _hardware and startup_compute_half_buffer_uav_hardware.

Mutations, each applied alone with the shim rebuilt, then reverted. Each fails its check:

  • Token binding width slot.typed_bytes → 4 (Leyukaka's gap 1): fails _hardware at the 2-component token (word 4 expected 3f800000, read c5c5c5c5).
  • Gaps 2–4 are in the shared lines: the word 3 mask 0xfff80000 → 0xff000000, (words[1] >> 30) → ((words[1] >> 30) & 1), and dropping || slot.typed_bytes from the indirect refusal each fail #3386's checks (details there).
  • From the earlier review (at 31417719): the output FirstElement → 0, the dropped element-alignment check, FORMAT rows 1, 2 and 4, and the dropped word 1 bits each fail _hardware. Row 3 is caught only by #3386's check, because no 3-component typed UAV store runs on this adapter.

_warp (Microsoft Basic Render Driver 10.0.26100.9818): capability skip (77). WARP reports 4-lane waves and the direct module needs 32. Negative control (at 3d93cffa): with the stand-in's parse of the uav typed line disabled, _hardware fails at word 0 (expected 3f800000, read c5c5c5c5).

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5544042000 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-28T19:58:23Z. --- Refs #3224 **Stacked on #3386** (typed buffer inputs). It uses #3386's `typed_bytes` slot field and its gfx10 FORMAT helper, and turns #3386's descriptor checks into one function shared by inputs and outputs. Until #3386 merges, this diff also shows #3386's commits. This PR's own commits are `4598d597`, `3d93cffa` (docs), `31417719` and `75ceff67` (review cases) and `d518ea38` (measurements). `3b5679f7`, `ef2b55db`, `91beb2eb` and `4932e061` merge #3386 and, through it, `main` up to `8a30428a`. I'll rebase once #3386 lands. ## Behavior In @Leyukaka's measurement of #3386, 32 programs (2,001,657 dispatches) move from `SRV kind typed_buffer_srv` to `UAV kind typed_buffer_uav`, which makes it the largest remaining "compiles, but no runtime manifest" reason. These programs store with `buffer_store_format_x` to `_xyzw` (MUBUF, element index only), which the direct compiler writes as an `RWBuffer<uint4>`. - **Manifest** (`src/direct_compute_cache.cpp`): writes `uav <register> typed table <parameter> <byte> bytes <n>`, where `n` is 4 bytes per stored component. The compiler already refuses mixed store widths on one slot. - **Stand-in** (`src/startup_stubs/d3d12_compute_dispatch.inl`): binds a UINT typed UAV of the title's 32-bit components whose channel count equals the stored components. It reuses existing paths instead of adding a parallel one: - **Hardware descriptor:** #3302's published D16 output path, now with a typed element width. Every #3229 placement reason still applies. The FORMAT, stride, DST_SEL and bounds checks are the ones #3386 uses for inputs, now shared, plus an exact channel count. - **Slot 19 token:** `native_buffer_store_view`, the in-process native route's typed-store contract, so both routes accept the same views. - **Typed UAV store support:** `D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE` is checked by one helper for these outputs, #3302's half-float ones and #3389's packed D16 ones (moved from inline code; behavior unchanged). R32G32B32 has no typed UAV, so 3-component stores are refused by name. - Each refusal has its own reason, listed in `docs/experiments/compute-typed-buffer-inputs.md`. 8- and 16-bit formats, UNORM, SNORM and 16-bit FLOAT stay refused, because a UINT view does not convert. - `tests/native_compute_manifest_reasons.cpp`: the `UAV kind typed_buffer_uav` case now uses a 20-byte width that the line cannot carry. It used to rely on a zero width. - The merges with `main` keep #3389's `packed_d16_x` output path and #3454's indexed atomic UAV next to this one: their manifest branches, parser lines, token checks and messages are unchanged. **Manifest route only.** As on #3386: a default run (`X2W_NATIVE_SHADERS_ONLY=1`, since #3449) does not read the `uav typed` line, and the in-process route still refuses `typed_buffer_uav` with `view kind 8 is not bound for a natively translated program`. The binding applies to runs with `X2W_NATIVE_SHADERS_ONLY=0` and `compile_dxil` manifests. Binding the kind on the in-process route is a separate change. Not in this PR: whether the 32 programs dispatch translated. A published manifest can still stop at a runtime input check, such as the placed-buffer check of #2860 / #2862. ## Tests `tests/startup_compute_typed_buffer_uav_check.py` (`tests/cmake/startup_compute_typed_buffer_uav.cmake`) uses the published route: `compile_dxil --requests` → `<key>.txt` → slot 14 Dispatch on the stand-in. - `_controls` (no GPU): source-built stores of 1 to 4 components publish `uav 0 typed table 1 32 bytes 4n`. - `_warp` / `_hardware`: each of the 384 lanes stores words computed from its element index through a 32-bit FLOAT descriptor of 50 elements, so only those elements change. - The 1-component case also stores through the consumer's slot 19 `R32_UINT` token (312 elements from element 4), and a structured token must be refused. - The 2- and 4-component cases also store through a slot 19 `R32G32_UINT` or `R32G32B32A32_UINT` token 16 bytes into the output (the consumer's view replaced through `X2W_TEST_DISPATCH_UAV`), and an `R32_UINT` token must be refused. - Each width also stores through its UINT and SINT FORMATs, and through a descriptor 8 bytes into the output (`dispatch-records32-output-offset`). 1 and 2 components store shifted by that much; 3 and 4 components are refused as not element-aligned. - Refusal controls, each with the output untouched: an 8_8_8_8_UNORM FORMAT, a wrong stride, word 1 bit 30, OOB_SELECT 3, a legacy FORMAT, a FORMAT of another width, and swapped X/Y DST_SEL. The other word 1 and word 3 bits and the indirect refusal are shared with the inputs and covered by #3386's checks. - Before publication the dispatch reports `no translation`. ## Verification Branch head `4932e061`, on `main` `8a30428a`. Measured at `d518ea38` (`main` `e3f9a64f`) and again at `4932e061`. Windows 11 build 26300, MSVC x64 Debug, Windows SDK 10.0.26100 DXC, D3D12 debug layer enabled. ```powershell .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev --target compile_dxil d3d12_xs_shim startup_stream_consumer offscreen_check native_compute_manifest_reasons ctest --preset dev --no-tests=error -V -R "^(startup_compute_typed_buffer_(srv|uav)_(controls|hardware)|native_compute_manifest_reasons|startup_slot67_indirect_dispatch_hardware|startup_compute_packed_d16_x_uav_(controls|hardware)|startup_compute_half_buffer_uav_hardware|startup_compute_indexed_atomic_uav_.*)$" ``` At `4932e061`, 11 passed and 1 skipped (`startup_compute_indexed_atomic_uav_warp`, 77), on NVIDIA GeForce RTX 4090, driver 32.0.16.1088, with no debug layer errors: - `startup_compute_typed_buffer_uav_hardware`: 1, 2 and 4 components stored their 50 elements, the UINT and SINT FORMATs stored the same words, an 8-byte base shifted the 1- and 2-component stores, the `R32_UINT` token stored 312, the 2- and 4-component tokens stored 50, and 7, 8, 8 and 9 refusal controls passed. The 3-component store was refused with `an output typed buffer format does not support typed UAV stores`. - `startup_compute_typed_buffer_srv_hardware`: 8, 11, 11 and 12 refusal controls, the token and the null descriptor (#3386's cases on the shared checks). - `_controls`, `native_compute_manifest_reasons` (38 cases), `startup_slot67_indirect_dispatch_hardware`, and the merged paths `startup_compute_packed_d16_x_uav_controls` / `_hardware`, `startup_compute_indexed_atomic_uav_controls` / `_hardware` and `startup_compute_half_buffer_uav_hardware`. Mutations, each applied alone with the shim rebuilt, then reverted. Each fails its check: - Token binding width `slot.typed_bytes` → `4` (Leyukaka's gap 1): fails `_hardware` at the 2-component token (`word 4 expected 3f800000, read c5c5c5c5`). - Gaps 2–4 are in the shared lines: the word 3 mask `0xfff80000` → `0xff000000`, `(words[1] >> 30)` → `((words[1] >> 30) & 1)`, and dropping `|| slot.typed_bytes` from the indirect refusal each fail #3386's checks (details there). - From the earlier review (at `31417719`): the output `FirstElement` → 0, the dropped element-alignment check, FORMAT rows 1, 2 and 4, and the dropped word 1 bits each fail `_hardware`. Row 3 is caught only by #3386's check, because no 3-component typed UAV store runs on this adapter. `_warp` (Microsoft Basic Render Driver 10.0.26100.9818): capability skip (77). WARP reports 4-lane waves and the direct module needs 32. Negative control (at `3d93cffa`): with the stand-in's parse of the `uav typed` line disabled, `_hardware` fails at word 0 (`expected 3f800000, read c5c5c5c5`). AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KelboLive commented 2026-11-28 20:33:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:33:46Z.

Review: APPROVED


LGTM — thorough, well-documented.

Adds typed buffer inputs (buffer_load_format_) and outputs (buffer_store_format_) on the published compute route. Helper functions validate gfx10 unified buffer FORMAT, stride, DST_SEL, bounds mode, and typed UAV store support. Manifest emits srv/uav typed table <param> <byte> bytes <n> lines. Dispatch stub resolves table entries, binds UINT views of 32-bit components, and refuses invalid descriptors with precise reasons. Test fixtures cover 1–4 components, UINT/SINT FORMATs, view tokens, and multiple refusal controls per width.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6099976240 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#pullrequestreview-6099976240). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T20:33:46Z. **Review:** APPROVED --- LGTM — thorough, well-documented. Adds typed buffer inputs (buffer_load_format_*) and outputs (buffer_store_format_*) on the published compute route. Helper functions validate gfx10 unified buffer FORMAT, stride, DST_SEL, bounds mode, and typed UAV store support. Manifest emits `srv/uav typed table <param> <byte> bytes <n>` lines. Dispatch stub resolves table entries, binds UINT views of 32-bit components, and refuses invalid descriptors with precise reasons. Test fixtures cover 1–4 components, UINT/SINT FORMATs, view tokens, and multiple refusal controls per width. Ready to land.
KelboLive commented 2026-11-28 21:02:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:02:31Z.

Review: APPROVED


LGTM — clean, well-tested.

Adds srv/uav typed manifest lines for 32-bit component typed buffer inputs and outputs. typed_dword_format_channels maps gfx10 unified FORMAT codes to channel counts; typed_dword_descriptor validates FORMAT, stride, DST_SEL, and bounds mode; typed_dword_input_view resolves table descriptors and view tokens to UINT views; typed_buffer_store_supported checks UAV_TYPED_STORE capability. Each invalid shape is refused with a named reason. Test fixtures cover 1-4 component inputs and outputs with negative controls.

Ready to land.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100074984 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#pullrequestreview-6100074984). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:02:31Z. **Review:** APPROVED --- LGTM — clean, well-tested. Adds srv/uav typed manifest lines for 32-bit component typed buffer inputs and outputs. typed_dword_format_channels maps gfx10 unified FORMAT codes to channel counts; typed_dword_descriptor validates FORMAT, stride, DST_SEL, and bounds mode; typed_dword_input_view resolves table descriptors and view tokens to UINT views; typed_buffer_store_supported checks UAV_TYPED_STORE capability. Each invalid shape is refused with a named reason. Test fixtures cover 1-4 component inputs and outputs with negative controls. Ready to land.
KelboLive commented 2026-11-28 21:12:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:12:10Z.

Review: APPROVED


LGTM — publishes typed buffer inputs and outputs on the compute manifest route.

Adds srv typed and uav typed manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability.

Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views.

Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores.

Documentation is thorough with clear validation rules and measured results.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100106362 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#pullrequestreview-6100106362). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:12:10Z. **Review:** APPROVED --- LGTM — publishes typed buffer inputs and outputs on the compute manifest route. Adds `srv typed` and `uav typed` manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability. Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views. Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores. Documentation is thorough with clear validation rules and measured results.
KelboLive commented 2026-11-28 21:56:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:56:51Z.

Review: APPROVED


LGTM — publishes typed buffer inputs and outputs on the compute manifest route.

Adds srv typed and uav typed manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability.

Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views.

Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores.

Documentation is thorough with clear validation rules and measured results.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6100252191 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#pullrequestreview-6100252191). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-28T21:56:51Z. **Review:** APPROVED --- LGTM — publishes typed buffer inputs and outputs on the compute manifest route. Adds `srv typed` and `uav typed` manifest lines for buffer_load_format_* and buffer_store_format_* bindings. The runtime reader resolves them as UINT views of 32-bit components with FORMAT/stride/DST_SEL/bounds validation. typed_dword_descriptor checks hardware descriptors; typed_dword_input_view handles view tokens and null buffers. typed_buffer_store_supported checks UAV store capability. Refusal reasons cover FORMAT width, stride, DST_SEL, swizzle, channel count, element alignment, and token compatibility. Indirect dispatch requires fixed-table raw buffers for typed views. Tests cover 1-4 component widths, UINT/SINT/FLOAT FORMATs, view tokens, and multiple invalid descriptor controls. Manifest reasons test updated to reject 20-byte typed stores. Documentation is thorough with clear validation rules and measured results.
Leyukaka commented 2026-11-28 22:27:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T22:27:59Z.


Reviewed 31417719 by its diff (it carries #3386 up to da4fe59c). The binding logic reads correctly: 32-bit UINT/SINT/FLOAT only, FORMAT width equal to the stored components, stride 4 × channels, FirstElement from an element-aligned offset, write-back through the existing placed-alias UAV path, indirect dispatch refused. Test gaps, each a one-line change that the current cases would not catch (by reading):

  1. Token binding: tokens are only tested with one component, so slot.typed_bytes → 4 would accept a 2-4 component store through an R32 view. A token case with two or four components would catch it.
  2. Word 3: no case sets ADD_TID or INDEX_STRIDE, so the mask 0xfff80000u → 0xff000000u passes.
  3. Word 1: bit 31 is never set, so (words[1] >> 30) → ((words[1] >> 30) & 1) passes.
  4. Indirect: there is no indirect typed case, so dropping || slot.typed_bytes from the indirect refusal passes.

Gaps 2-4 are in lines that arrive with #3386 and now sit in the shared typed_dword_descriptor, so they cover the input path too.

Minor: the docs say six refusal controls per width; the script now runs 7, 7, 8 and 8.

This changes runtime binding, so a start-up run before and after is the useful check; in the 900 s census on #3224, UAV kind typed_buffer_uav was the next refusal for 32 of the 112 typed-buffer-input programs (2,001,657 dispatches; measured on #3386).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7246754542 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#issuecomment-7246754542). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T22:27:59Z. --- Reviewed `31417719` by its diff (it carries #3386 up to `da4fe59c`). The binding logic reads correctly: 32-bit UINT/SINT/FLOAT only, FORMAT width equal to the stored components, stride 4 × channels, FirstElement from an element-aligned offset, write-back through the existing placed-alias UAV path, indirect dispatch refused. Test gaps, each a one-line change that the current cases would not catch (by reading): 1. Token binding: tokens are only tested with one component, so `slot.typed_bytes` → `4` would accept a 2-4 component store through an R32 view. A token case with two or four components would catch it. 2. Word 3: no case sets ADD_TID or INDEX_STRIDE, so the mask `0xfff80000u` → `0xff000000u` passes. 3. Word 1: bit 31 is never set, so `(words[1] >> 30)` → `((words[1] >> 30) & 1)` passes. 4. Indirect: there is no indirect typed case, so dropping `|| slot.typed_bytes` from the indirect refusal passes. Gaps 2-4 are in lines that arrive with #3386 and now sit in the shared `typed_dword_descriptor`, so they cover the input path too. Minor: the docs say six refusal controls per width; the script now runs 7, 7, 8 and 8. This changes runtime binding, so a start-up run before and after is the useful check; in the 900 s census on #3224, `UAV kind typed_buffer_uav` was the next refusal for 32 of the 112 typed-buffer-input programs (2,001,657 dispatches; measured on #3386).
JohnConnorNPC commented 2026-11-29 12:40:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:40:46Z.


Review of head 31417719 against main 77d1ba4d. This PR is stacked on #3386 (git merge-base --is-ancestor da4fe59c 31417719 → true), and its own 4 commits are 4598d597..31417719. The output path reads correctly. typed_dword_descriptor is shared with the input path. The FORMAT width must equal the stored components (channels * 4 != typed_bytes). FirstElement = offset / element and NumElements = words[2]. R32G32B32 is refused through typed_buffer_store_supported. The fixture's 0xe0002000 | (3 + channels) << 18 encodes MUBUF buffer_store_format_x..xyzw (ops 4–7) with idxen, and 0x80080108 encodes vaddr v8, vdata v1, s[32:35] and soffset 0. Both match the comments.

MUST

  1. Conflict with main. git merge-tree --write-tree --name-only origin/main 31417719 exits 1 in src/direct_compute_cache.cpp and src/startup_stubs/d3d12_compute_dispatch.inl. This is the same identity_dst_sel conflict as #3386. Please land #3386 first, then merge main here with the same resolution.

SHOULD

  1. No effect on the default launcher path. This is the same gap as on #3386. With X2W_NATIVE_SHADERS_ONLY=1 (the default since #3449), load_compute_translation returns before it reads uav <i> typed table. translate_compute_natively still refuses typed_buffer_uav as view kind 8 is not bound for a natively translated program. The 32 of 112 programs from the census in #3224 that this targets stay refused in a default run. Please state that in the body and doc, or bind the kind on the in-process route.
  2. The four test gaps and the stale control count from the 22:27 review are still open on 31417719, which is the head that review covered. I won't repeat them here.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7255985490 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#issuecomment-7255985490). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T12:40:46Z. --- Review of head `31417719` against `main` `77d1ba4d`. This PR is stacked on #3386 (`git merge-base --is-ancestor da4fe59c 31417719` → true), and its own 4 commits are `4598d597..31417719`. The output path reads correctly. `typed_dword_descriptor` is shared with the input path. The FORMAT width must equal the stored components (`channels * 4 != typed_bytes`). `FirstElement = offset / element` and `NumElements = words[2]`. R32G32B32 is refused through `typed_buffer_store_supported`. The fixture's `0xe0002000 | (3 + channels) << 18` encodes MUBUF `buffer_store_format_x..xyzw` (ops 4–7) with idxen, and `0x80080108` encodes vaddr v8, vdata v1, s[32:35] and soffset 0. Both match the comments. **MUST** 1. **Conflict with `main`.** `git merge-tree --write-tree --name-only origin/main 31417719` exits 1 in `src/direct_compute_cache.cpp` and `src/startup_stubs/d3d12_compute_dispatch.inl`. This is the same `identity_dst_sel` conflict as #3386. Please land #3386 first, then merge `main` here with the same resolution. **SHOULD** 2. **No effect on the default launcher path.** This is the same gap as on #3386. With `X2W_NATIVE_SHADERS_ONLY=1` (the default since #3449), `load_compute_translation` returns before it reads `uav <i> typed table`. `translate_compute_natively` still refuses `typed_buffer_uav` as `view kind 8 is not bound for a natively translated program`. The 32 of 112 programs from the census in #3224 that this targets stay refused in a default run. Please state that in the body and doc, or bind the kind on the in-process route. 3. The four test gaps and the stale control count from the 22:27 review are still open on `31417719`, which is the head that review covered. I won't repeat them here. AI-assisted.
Not-Saii commented 2026-11-29 14:24:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-29T14:24:21Z.


@Leyukaka @JohnConnorNPC Thanks. Head is now 4932e061, which carries #3386 at 4cd38c90 and merges cleanly with main 8a30428a.

Conflicts. I merged #3386's resolution of the identity_dst_sel conflict. Two other paths from main met this branch's lines:

  • #3389's packed_d16_x output (ef2b55db): its manifest branch, token check and descriptor messages are kept next to the typed ones. Its typed UAV store check now uses the shared typed_buffer_store_supported, with the same result.
  • #3454's indexed atomic UAV (4932e061): its parser line and reason rows go next to the typed ones.

Leyukaka's review of 31417719:

  1. Token width. The 2- and 4-component stores now also write through a slot 19 R32G32_UINT / R32G32B32A32_UINT token 16 bytes into the output, and an R32_UINT token must be refused (75ceff67). With slot.typed_bytes → 4, the check fails at 2 channels, view token: word 4 expected 3f800000, read c5c5c5c5.
  2. to 4. Word 3 mask, word 1 bit 31, indirect. These lines come from #3386, so the cases are there, in startup_compute_typed_buffer_srv_check.py and startup_slot67_indirect_dispatch_check.py. Since the checks are shared, the same mutations fail those checks (details on #3386).
  • Control counts. Fixed. The check now runs 7, 8, 8 and 9 refusals per width.

JohnConnorNPC:

  1. Merged, as above. #3386 landing first and this branch then being rebased still works; the merges keep the stack an ancestor chain until then.
  2. Default launcher path. The body and doc now say that, as on #3386, uav typed is bound on the manifest route only. A default run still refuses typed_buffer_uav as view kind 8 is not bound for a natively translated program.
  3. Covered above.

Without mutations, these pass on 4932e061: startup_compute_typed_buffer_(srv|uav)_(controls|hardware), native_compute_manifest_reasons, startup_slot67_indirect_dispatch_hardware, startup_compute_packed_d16_x_uav_(controls|hardware), startup_compute_indexed_atomic_uav_(controls|hardware) and startup_compute_half_buffer_uav_hardware. startup_compute_indexed_atomic_uav_warp reports a capability skip (77). The setup was the NVIDIA GeForce RTX 4090, driver 32.0.16.1088, Windows 11 build 26300, Debug, with the debug layer enabled. On this adapter the 3-component store is still refused with an output typed buffer format does not support typed UAV stores.

A start-up run before and after (Leyukaka's suggestion) is not done. It would only show a difference with X2W_NATIVE_SHADERS_ONLY=0.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7257277373 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#issuecomment-7257277373). Originally posted by [Not-Saii](https://github.com/Not-Saii) on 2026-11-29T14:24:21Z. --- @Leyukaka @JohnConnorNPC Thanks. Head is now `4932e061`, which carries #3386 at `4cd38c90` and merges cleanly with `main` `8a30428a`. **Conflicts.** I merged #3386's resolution of the `identity_dst_sel` conflict. Two other paths from `main` met this branch's lines: - #3389's `packed_d16_x` output (`ef2b55db`): its manifest branch, token check and descriptor messages are kept next to the typed ones. Its typed UAV store check now uses the shared `typed_buffer_store_supported`, with the same result. - #3454's indexed atomic UAV (`4932e061`): its parser line and reason rows go next to the typed ones. Leyukaka's review of `31417719`: 1. **Token width.** The 2- and 4-component stores now also write through a slot 19 `R32G32_UINT` / `R32G32B32A32_UINT` token 16 bytes into the output, and an `R32_UINT` token must be refused (`75ceff67`). With `slot.typed_bytes` → `4`, the check fails at `2 channels, view token: word 4 expected 3f800000, read c5c5c5c5`. 2. to 4. **Word 3 mask, word 1 bit 31, indirect.** These lines come from #3386, so the cases are there, in `startup_compute_typed_buffer_srv_check.py` and `startup_slot67_indirect_dispatch_check.py`. Since the checks are shared, the same mutations fail those checks (details on #3386). - **Control counts.** Fixed. The check now runs 7, 8, 8 and 9 refusals per width. JohnConnorNPC: 1. Merged, as above. #3386 landing first and this branch then being rebased still works; the merges keep the stack an ancestor chain until then. 2. **Default launcher path.** The body and doc now say that, as on #3386, `uav typed` is bound on the manifest route only. A default run still refuses `typed_buffer_uav` as `view kind 8 is not bound for a natively translated program`. 3. Covered above. Without mutations, these pass on `4932e061`: `startup_compute_typed_buffer_(srv|uav)_(controls|hardware)`, `native_compute_manifest_reasons`, `startup_slot67_indirect_dispatch_hardware`, `startup_compute_packed_d16_x_uav_(controls|hardware)`, `startup_compute_indexed_atomic_uav_(controls|hardware)` and `startup_compute_half_buffer_uav_hardware`. `startup_compute_indexed_atomic_uav_warp` reports a capability skip (77). The setup was the NVIDIA GeForce RTX 4090, driver 32.0.16.1088, Windows 11 build 26300, Debug, with the debug layer enabled. On this adapter the 3-component store is still refused with `an output typed buffer format does not support typed UAV stores`. A start-up run before and after (Leyukaka's suggestion) is not done. It would only show a difference with `X2W_NATIVE_SHADERS_ONLY=0`. AI-assisted.
Leyukaka commented 2026-11-29 14:37:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T14:37:49Z.

Review: APPROVED


Reviewed 4932e061 against main 8a30428a. It contains #3386 at 4cd38c90; this covers what it adds on top. Diff reading only, nothing run.

Since 31417719:

  • Gap 1, token width (75ceff67): the 2- and 4-component stores go through an R32G32_UINT / R32G32B32A32_UINT slot 19 token 16 bytes into the output, and an R32_UINT token must be refused (tests/startup_compute_typed_buffer_uav_check.py:179-183). The refused view fits its buffer, so the refusal comes from the format check of native_buffer_store_view, not from its bounds check. With slot.typed_bytes → 4 at src/startup_stubs/d3d12_compute_dispatch.inl:1083, both cases change result.
  • Gaps 2 to 4: the word 1 and word 3 checks are now in typed_dword_descriptor (d3d12_compute_dispatch.inl:171), which inputs and outputs both call, and the indirect refusal is one expression for both. The cases are in #3386's checks (tests/startup_compute_typed_buffer_srv_check.py:141-143, tests/startup_slot67_indirect_dispatch_check.py:209). The output check itself still sets only word 1 bit 30.
  • Merges (ef2b55db, 4932e061): the uav typed table parser branch sits between main's atomic and bufhalf / packed_d16_x branches (:389). The packed D16 token check and descriptor messages are kept. The inline CheckFeatureSupport blocks of the half and packed D16 paths become typed_buffer_store_supported (:190, used at :1201 and :1215), which is the same predicate negated. git merge-tree origin/main 4932e061 exits 0.
  • Doc: manifest route only (docs/experiments/compute-typed-buffer-inputs.md:100); control counts 7, 8, 8 and 9 (:125) match the script.

JohnConnorNPC's points 1 to 3 are addressed by the above.

NIT: docs/experiments/compute-typed-buffer-inputs.md:125 is 153 characters; the file wraps at about 115.

Not covered:

  • The pr test preset includes none of startup_compute_typed_buffer_(srv|uav)_*, native_compute_manifest_reasons or startup_slot67_indirect_dispatch_*, so the green CI builds these checks without running them. The pass and mutation results are the author's.
  • No start-up run before and after. As the author notes, it would differ only with X2W_NATIVE_SHADERS_ONLY=0.

#3386 should merge first; this branch already contains its head, so either order merges cleanly on 8a30428a.

Approve 4932e061.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6103332470 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#pullrequestreview-6103332470). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-29T14:37:49Z. **Review:** APPROVED --- Reviewed `4932e061` against `main` `8a30428a`. It contains #3386 at `4cd38c90`; this covers what it adds on top. Diff reading only, nothing run. Since `31417719`: - **Gap 1, token width** (`75ceff67`): the 2- and 4-component stores go through an `R32G32_UINT` / `R32G32B32A32_UINT` slot 19 token 16 bytes into the output, and an `R32_UINT` token must be refused (`tests/startup_compute_typed_buffer_uav_check.py:179-183`). The refused view fits its buffer, so the refusal comes from the format check of `native_buffer_store_view`, not from its bounds check. With `slot.typed_bytes` → `4` at `src/startup_stubs/d3d12_compute_dispatch.inl:1083`, both cases change result. - **Gaps 2 to 4**: the word 1 and word 3 checks are now in `typed_dword_descriptor` (`d3d12_compute_dispatch.inl:171`), which inputs and outputs both call, and the indirect refusal is one expression for both. The cases are in #3386's checks (`tests/startup_compute_typed_buffer_srv_check.py:141-143`, `tests/startup_slot67_indirect_dispatch_check.py:209`). The output check itself still sets only word 1 bit 30. - **Merges** (`ef2b55db`, `4932e061`): the `uav typed table` parser branch sits between `main`'s `atomic` and `bufhalf` / `packed_d16_x` branches (`:389`). The packed D16 token check and descriptor messages are kept. The inline `CheckFeatureSupport` blocks of the half and packed D16 paths become `typed_buffer_store_supported` (`:190`, used at `:1201` and `:1215`), which is the same predicate negated. `git merge-tree origin/main 4932e061` exits 0. - **Doc**: manifest route only (`docs/experiments/compute-typed-buffer-inputs.md:100`); control counts 7, 8, 8 and 9 (`:125`) match the script. JohnConnorNPC's points 1 to 3 are addressed by the above. NIT: `docs/experiments/compute-typed-buffer-inputs.md:125` is 153 characters; the file wraps at about 115. Not covered: - The `pr` test preset includes none of `startup_compute_typed_buffer_(srv|uav)_*`, `native_compute_manifest_reasons` or `startup_slot67_indirect_dispatch_*`, so the green CI builds these checks without running them. The pass and mutation results are the author's. - No start-up run before and after. As the author notes, it would differ only with `X2W_NATIVE_SHADERS_ONLY=0`. #3386 should merge first; this branch already contains its head, so either order merges cleanly on `8a30428a`. Approve `4932e061`.
JohnConnorNPC commented 2026-11-29 14:39:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T14:39:19Z.


Re-review at 4932e061 (from 31417719), on main 8a30428a. These are new points only.

Status. The conflict is gone. git merge-tree --write-tree origin/main 4932e061 exits with rc=0 and git diff --check is clean. main has no commits past the merge base. CI passes on Merge 4932e061… into 8a30428a: Windows reports 100% tests passed out of 82, and the Linux and gfx1013 jobs pass too. The pr preset does not run the typed buffer tests, so the behaviour evidence is still the local _hardware and _controls runs listed above. #3386's head 4cd38c90 is an ancestor of this head, so merging this lands #3386 as well.

Delta checked against the code:

  • The input token reader now uses token_view(words, record) in place of a direct view_records()[words[1]] lookup. This covers content tokens.
  • The merge with #3389 keeps packed_d16_x and typed_bytes as separate slot fields. element is half_bytes ? half_bytes : typed_bytes, and packed only sets the 2-byte alignment and its own refusal strings. The packed store check now calls typed_buffer_store_supported, which runs the same CheckFeatureSupport test as the inline code it replaces (BUFFER | TYPED_UNORDERED_ACCESS_VIEW plus UAV_TYPED_STORE).
  • New cases:
    • 2- and 4-component dispatch-uav-token-typed views (FirstElement = TOKEN_WORD // channels), and an R32_UINT token refused at those widths.
    • dispatch-records32-input-null.
    • Word 1 bit 31, INDEX_STRIDE and ADD_TID on the input side.
    • srv 0 typed table 1 0 bytes 4 in the indirect check.
    • Two SRV kind typed_buffer_srv reason rows.
  • The control counts in the doc now match the check: 7/8/8/9 for outputs (6 base, +1 DST_SEL at more than 1 channel, +1 offset at 3 and 4 channels since OUTPUT_OFFSET = 8, +1 token at 1, 2 and 4 channels) and 8/11/11/12 for inputs.
  • The doc and the body now say the binding is on the manifest route only, and that the default X2W_NATIVE_SHADERS_ONLY=1 run is unchanged.

MUST: none. SHOULD: none.

NIT

  1. The output-side word 1 bit 31, INDEX_STRIDE and ADD_TID refusals are pinned only through the shared typed_dword_descriptor, by the SRV check. If the output path ever stops sharing that helper, those output refusals would have no case. Three rows in the UAV refusal table would pin them directly.
  2. The doc's measured paragraphs still say main e3f9a64f. The re-runs at 4932e061 / 8a30428a appear only in the PR thread. One line in the doc would keep the record next to the claim.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7257471871 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3397#issuecomment-7257471871). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-29T14:39:19Z. --- Re-review at `4932e061` (from `31417719`), on `main` `8a30428a`. These are new points only. **Status.** The conflict is gone. `git merge-tree --write-tree origin/main 4932e061` exits with rc=0 and `git diff --check` is clean. `main` has no commits past the merge base. CI passes on `Merge 4932e061… into 8a30428a`: Windows reports `100% tests passed out of 82`, and the Linux and gfx1013 jobs pass too. The `pr` preset does not run the typed buffer tests, so the behaviour evidence is still the local `_hardware` and `_controls` runs listed above. #3386's head `4cd38c90` is an ancestor of this head, so merging this lands #3386 as well. **Delta checked against the code:** - The input token reader now uses `token_view(words, record)` in place of a direct `view_records()[words[1]]` lookup. This covers content tokens. - The merge with #3389 keeps `packed_d16_x` and `typed_bytes` as separate slot fields. `element` is `half_bytes ? half_bytes : typed_bytes`, and `packed` only sets the 2-byte alignment and its own refusal strings. The packed store check now calls `typed_buffer_store_supported`, which runs the same `CheckFeatureSupport` test as the inline code it replaces (`BUFFER | TYPED_UNORDERED_ACCESS_VIEW` plus `UAV_TYPED_STORE`). - New cases: - 2- and 4-component `dispatch-uav-token-typed` views (`FirstElement = TOKEN_WORD // channels`), and an `R32_UINT` token refused at those widths. - `dispatch-records32-input-null`. - Word 1 bit 31, INDEX_STRIDE and ADD_TID on the input side. - `srv 0 typed table 1 0 bytes 4` in the indirect check. - Two `SRV kind typed_buffer_srv` reason rows. - The control counts in the doc now match the check: 7/8/8/9 for outputs (6 base, +1 DST_SEL at more than 1 channel, +1 offset at 3 and 4 channels since `OUTPUT_OFFSET = 8`, +1 token at 1, 2 and 4 channels) and 8/11/11/12 for inputs. - The doc and the body now say the binding is on the manifest route only, and that the default `X2W_NATIVE_SHADERS_ONLY=1` run is unchanged. **MUST:** none. **SHOULD:** none. **NIT** 1. The output-side word 1 bit 31, INDEX_STRIDE and ADD_TID refusals are pinned only through the shared `typed_dword_descriptor`, by the SRV check. If the output path ever stops sharing that helper, those output refusals would have no case. Three rows in the UAV refusal table would pin them directly. 2. The doc's measured paragraphs still say `main` `e3f9a64f`. The re-runs at `4932e061` / `8a30428a` appear only in the PR thread. One line in the doc would keep the record next to the claim. AI-assisted.
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!3397
No description provided.