runtime: bind root_buffer_srv in native compute #3780

Merged
R0D4X merged 1 commit from upstream-pr/3780 into main 2026-12-02 02:39:03 +00:00
R0D4X commented 2026-12-01 19:37:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0D4X on 2026-12-01T19:37:37Z.


Refs #3224, #2935

Summary

Binds ComputeViewKind::root_buffer_srv on the in-process native compute translation route (translate_compute_natively), matching format_compute_runtime_manifest (srv <i> buf root <param>) and the published-manifest Dispatch path.

Changes

  • src/startup_stubs/d3d12_compute_dispatch.inl:
    • Accept ComputeViewKind::root_buffer_srv in translate_compute_natively under the same predicate as format_compute_runtime_manifest (byte_offset == 0, !requires_identity_dst_sel, not declared_cbv or reflected_cbv, array_count == 1), setting slot.root = true. Root CBV bindings stay refused.
  • tests/startup_compute_root_srv_native_check.py and tests/cmake/startup_compute_root_srv_native.cmake:
    • Add a native live-in-process mode (X2W_NATIVE_SHADERS, X2W_NATIVE_SHADERS_ONLY=1, no published .cs.cso or <key>.txt) registered as startup_compute_root_srv_live_native_{warp,hardware}.
    • Verifies live translation and readback of all 320 output words against the CPU reference, bind-time refusal on the plain layout without a byte-32 descriptor, native refusal of a root CBV at parameter 2 (view kind 10 is not bound for a natively translated program), and native refusal of an unaligned byte-16 table entry (unaligned descriptor table entry).
  • tests/standin_exports_check.py:
    • Resolve the exact line number of x2w_d3d12_compute_census in src/startup_stubs/d3d12_compute_dispatch.inl from the source file instead of hardcoding :1744.

Verification

  • Commit: 7f7e0a3e (based on main 158ef794)
  • 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), Microsoft Basic Render Driver (10.0.26100.9818), D3D12 debug layer enabled (no error messages).

Commands and results

ctest --preset dev --no-tests=error -R '^startup_compute_root_srv_(native|live_native)' -V
ctest --preset release --no-tests=error -R '^startup_compute_root_srv_(native|live_native)' -V
  • dev (Debug):
    • startup_compute_root_srv_native_controls: Passed (1.02 s)
    • startup_compute_root_srv_native_warp: Skipped (77) — adapter has no 32-lane waves
    • startup_compute_root_srv_native_hardware: Passed (2.56 s, RTX 5080, debug layer clean)
    • startup_compute_root_srv_live_native_warp: Skipped (77) — the adapter has no 32-lane waves
    • startup_compute_root_srv_live_native_hardware: Passed (2.24 s, RTX 5080, debug layer clean)
  • release (/O2):
    • startup_compute_root_srv_native_controls: Passed (1.01 s)
    • startup_compute_root_srv_native_warp: Skipped (77) — adapter has no 32-lane waves
    • startup_compute_root_srv_native_hardware: Passed (2.50 s, RTX 5080, debug layer clean)
    • startup_compute_root_srv_live_native_warp: Skipped (77) — the adapter has no 32-lane waves
    • startup_compute_root_srv_live_native_hardware: Passed (2.17 s, RTX 5080, debug layer clean)

Fail-first / mutation control

Reverting the d3d12_compute_dispatch.inl hunk and rebuilding d3d12_xs_shim fails startup_compute_root_srv_live_native_hardware (view kind 10 is not bound for a natively translated program).

Pure-Python checks

.\out\pe-env\Scripts\python.exe -B tests\startup_compute_root_srv_native_check.py
.\out\pe-env\Scripts\python.exe -B tests\standin_exports_check.py
.\out\pe-env\Scripts\python.exe -B tests\docs_links_check.py
.\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py
  • startup_compute_root_srv_native_check.py: root SRV native controls (32-byte records manifest, root CBV variant, byte-16 layout) passed
  • standin_exports: 470 cases, 6/6 mutations killed PASS
  • docs_links_check.py: Self-test passed. Checked 225 Markdown files and 874 links.
  • bidi_controls_check.py: Self-test passed. Checked 2877 tracked source, script and build/CI files: no bidirectional controls.

Scope note

This verifies source-built gfx1013 compute fixtures through the stand-in D3D12 runtime on the RTX 5080 and WARP; it does not establish full-title startup or frame rate.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5593090200 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3780). Originally posted by [R0D4X](https://github.com/R0D4X) on 2026-12-01T19:37:37Z. --- Refs #3224, #2935 ## Summary Binds `ComputeViewKind::root_buffer_srv` on the in-process native compute translation route (`translate_compute_natively`), matching `format_compute_runtime_manifest` (`srv <i> buf root <param>`) and the published-manifest Dispatch path. ### Changes - `src/startup_stubs/d3d12_compute_dispatch.inl`: - Accept `ComputeViewKind::root_buffer_srv` in `translate_compute_natively` under the same predicate as `format_compute_runtime_manifest` (`byte_offset == 0`, `!requires_identity_dst_sel`, not `declared_cbv` or `reflected_cbv`, `array_count == 1`), setting `slot.root = true`. Root CBV bindings stay refused. - `tests/startup_compute_root_srv_native_check.py` and `tests/cmake/startup_compute_root_srv_native.cmake`: - Add a `native` live-in-process mode (`X2W_NATIVE_SHADERS`, `X2W_NATIVE_SHADERS_ONLY=1`, no published `.cs.cso` or `<key>.txt`) registered as `startup_compute_root_srv_live_native_{warp,hardware}`. - Verifies live translation and readback of all 320 output words against the CPU reference, bind-time refusal on the plain layout without a byte-32 descriptor, native refusal of a root CBV at parameter 2 (`view kind 10 is not bound for a natively translated program`), and native refusal of an unaligned byte-16 table entry (`unaligned descriptor table entry`). - `tests/standin_exports_check.py`: - Resolve the exact line number of `x2w_d3d12_compute_census` in `src/startup_stubs/d3d12_compute_dispatch.inl` from the source file instead of hardcoding `:1744`. ## Verification - **Commit:** `7f7e0a3e` (based on `main` `158ef794`) - **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`), Microsoft Basic Render Driver (`10.0.26100.9818`), D3D12 debug layer enabled (no error messages). ### Commands and results ```powershell ctest --preset dev --no-tests=error -R '^startup_compute_root_srv_(native|live_native)' -V ctest --preset release --no-tests=error -R '^startup_compute_root_srv_(native|live_native)' -V ``` - `dev` (Debug): - `startup_compute_root_srv_native_controls`: **Passed** (1.02 s) - `startup_compute_root_srv_native_warp`: **Skipped (77)** — `adapter has no 32-lane waves` - `startup_compute_root_srv_native_hardware`: **Passed** (2.56 s, RTX 5080, debug layer clean) - `startup_compute_root_srv_live_native_warp`: **Skipped (77)** — `the adapter has no 32-lane waves` - `startup_compute_root_srv_live_native_hardware`: **Passed** (2.24 s, RTX 5080, debug layer clean) - `release` (`/O2`): - `startup_compute_root_srv_native_controls`: **Passed** (1.01 s) - `startup_compute_root_srv_native_warp`: **Skipped (77)** — `adapter has no 32-lane waves` - `startup_compute_root_srv_native_hardware`: **Passed** (2.50 s, RTX 5080, debug layer clean) - `startup_compute_root_srv_live_native_warp`: **Skipped (77)** — `the adapter has no 32-lane waves` - `startup_compute_root_srv_live_native_hardware`: **Passed** (2.17 s, RTX 5080, debug layer clean) ### Fail-first / mutation control Reverting the `d3d12_compute_dispatch.inl` hunk and rebuilding `d3d12_xs_shim` fails `startup_compute_root_srv_live_native_hardware` (`view kind 10 is not bound for a natively translated program`). ### Pure-Python checks ```powershell .\out\pe-env\Scripts\python.exe -B tests\startup_compute_root_srv_native_check.py .\out\pe-env\Scripts\python.exe -B tests\standin_exports_check.py .\out\pe-env\Scripts\python.exe -B tests\docs_links_check.py .\out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py ``` - `startup_compute_root_srv_native_check.py`: `root SRV native controls (32-byte records manifest, root CBV variant, byte-16 layout) passed` - `standin_exports: 470 cases, 6/6 mutations killed PASS` - `docs_links_check.py`: `Self-test passed. Checked 225 Markdown files and 874 links.` - `bidi_controls_check.py`: `Self-test passed. Checked 2877 tracked source, script and build/CI files: no bidirectional controls.` ## Scope note This verifies source-built gfx1013 compute fixtures through the stand-in D3D12 runtime on the RTX 5080 and WARP; it does not establish full-title startup or frame rate. AI-assisted.
Leyukaka commented 2026-12-01 21:57:33 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-01T21:57:33Z.

Review: COMMENTED


Reviewed 7f7e0a3e8 by reading the diff. The native binding at src/startup_stubs/d3d12_compute_dispatch.inl:620 follows the published manifest's root SRV rules and uses the existing dispatch resolver. The live test at tests/startup_compute_root_srv_native_check.py:278 requires matching readback and also covers the declared CBV and invalid table layouts. I found nothing to change. I have not run the live-native test on an adapter, so that result remains to be confirmed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6140880083 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3780#pullrequestreview-6140880083). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-12-01T21:57:33Z. **Review:** COMMENTED --- Reviewed `7f7e0a3e8` by reading the diff. The native binding at `src/startup_stubs/d3d12_compute_dispatch.inl:620` follows the published manifest's root SRV rules and uses the existing dispatch resolver. The live test at `tests/startup_compute_root_srv_native_check.py:278` requires matching readback and also covers the declared CBV and invalid table layouts. I found nothing to change. I have not run the live-native test on an adapter, so that result remains to be confirmed.
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!3780
No description provided.