runtime: raise compute manifest and dispatch UAV limit from 8 to 16 #3775

Manually merged
github merged 4 commits from github-bot/gh-3773 into gh-pr/3773/base 2026-12-02 16:06:13 +00:00 AGit
Owner

@⁠R0D4X on GitHub · 2026-12-01 18:09 UTC · original
R0D4X:compute/uav-limit-16 → main · +360 −18 · 9 files · 4 commits · merged 2026-12-02 16:05 UTC

Refs #3226

Summary

Raises the compute runtime manifest and dispatch UAV slot limit from 8 to 16 so the 36 wave32 start-up compute shaders already validated with DXIL shader flag 0x8000 (#3272; 9, 10, and 16 UAV bindings in the #3226 census) can publish a runtime manifest and dispatch:

  • src/direct_compute_cache.cpp (format_compute_runtime_manifest): Raises the compute UAV cap from 8 to 16 (more than 16 UAVs). Graphics manifests stay at 8.
  • src/startup_stubs/d3d12_compute_dispatch.inl: Raises tr.uavs.size() cap from 8 to 16 in both the disk manifest loader (load_compute_translation) and the live native path (translate_compute_natively).
  • src/startup_stubs/translated_sampler_bindings.h (create_translated_root): Expands parameters from 11 to 19 (1 constants + 1 view table + 1 sampler table + up to 16 atomic UAVs) and adds a bounds check returning E_INVALIDARG.
  • tools/startup/triage_run.py & tests/startup_triage_run_check.py: Recognizes both more than 8 UAVs (for older logs) and more than 16 UAVs.
  • tests/native_uav_slots_check.py: Validates DXIL compilation for 8, 9, 16, and 17 UAVs, checks compile_dxil --requests manifest publication (uav 0..uav N-1 + .cs.cso) for 8, 9, and 16 UAVs, and asserts 17 UAVs is refused with unsupported startup runtime manifest bindings: more than 16 UAVs.

Verification

Environment: Windows 11 x64 (10.0.26300.9974), MSVC 19.44.35230, Windows SDK / DXC 10.0.26100.0.

Commit under test: 062de148.

ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R "^(native_uav_slots_controls|startup_triage_run)$"
ctest --test-dir out/build/release --no-tests=error -j 1 -V -R "^(native_uav_slots_controls|startup_triage_run)$"
  • dev: 2/2 passed (0 skipped).
  • release: 2/2 passed (0 skipped).
  • Mutation check: Temporarily reverting uav_count > 16 back to uav_count > 8 in src/direct_compute_cache.cpp caused native_uav_slots_controls to fail on the 9-UAV manifest case (no_manifest ... more than 8 UAVs); after reverting src/, 2/2 passed again.

No game files, dumps, or private paths included.

**@⁠R0D4X** on GitHub · 2026-12-01 18:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3773) `R0D4X:compute/uav-limit-16` → `main` · +360 −18 · 9 files · 4 commits · merged 2026-12-02 16:05 UTC Refs #3226 ## Summary Raises the compute runtime manifest and dispatch UAV slot limit from 8 to 16 so the 36 wave32 start-up compute shaders already validated with DXIL shader flag `0x8000` (#3272; 9, 10, and 16 UAV bindings in the #3226 census) can publish a runtime manifest and dispatch: - **`src/direct_compute_cache.cpp` (`format_compute_runtime_manifest`):** Raises the compute UAV cap from 8 to 16 (`more than 16 UAVs`). Graphics manifests stay at 8. - **`src/startup_stubs/d3d12_compute_dispatch.inl`:** Raises `tr.uavs.size()` cap from 8 to 16 in both the disk manifest loader (`load_compute_translation`) and the live native path (`translate_compute_natively`). - **`src/startup_stubs/translated_sampler_bindings.h` (`create_translated_root`):** Expands `parameters` from 11 to 19 (1 constants + 1 view table + 1 sampler table + up to 16 atomic UAVs) and adds a bounds check returning `E_INVALIDARG`. - **`tools/startup/triage_run.py` & `tests/startup_triage_run_check.py`:** Recognizes both `more than 8 UAVs` (for older logs) and `more than 16 UAVs`. - **`tests/native_uav_slots_check.py`:** Validates DXIL compilation for 8, 9, 16, and 17 UAVs, checks `compile_dxil --requests` manifest publication (`uav 0`..`uav N-1` + `.cs.cso`) for 8, 9, and 16 UAVs, and asserts 17 UAVs is refused with `unsupported startup runtime manifest bindings: more than 16 UAVs`. ## Verification Environment: Windows 11 x64 (`10.0.26300.9974`), MSVC `19.44.35230`, Windows SDK / DXC `10.0.26100.0`. Commit under test: `062de148`. ```powershell ctest --test-dir out/build/dev --no-tests=error -j 1 -V -R "^(native_uav_slots_controls|startup_triage_run)$" ctest --test-dir out/build/release --no-tests=error -j 1 -V -R "^(native_uav_slots_controls|startup_triage_run)$" ``` - `dev`: **2/2 passed** (0 skipped). - `release`: **2/2 passed** (0 skipped). - **Mutation check:** Temporarily reverting `uav_count > 16` back to `uav_count > 8` in `src/direct_compute_cache.cpp` caused `native_uav_slots_controls` to fail on the 9-UAV manifest case (`no_manifest ... more than 8 UAVs`); after reverting `src/`, 2/2 passed again. No game files, dumps, or private paths included.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 18:10:06 +00:00
Author
Owner

@⁠Leyukaka on GitHub · 2026-12-01 21:57 UTC · original · reviewed

Reviewed 062de1480. Thanks for the change. Please update tests/native_compute_manifest_reasons.cpp:169. Its nine-UAV case still expects more than 8 UAVs and will fail once the formatter accepts it. Moving the refusal case to 17 UAVs would keep the control.

Please also cover an actual 16-UAV Dispatch through both the published and in-process paths. tests/native_uav_slots_check.py:74 exercises publication only, so restoring either runtime limit to eight would still pass it.

src/startup_stubs/translated_sampler_bindings.h:151 checks the parameter array length. A program with 32 entry DWORDs and 16 indexed atomic UAVs still passes the manifest count checks, then requests a 65-DWORD root signature and fails serialization. Please enforce the root cost before publishing and cover the 64-DWORD boundary.

**@⁠Leyukaka** on GitHub · 2026-12-01 21:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3773#pullrequestreview-6140879311) · **reviewed** Reviewed `062de1480`. Thanks for the change. Please update `tests/native_compute_manifest_reasons.cpp:169`. Its nine-UAV case still expects `more than 8 UAVs` and will fail once the formatter accepts it. Moving the refusal case to 17 UAVs would keep the control. Please also cover an actual 16-UAV Dispatch through both the published and in-process paths. `tests/native_uav_slots_check.py:74` exercises publication only, so restoring either runtime limit to eight would still pass it. `src/startup_stubs/translated_sampler_bindings.h:151` checks the parameter array length. A program with 32 entry DWORDs and 16 indexed atomic UAVs still passes the manifest count checks, then requests a 65-DWORD root signature and fails serialization. Please enforce the root cost before publishing and cover the 64-DWORD boundary.
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 05:32 UTC · original · requested changes

I reproduced Leyukaka’s formatter finding on 062de148 with a fresh MSVC Debug build. native_uav_slots_controls passes, but native_compute_manifest_reasons fails with FAIL more than 8 UAVs | got: a manifest (1 of 59 reasons wrong). Please keep a 17-UAV refusal case, add the 64/65-DWORD root-cost boundary, and run a 16-UAV dispatch with output readback through both the disk-loaded and in-process translation paths.

**@⁠R0Y00** on GitHub · 2026-12-02 05:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3773#pullrequestreview-6145293108) · **requested changes** I reproduced Leyukaka’s formatter finding on `062de148` with a fresh MSVC Debug build. `native_uav_slots_controls` passes, but `native_compute_manifest_reasons` fails with `FAIL more than 8 UAVs | got: a manifest` (1 of 59 reasons wrong). Please keep a 17-UAV refusal case, add the 64/65-DWORD root-cost boundary, and run a 16-UAV dispatch with output readback through both the disk-loaded and in-process translation paths.
github-bot force-pushed github-bot/gh-3773 from 062de14804 to f91080d138 2026-12-02 12:25:31 +00:00 Compare
Author
Owner

@⁠R0D4X on GitHub · 2026-12-02 12:23 UTC · original

Rebased onto upstream/main (e143824c) and addressed all three review findings in f91080d1:

  1. tests/native_compute_manifest_reasons.cpp: Updated the UAV-count refusal case from 9 UAVs (more than 8 UAVs) to 17 UAVs (more than 16 UAVs), and added the 64-DWORD vs 65-DWORD root-signature boundary cases (31 entry DWORDs + 1 view table + 16 indexed atomic UAVs = 64 DWORDs published; 32 entry DWORDs + 1 view table + 16 indexed atomic UAVs = 65 DWORDs refused with root signature exceeds 64 DWORDs).
  2. 64-DWORD D3D12 root-signature cost limit: Added compute_root_dwords() (max(1, uds) + (views ? 1 : 0) + 2 * atomic_uavs + (sampler_heap ? 1 : 0)) in src/startup_stubs/translated_sampler_bindings.h (checked in create_translated_root) and enforced the 64-DWORD limit before publishing in format_compute_runtime_manifest (src/direct_compute_cache.cpp) as well as in both runtime compute paths (load_compute_translation and translate_compute_natively in src/startup_stubs/d3d12_compute_dispatch.inl).
  3. 16-UAV Dispatch(1, 1, 1) readback on both published and in-process native routes: Added dispatch-uav16 to tests/startup_stream_consumer.cpp (16 placed raw-buffer UAVs at table bytes 0..480, 32 words each) and extended tests/native_uav_slots_check.py + tests/cmake/native_uav_slots.cmake with:
    • native_uav_slots_dispatch_{warp,hardware} (published route: verifies the 65-DWORD manifest refusal in the runtime manifest reader, then dispatches the published 16-UAV shader and checks all 16 x 32 output words against the CPU reference), and
    • native_uav_slots_dispatch_native_{warp,hardware} (in-process X2W_NATIVE_SHADERS_ONLY=1 route: live-translates and dispatches the 16-UAV shader and checks all 16 x 32 output words).
    • Verified fail-first mutation: reverting tr.uavs.size() > 16 to > 8 in d3d12_compute_dispatch.inl fails both native_uav_slots_dispatch_hardware and native_uav_slots_dispatch_native_hardware.

Verification (f91080d1)

  • Environment: Windows 11 x64 (10.0.26300.9974), MSVC 19.44.35230, Windows SDK / DXC 10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver 32.0.16.2140), D3D12 debug layer enabled.
  • ctest --preset dev --no-tests=error -R '^(native_compute_manifest_reasons|native_uav_slots)' -V: 5 passed, 2 skipped (77), 0 failed (native_compute_manifest_reasons 0 of 64 wrong, native_compute_manifest_reasons_requests, native_uav_slots_controls, native_uav_slots_dispatch_hardware, native_uav_slots_dispatch_native_hardware passed; native_uav_slots_dispatch_warp and native_uav_slots_dispatch_native_warp skipped 77 on WARP for lacking 32-lane waves).
  • ctest --preset release --no-tests=error -R '^(native_compute_manifest_reasons|native_uav_slots)' -V: 5 passed, 2 skipped (77), 0 failed (same breakdown).
  • Pure-Python checks: tests/standin_exports_check.py (470 cases, 6/6 mutations killed PASS), tests/docs_links_check.py, tests/bidi_controls_check.py all passed.
**@⁠R0D4X** on GitHub · 2026-12-02 12:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3773#issuecomment-7345272946) Rebased onto `upstream/main` (`e143824c`) and addressed all three review findings in `f91080d1`: 1. **`tests/native_compute_manifest_reasons.cpp`:** Updated the UAV-count refusal case from 9 UAVs (`more than 8 UAVs`) to 17 UAVs (`more than 16 UAVs`), and added the 64-DWORD vs 65-DWORD root-signature boundary cases (31 entry DWORDs + 1 view table + 16 indexed atomic UAVs = 64 DWORDs published; 32 entry DWORDs + 1 view table + 16 indexed atomic UAVs = 65 DWORDs refused with `root signature exceeds 64 DWORDs`). 2. **64-DWORD D3D12 root-signature cost limit:** Added `compute_root_dwords()` (`max(1, uds) + (views ? 1 : 0) + 2 * atomic_uavs + (sampler_heap ? 1 : 0)`) in `src/startup_stubs/translated_sampler_bindings.h` (checked in `create_translated_root`) and enforced the 64-DWORD limit before publishing in `format_compute_runtime_manifest` (`src/direct_compute_cache.cpp`) as well as in both runtime compute paths (`load_compute_translation` and `translate_compute_natively` in `src/startup_stubs/d3d12_compute_dispatch.inl`). 3. **16-UAV `Dispatch(1, 1, 1)` readback on both published and in-process native routes:** Added `dispatch-uav16` to `tests/startup_stream_consumer.cpp` (16 placed raw-buffer UAVs at table bytes `0..480`, 32 words each) and extended `tests/native_uav_slots_check.py` + `tests/cmake/native_uav_slots.cmake` with: - `native_uav_slots_dispatch_{warp,hardware}` (published route: verifies the 65-DWORD manifest refusal in the runtime manifest reader, then dispatches the published 16-UAV shader and checks all `16 x 32` output words against the CPU reference), and - `native_uav_slots_dispatch_native_{warp,hardware}` (in-process `X2W_NATIVE_SHADERS_ONLY=1` route: live-translates and dispatches the 16-UAV shader and checks all `16 x 32` output words). - Verified fail-first mutation: reverting `tr.uavs.size() > 16` to `> 8` in `d3d12_compute_dispatch.inl` fails both `native_uav_slots_dispatch_hardware` and `native_uav_slots_dispatch_native_hardware`. ### Verification (`f91080d1`) - **Environment:** Windows 11 x64 (`10.0.26300.9974`), MSVC `19.44.35230`, Windows SDK / DXC `10.0.26100.0`, NVIDIA GeForce RTX 5080 (`10de:2c02`, driver `32.0.16.2140`), D3D12 debug layer enabled. - `ctest --preset dev --no-tests=error -R '^(native_compute_manifest_reasons|native_uav_slots)' -V`: **5 passed, 2 skipped (77), 0 failed** (`native_compute_manifest_reasons` 0 of 64 wrong, `native_compute_manifest_reasons_requests`, `native_uav_slots_controls`, `native_uav_slots_dispatch_hardware`, `native_uav_slots_dispatch_native_hardware` passed; `native_uav_slots_dispatch_warp` and `native_uav_slots_dispatch_native_warp` skipped 77 on WARP for lacking 32-lane waves). - `ctest --preset release --no-tests=error -R '^(native_compute_manifest_reasons|native_uav_slots)' -V`: **5 passed, 2 skipped (77), 0 failed** (same breakdown). - Pure-Python checks: `tests/standin_exports_check.py` (`470 cases, 6/6 mutations killed PASS`), `tests/docs_links_check.py`, `tests/bidi_controls_check.py` all passed.
github-bot force-pushed github-bot/gh-3773 from f91080d138 to 7153a05108 2026-12-02 12:38:07 +00:00 Compare
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 13:05 UTC · original · approved these changes

The three findings from 062de148 are addressed on 7153a051. The formatter refuses 17 UAVs, accepts the 64-DWORD root, and rejects 65 DWORDs. I checked the same cost in the manifest loader and in-process path. The directly indexed smpidx binding uses a root signature flag, so it adds no table cost; samplers.heap separately accounts for a descriptor table where one is created.

Windows 11 26300.9974, MSVC Debug and SDK 10.0.26100. ctest --preset dev --no-tests=error -j 1 -V -R '^native_(uav_slots_|compute_manifest_reasons$)' gave 4 passes and 2 capability skips. On RTX 4060 Laptop driver 32.0.16.1656 with the D3D12 debug layer enabled, the published and in-process paths each matched 16 UAVs × 32 lanes. Inbox WARP 10.0.26100.9818 declined both dispatch variants with exit 77. The published test reached the 65-DWORD refusal on both adapters before the capability check. Required Windows CI remains red at the inherited native_direct_mesh failure tracked by #3853.

**@⁠R0Y00** on GitHub · 2026-12-02 13:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3773#pullrequestreview-6151291343) · **approved these changes** The three findings from `062de148` are addressed on `7153a051`. The formatter refuses 17 UAVs, accepts the 64-DWORD root, and rejects 65 DWORDs. I checked the same cost in the manifest loader and in-process path. The directly indexed `smpidx` binding uses a root signature flag, so it adds no table cost; `samplers.heap` separately accounts for a descriptor table where one is created. Windows 11 26300.9974, MSVC Debug and SDK 10.0.26100. `ctest --preset dev --no-tests=error -j 1 -V -R '^native_(uav_slots_|compute_manifest_reasons$)'` gave 4 passes and 2 capability skips. On RTX 4060 Laptop driver 32.0.16.1656 with the D3D12 debug layer enabled, the published and in-process paths each matched 16 UAVs × 32 lanes. Inbox WARP 10.0.26100.9818 declined both dispatch variants with exit 77. The published test reached the 65-DWORD refusal on both adapters before the capability check. Required Windows CI remains red at the inherited `native_direct_mesh` failure tracked by #3853.
github-bot changed target branch from main to gh-pr/3773/base 2026-12-02 16:06:12 +00:00
github manually merged commit 0faadc57c4 into gh-pr/3773/base 2026-12-02 16:06:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.