runtime: bind uint_texture_uav in native compute #3783

Manually merged
github merged 2 commits from github-bot/gh-3781 into main 2026-12-02 02:44:37 +00:00 AGit
Owner

@⁠R0D4X on GitHub · 2026-12-01 19:47 UTC · original
R0D4X:runtime/native-compute-uint-tex-uav → main · +90 −24 · 5 files · 2 commits · merged 2026-12-02 02:39 UTC

Refs #3226, #2935

Summary

Binds ComputeViewKind::uint_texture_uav (2D and 3D R32_UINT image-atomic UAVs) on the in-process native compute translation route (translate_compute_natively), matching format_compute_runtime_manifest (uav <i> tex2d|tex3d uint table <param> <off> channels 1) and the published-manifest Dispatch path.

Changes

  • src/startup_stubs/d3d12_compute_dispatch.inl:
    • Accept ComputeViewKind::uint_texture_uav with image_dimension 1 (TEXTURE2D) or 2 (TEXTURE3D) in translate_compute_natively, setting slot.atomic_uint_texture = true (leaving 1D and 2D-array dimensions refused, matching format_compute_runtime_manifest and the manifest reader).
  • tests/native_image_atomic_check.py and tests/cmake/native_image_atomic.cmake:
    • Add a runtime_native mode (X2W_NATIVE_SHADERS, X2W_NATIVE_SHADERS_ONLY=1, no published .cs.cso or <key>.txt) registered as native_image_atomic_runtime_native_hardware.
    • Verifies live in-process translation and atomic readback of all 256 words against the CPU model on a 2D R32_UINT UAV, plus the negative control that a float UAV is refused with an image atomic requires an R32_UINT UAV and stays unchanged.
  • 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: 8ba7b471 (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 '^native_image_atomic_(controls|warp|hardware|runtime_hardware|runtime_native_hardware)$' -V
ctest --preset release --no-tests=error -R '^native_image_atomic_(controls|warp|hardware|runtime_hardware|runtime_native_hardware)$' -V
  • dev (Debug):
    • native_image_atomic_controls: Passed (1.54 s)
    • native_image_atomic_warp: Skipped (77) — shader wave32 fixture requires SM 6.6, WaveOps, and a 32-lane wave
    • native_image_atomic_hardware: Passed (3.61 s, RTX 5080, debug_errors=0 debug_warnings=0)
    • native_image_atomic_runtime_hardware: Passed (2.10 s, RTX 5080, debug layer clean)
    • native_image_atomic_runtime_native_hardware: Passed (1.80 s, RTX 5080, debug layer clean)
  • release (/O2):
    • native_image_atomic_controls: Passed
    • native_image_atomic_warp: Skipped (77) — shader wave32 fixture requires SM 6.6, WaveOps, and a 32-lane wave
    • native_image_atomic_hardware: Passed (3.73 s, RTX 5080, debug_errors=0 debug_warnings=0)
    • native_image_atomic_runtime_hardware: Passed (2.17 s, RTX 5080, debug layer clean)
    • native_image_atomic_runtime_native_hardware: Passed (1.84 s, RTX 5080, debug layer clean)

Fail-first / mutation control

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

Pure-Python checks

.\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
  • 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 image-atomic 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.

**@⁠R0D4X** on GitHub · 2026-12-01 19:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3781) `R0D4X:runtime/native-compute-uint-tex-uav` → `main` · +90 −24 · 5 files · 2 commits · merged 2026-12-02 02:39 UTC Refs #3226, #2935 ## Summary Binds `ComputeViewKind::uint_texture_uav` (2D and 3D `R32_UINT` image-atomic UAVs) on the in-process native compute translation route (`translate_compute_natively`), matching `format_compute_runtime_manifest` (`uav <i> tex2d|tex3d uint table <param> <off> channels 1`) and the published-manifest Dispatch path. ### Changes - `src/startup_stubs/d3d12_compute_dispatch.inl`: - Accept `ComputeViewKind::uint_texture_uav` with `image_dimension` 1 (`TEXTURE2D`) or 2 (`TEXTURE3D`) in `translate_compute_natively`, setting `slot.atomic_uint_texture = true` (leaving 1D and 2D-array dimensions refused, matching `format_compute_runtime_manifest` and the manifest reader). - `tests/native_image_atomic_check.py` and `tests/cmake/native_image_atomic.cmake`: - Add a `runtime_native` mode (`X2W_NATIVE_SHADERS`, `X2W_NATIVE_SHADERS_ONLY=1`, no published `.cs.cso` or `<key>.txt`) registered as `native_image_atomic_runtime_native_hardware`. - Verifies live in-process translation and atomic readback of all 256 words against the CPU model on a 2D `R32_UINT` UAV, plus the negative control that a float UAV is refused with `an image atomic requires an R32_UINT UAV` and stays unchanged. - `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:** `8ba7b471` (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 '^native_image_atomic_(controls|warp|hardware|runtime_hardware|runtime_native_hardware)$' -V ctest --preset release --no-tests=error -R '^native_image_atomic_(controls|warp|hardware|runtime_hardware|runtime_native_hardware)$' -V ``` - `dev` (Debug): - `native_image_atomic_controls`: **Passed** (1.54 s) - `native_image_atomic_warp`: **Skipped (77)** — `shader wave32 fixture requires SM 6.6, WaveOps, and a 32-lane wave` - `native_image_atomic_hardware`: **Passed** (3.61 s, RTX 5080, `debug_errors=0 debug_warnings=0`) - `native_image_atomic_runtime_hardware`: **Passed** (2.10 s, RTX 5080, debug layer clean) - `native_image_atomic_runtime_native_hardware`: **Passed** (1.80 s, RTX 5080, debug layer clean) - `release` (`/O2`): - `native_image_atomic_controls`: **Passed** - `native_image_atomic_warp`: **Skipped (77)** — `shader wave32 fixture requires SM 6.6, WaveOps, and a 32-lane wave` - `native_image_atomic_hardware`: **Passed** (3.73 s, RTX 5080, `debug_errors=0 debug_warnings=0`) - `native_image_atomic_runtime_hardware`: **Passed** (2.17 s, RTX 5080, debug layer clean) - `native_image_atomic_runtime_native_hardware`: **Passed** (1.84 s, RTX 5080, debug layer clean) ### Fail-first / mutation control Reverting the `d3d12_compute_dispatch.inl` hunk and rebuilding `d3d12_xs_shim` fails `native_image_atomic_runtime_native_hardware` (`view kind 21 is not bound for a natively translated program`). ### Pure-Python checks ```powershell .\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 ``` - `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 image-atomic 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 19:49:51 +00:00
Author
Owner

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

Reviewed 8ba7b4716. Thanks for the change. The new runtime test at tests/native_image_atomic_check.py:182 checks a 2D integer UAV and a float-format refusal. This change also enables native 3D integer UAVs at src/startup_stubs/d3d12_compute_dispatch.inl:627, which use a separate view and slice-range validation path. The existing 3D container test supplies its own UAV and bypasses this binding path, so the test suite would stay green if the 3D binding were disabled or selected the wrong slice. Please add an in-process 3D dispatch with readback from a selected slice and unchanged neighboring slices.

**@⁠Leyukaka** on GitHub · 2026-12-01 21:57 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3781#pullrequestreview-6140880377) · **reviewed** Reviewed `8ba7b4716`. Thanks for the change. The new runtime test at `tests/native_image_atomic_check.py:182` checks a 2D integer UAV and a float-format refusal. This change also enables native 3D integer UAVs at `src/startup_stubs/d3d12_compute_dispatch.inl:627`, which use a separate view and slice-range validation path. The existing 3D container test supplies its own UAV and bypasses this binding path, so the test suite would stay green if the 3D binding were disabled or selected the wrong slice. Please add an in-process 3D dispatch with readback from a selected slice and unchanged neighboring slices.
Author
Owner

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

Added in-process 3D R32_UINT image-atomic dispatch and slice-range validation coverage in 7bf77972:

  • Added texture-volume-atomic and texture-volume-atomic-bad-w modes in tests/startup_stream_consumer.cpp (6-slice mip-1 3D R32_UINT volume initialized with distinct per-texel words, bound with FirstWSlice = 1, WSize = ~0u for the positive case and WSize = 6 for the out-of-range control).
  • Extended runtime_native in tests/native_image_atomic_check.py to dispatch a 3D (dim=2) image_atomic_add at (x=5, y=6, z=1) through translate_compute_natively (no published .cs.cso or .txt), reading back all 1,536 words across all 6 slices and verifying that physical slice 2 (FirstWSlice(1) + z(1)) incremented by +32 while neighboring slices 0, 1, 3, 4, 5 remained completely unchanged.
  • Verified texture-volume-atomic-bad-w is refused at dispatch time and leaves all 1,536 words unchanged.

Re-verified on dev (Debug) and release (/O2) on Windows 11 (10.0.26300.9974), RTX 5080 (32.0.16.2140), D3D12 debug layer enabled (no error messages):

  • native_image_atomic_runtime_native_hardware: Passed (release 2.35 s, In-process native DXIL matched 2D (256 words) and 3D slice 2 (1536 words, neighbors 0,1,3,4,5 unchanged, bad-w refused); debug layer enabled, no error message / enabled, no error message).
**@⁠R0D4X** on GitHub · 2026-12-01 23:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3781#issuecomment-7329017161) Added in-process 3D `R32_UINT` image-atomic dispatch and slice-range validation coverage in `7bf77972`: - Added `texture-volume-atomic` and `texture-volume-atomic-bad-w` modes in `tests/startup_stream_consumer.cpp` (6-slice mip-1 3D `R32_UINT` volume initialized with distinct per-texel words, bound with `FirstWSlice = 1`, `WSize = ~0u` for the positive case and `WSize = 6` for the out-of-range control). - Extended `runtime_native` in `tests/native_image_atomic_check.py` to dispatch a 3D (`dim=2`) `image_atomic_add` at `(x=5, y=6, z=1)` through `translate_compute_natively` (no published `.cs.cso` or `.txt`), reading back all 1,536 words across all 6 slices and verifying that physical slice 2 (`FirstWSlice(1) + z(1)`) incremented by `+32` while neighboring slices `0, 1, 3, 4, 5` remained completely unchanged. - Verified `texture-volume-atomic-bad-w` is refused at dispatch time and leaves all 1,536 words unchanged. Re-verified on `dev` (Debug) and `release` (`/O2`) on Windows 11 (`10.0.26300.9974`), RTX 5080 (`32.0.16.2140`), D3D12 debug layer enabled (no error messages): - `native_image_atomic_runtime_native_hardware`: **Passed** (`release` 2.35 s, `In-process native DXIL matched 2D (256 words) and 3D slice 2 (1536 words, neighbors 0,1,3,4,5 unchanged, bad-w refused); debug layer enabled, no error message / enabled, no error message`).
github manually merged commit 040084731d into main 2026-12-02 02:44:37 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.