runtime: publish and bind root_buffer_uav in native compute (Part of #3224, #2935) #3813

Manually merged
github merged 1 commit from github-bot/gh-3811 into main 2026-12-02 02:44:29 +00:00 AGit
Owner

@⁠timbot103 on GitHub · 2026-12-02 01:31 UTC · original
timbot103:runtime/compute-root-buffer-uav → main · +341 −8 · 9 files · 1 commits · merged 2026-12-02 02:38 UTC

## Summary

Publishes and binds ComputeViewKind::root_buffer_uav for native direct compute on both the published manifest route and the in-process native compute route (Part of #3226, #2935; zero overlap with #3782, which covers root_buffer_srv only).

  • Manifest publishing (src/gfx1013_compute_native.h, src/direct_compute_cache.cpp): adds runtime_root_buffer_uav() and emits uav <i> root <param> in format_compute_runtime_manifest only when byte_offset == 0, array_count == 1, array_position == 0, !requires_identity_dst_sel, and scalar_table == unknown (invalid shapes still fall through to UAV kind root_buffer_uav refusal).
  • Guest list tracking (src/startup_stubs/d3d12_xs_device.cpp): hooks list slot 45 (SetComputeRootUnorderedAccessView, list_compute_root_uav) to record compute_root_uavs[parameter] and compute_root_uav_set per recording, clearing both on Reset and SetComputeRootSignature changes.
  • Runtime parsing & fail-closed binding (src/startup_stubs/d3d12_compute_dispatch.inl): parses uav %2u root %2d (supporting 0..15 while rejecting 32-bit sscanf wraparound such as 4294967296), wires translate_compute_natively, and validates every root UAV bind in compute_root_uav_buffer: requires a D3D12_ROOT_PARAMETER_TYPE_UAV slot set since the compute root, non-null 16-byte-aligned address, live uniquely-aliased COMMON-state placed buffer with ALLOW_UNORDERED_ACCESS, writable title pages, whole-dword tail within the D3D12 raw UAV element limit, no overlap with active placements or inputs, no descriptor-word entry constants (uav_stride / uav_descword3 / uav_numrecords), and recording retention.

Verification

Added source-built end-to-end fixture startup_compute_root_uav_native_{warp,hardware} (tests/startup_compute_root_uav_native_check.py) plus manifest refusal cases in tests/native_compute_manifest_reasons.cpp. Tested on Windows 11 (26200.9974), MSVC 19.44, Ninja, Windows SDK 10.0.26100.0, app-local WARP 1.0.22.0, and NVIDIA GeForce RTX 5080 (driver 32.0.16.2140; D3D12 debug layer unavailable on this host):

  • Debug (dev): ctest --preset dev --no-tests=error -R '^(startup_compute_root_uav_native_|native_compute_manifest_reasons)' — 4/4 passed (0 failed, 0 skipped).
  • Release (release-verify): 4/4 passed (0 failed, 0 skipped; test runner resolved its unused xg_xs.dll import from the source-built Debug DLL because host AV quarantined the Release DLL).
  • Both published and in-process native routes matched all 320 UAV words + buffer guards on WARP and RTX 5080, and passed all 13 published-route refusal controls plus in-process unset-root refusal.
  • git diff --check origin/main..HEAD: clean; zero new MSVC /W4 warnings on edited lines.

AI-assisted.

**@⁠timbot103** on GitHub · 2026-12-02 01:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3811) `timbot103:runtime/compute-root-buffer-uav` → `main` · +341 −8 · 9 files · 1 commits · merged 2026-12-02 02:38 UTC ## Summary Publishes and binds `ComputeViewKind::root_buffer_uav` for native direct compute on both the published manifest route and the in-process native compute route (Part of #3226, #2935; zero overlap with #3782, which covers `root_buffer_srv` only). - **Manifest publishing (`src/gfx1013_compute_native.h`, `src/direct_compute_cache.cpp`):** adds `runtime_root_buffer_uav()` and emits `uav <i> root <param>` in `format_compute_runtime_manifest` only when `byte_offset == 0`, `array_count == 1`, `array_position == 0`, `!requires_identity_dst_sel`, and `scalar_table == unknown` (invalid shapes still fall through to `UAV kind root_buffer_uav` refusal). - **Guest list tracking (`src/startup_stubs/d3d12_xs_device.cpp`):** hooks list slot 45 (`SetComputeRootUnorderedAccessView`, `list_compute_root_uav`) to record `compute_root_uavs[parameter]` and `compute_root_uav_set` per recording, clearing both on `Reset` and `SetComputeRootSignature` changes. - **Runtime parsing & fail-closed binding (`src/startup_stubs/d3d12_compute_dispatch.inl`):** parses `uav %2u root %2d` (supporting 0..15 while rejecting 32-bit `sscanf` wraparound such as `4294967296`), wires `translate_compute_natively`, and validates every root UAV bind in `compute_root_uav_buffer`: requires a `D3D12_ROOT_PARAMETER_TYPE_UAV` slot set since the compute root, non-null 16-byte-aligned address, live uniquely-aliased `COMMON`-state placed buffer with `ALLOW_UNORDERED_ACCESS`, writable title pages, whole-dword tail within the D3D12 raw UAV element limit, no overlap with active placements or inputs, no descriptor-word entry constants (`uav_stride` / `uav_descword3` / `uav_numrecords`), and recording retention. ## Verification Added source-built end-to-end fixture `startup_compute_root_uav_native_{warp,hardware}` (`tests/startup_compute_root_uav_native_check.py`) plus manifest refusal cases in `tests/native_compute_manifest_reasons.cpp`. Tested on Windows 11 (`26200.9974`), MSVC `19.44`, Ninja, Windows SDK `10.0.26100.0`, app-local WARP `1.0.22.0`, and NVIDIA GeForce RTX 5080 (driver `32.0.16.2140`; D3D12 debug layer unavailable on this host): - **Debug (`dev`):** `ctest --preset dev --no-tests=error -R '^(startup_compute_root_uav_native_|native_compute_manifest_reasons)'` — **4/4 passed** (0 failed, 0 skipped). - **Release (`release-verify`):** **4/4 passed** (0 failed, 0 skipped; test runner resolved its unused `xg_xs.dll` import from the source-built Debug DLL because host AV quarantined the Release DLL). - Both published and in-process native routes matched all 320 UAV words + buffer guards on WARP and RTX 5080, and passed all 13 published-route refusal controls plus in-process unset-root refusal. - `git diff --check origin/main..HEAD`: clean; zero new MSVC `/W4` warnings on edited lines. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 01:36:56 +00:00
github-bot force-pushed github-bot/gh-3811 from ea78cd9f33 to 77439e3d5b 2026-12-02 02:14:14 +00:00 Compare
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 02:09 UTC · original

Windows first fails startup_triage_run: the root UAV refusal strings added by this PR are missing from COMPUTE_DISPATCH_REASONS. Linux also reports startup_triage_run_check.py and standin_exports_check.py as failed. Please register the new refusal strings, reconcile the stand-in export expectations with the updated hook, and rerun those checks on current main.

**@⁠R0Y00** on GitHub · 2026-12-02 02:09 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3811#issuecomment-7332543103) Windows first fails `startup_triage_run`: the root UAV refusal strings added by this PR are missing from `COMPUTE_DISPATCH_REASONS`. Linux also reports `startup_triage_run_check.py` and `standin_exports_check.py` as failed. Please register the new refusal strings, reconcile the stand-in export expectations with the updated hook, and rerun those checks on current main.
Author
Owner

@⁠timbot103 on GitHub · 2026-12-02 02:35 UTC · original

@⁠R0Y00 Rebased onto main (3ecfbad7) and registered all 19 compute root-UAV refusal strings in COMPUTE_DISPATCH_REASONS in tools/startup/triage_run.py as 77439e3d; standin_exports_check.py (470/470), startup_triage_run_check.py, and all Windows/Linux CI checks are now green.

AI-assisted.

**@⁠timbot103** on GitHub · 2026-12-02 02:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3811#issuecomment-7332991199) @⁠R0Y00 Rebased onto `main` (`3ecfbad7`) and registered all 19 compute root-UAV refusal strings in `COMPUTE_DISPATCH_REASONS` in `tools/startup/triage_run.py` as `77439e3d`; `standin_exports_check.py` (470/470), `startup_triage_run_check.py`, and all Windows/Linux CI checks are now green. AI-assisted.
github manually merged commit 1e8e0613ba into main 2026-12-02 02:44:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.