From cbdd4ca200229f426ef8c9f20d3e59aa45132985 Mon Sep 17 00:00:00 2001 From: saii <120340942+Not-Saii@users.noreply.github.com> Date: Fri, 27 Nov 2026 21:32:10 +0200 Subject: [PATCH 1/3] docs: measure native wave32 compute on app-local WARP 1.0.22 Stage 1 of #3160. On Windows 11 build 26300 the app-local d3d10warp.dll 1.0.22, loaded by the in-box D3D12 runtime, gives 4-to-128-lane waves. Three native compute _warp tests pass without any wiring. The two stand-in tests dispatch but write no output, and the export-based Agility load fails on this machine, so no Agility wiring is added. The note also records that the opt-in Agility build does not compile on main (40-byte view-description static_assert). Refs #3160 Co-Authored-By: Claude Opus 5.5 --- docs/experiments/native-compute-warp.md | 109 ++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 docs/experiments/native-compute-warp.md diff --git a/docs/experiments/native-compute-warp.md b/docs/experiments/native-compute-warp.md new file mode 100644 index 0000000000..c4aa931c1c --- /dev/null +++ b/docs/experiments/native-compute-warp.md @@ -0,0 +1,109 @@ +# Native wave32 compute on app-local WARP 1.0.22 + +Refs [#3160](https://github.com/R0Y00/Xbox2Windows/issues/3160) (stage 1), +[#145](https://github.com/R0Y00/Xbox2Windows/issues/145), [#147](https://github.com/R0Y00/Xbox2Windows/pull/147). + +Every direct compute module declares wave size 32 (`src/dxil_module.h`). The in-box WARP has 4-lane waves, so the +native compute `_warp` tests skip with 77. This note measures them with the Microsoft WARP 1.0.22 package placed +beside the test executables. No translator or test code changes. + +## Result + +**The app-local `d3d10warp.dll` is what provides 32-lane waves. The Agility SDK runtime does not.** On this machine, +WARP 1.0.22 loaded by the in-box D3D12 runtime reports `WaveOps=1`, lanes 4 to 128 and SM 6.8. A configure with +`OFFSCREEN_WARP_DIR` already copies the DLL into the build root, next to every test executable, so the tests below +use it without any change to their CMake targets. + +| Test | Executable | In-box runtime, in-box WARP (`10.0.26100.9818`) | In-box runtime, WARP 1.0.22 beside the EXE | +|---|---|---|---| +| `native_comparison_pso_warp` | `native_recording_check` | skip 77, `range=4..4` | pass: cold and cached comparison-sampling compute PSOs (no dispatch) | +| `native_heap_handle_probe_warp` | `native_heap_handle_probe` | skip 77, `(4..4)` | pass: reference and native modules, selectors 0 and 1 match the CPU reference, guard intact | +| `native_global_srv_heap_replay_warp` | `native_global_srv_heap_replay` | skip 77, `(4..4)` | pass: record and offline replay, 64 words per selector, refusals | +| `startup_compute_dispatch_native_warp` | `startup_stream_consumer` | skip 77, refusal checks pass | **fail**: `Dispatch(3, 2, 2) translated`, then `word=0 got=c5c5c5c5 expected=ea74e376 (288 words differ)` | +| `native_startup_request_cache_warp` | `startup_stream_consumer`, `offscreen_check` | pass (4-lane fallback branch) | **fail**: `compute dispatch output mismatch` (translated branch) | +| `shader_wave32_warp` (gate) | `offscreen_check` | not run | pass: `forced32 width=32 waves=2 ... mismatches=0`, debug layer enabled, 0 errors | +| `bvh_wave64_warp` (#145) | `offscreen_check` | not run | **fail**: `record=0 field=25 expected=f0094d90 actual=f03aeb40` | + +Control: the same `warp122` binaries with `d3d10warp.dll` renamed away report `(4..4)` and skip with 77. The +executables have no export table, so the in-box `D3D12Core.dll` loads. A scratch probe started from the same +directory printed `C:\WINDOWS\SYSTEM32\D3D12Core.dll` and the `d3d10warp.dll` from the build root. + +Negative control: changing one expected word in `reference_output()` of `tests/native_global_srv_heap_replay.cpp` +(a temporary local edit, reverted) makes `native_global_srv_heap_replay_warp` fail with +`mismatch word 5: got 0xa0000005 expected 0xa0000004`. The pass is a real comparison, not a skip. + +With the options unset (an options-unset build of this commit), all five native compute tests give the same results +as before: four skip with 77 and `native_startup_request_cache_warp` passes through its 4-lane branch. + +## The two stand-in failures + +Both run the native module through the stand-in (`d3d12_xs_shim`). The dispatch is recorded and the fence signals, +but the output keeps its `0xc5c5c5c5` fill. This is not the #145 shape, where values arrive from the wrong lanes: +here no word is written. `startup_compute_dispatch_warp` uses the same stand-in, executable and WARP, with an HLSL +module compiled by DXC, and it passes. `X2W_TEST_DEBUG_LAYER=1` printed no `x2w-d3d12-debug` line. + +**Still open:** whether the native module fails in the stand-in only on WARP, or also on hardware +(`startup_compute_dispatch_native_hardware` was not run for this note). These are the first runs of this path on a +32-lane WARP, so a stand-in or translator defect is not ruled out. + +## Agility SDK 1.620.2 on this machine + +- **The export-based load fails.** Exporting `D3D12SDKVersion = 620` and `D3D12SDKPath = ".\\D3D12\\"` (the + `offscreen_check` pattern) makes every D3D12 call return `0x887E0003` (`D3D12_ERROR_INVALID_REDIST`). The loader's + debug output reads `Unable to load D3D12Core.dll. Verify D3D12SDKPath is correct.` The same happens from a second + directory on another drive. With these exports added as a local edit, the three standalone tests above skip or fail. +- **The DLL itself is fine.** `LoadLibrary` of the same `D3D12Core.dll` succeeds. + `ID3D12SDKConfiguration1::CreateDeviceFactory(620, )` loads it, and WARP 1.0.22 again reports lanes + 4 to 128. +- **Unknown:** the cause of the export-path failure on this build. +- **The opt-in build does not compile on current `main`.** `src/startup_stubs/d3d12_compute_dispatch.inl` asserts + `sizeof(D3D12_SHADER_RESOURCE_VIEW_DESC) == 40` and the same for the UAV description. With the Agility 1.620 headers + both are 48 bytes, so `d3d12_xs_shim` and `offscreen_check` fail to build when `OFFSCREEN_AGILITY_620_DIR` is set. + That is why the last four rows were measured in an options-unset build with the DLL copied in by hand. + +## #145 and the native lowerings + +`bvh_wave64_warp` still fails at field 25, the non-uniform `WaveReadLaneAt` shuffle that #145 describes. On this +machine the actual value differs from the #145 report (`f053ba18` there, `f03aeb40` here). +I have not decoded or investigated it further. + +None of the three passing native tests lowers `v_readlane`, DPP or `v_permlane*`. Those fixtures run on +`native_store_replay`, which creates its device on the default adapter and has only `_hardware` entries. So whether +#145 affects native compute on WARP is still unmeasured. + +## Reproduce + +Microsoft NuGet packages, not committed: [Agility SDK 1.620.2](https://www.nuget.org/packages/Microsoft.Direct3D.D3D12/1.620.2) +(35,006,223 bytes, kept as `sdk.nupkg` next to its x64 `D3D12Core.dll` and `d3d12SDKLayers.dll`) and +[WARP 1.0.22](https://www.nuget.org/packages/Microsoft.Direct3D.WARP/1.0.22) (15,564,228 bytes, extracted). + +```powershell +cmake --preset dev -B out/build/warp122 "-DOFFSCREEN_AGILITY_620_DIR=" "-DOFFSCREEN_WARP_DIR=/build/native/bin/x64" +cmake --build out/build/warp122 --target compile_dxil native_recording_check native_heap_handle_probe native_global_srv_heap_replay +ctest --test-dir out/build/warp122 --no-tests=error -j1 -V -R '^native_(comparison_pso|heap_handle_probe|global_srv_heap_replay)_warp$' +``` + +The stand-in rows and the gate rows need `offscreen_check` and `startup_stream_consumer`, which do not build with the +Agility option (see above). Build them with the options unset and copy the DLL in for the run: + +```powershell +cmake --build --preset dev --target offscreen_check compile_dxil startup_stream_consumer +Copy-Item /build/native/bin/x64/d3d10warp.dll out/build/dev/ +ctest --test-dir out/build/dev --no-tests=error -j1 -V -R '^(startup_compute_dispatch_native|native_startup_request_cache|shader_wave32|bvh_wave64)_warp$' +Remove-Item out/build/dev/d3d10warp.dll +``` + +## Environment + +Commit `88cddb09`. Windows 11 build 26300, in-box `D3D12Core.dll` 10.0.26100.9818 (SDK version 616). MSVC +14.44.35207, Windows SDK 10.0.26100 (DXC from that SDK), Debug build. NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), +not used: no `_hardware` test was run. WARP `d3d10warp.dll` 1.0.22.0.20261027.1 and Agility `D3D12Core.dll` +1.620.2.0.20261106.5 were Microsoft-signed. `offscreen_check` reported `debug_layer=enabled`. The native fixtures +do not enable the debug layer. + +## Hypotheses + +- The in-box result depends on this Windows build. On Windows 10, #147 found that WARP 1.0.22 on the in-box runtime + misses every DXR ray. That is why `OFFSCREEN_WARP_DIR` requires `OFFSCREEN_AGILITY_620_DIR`. The in-box runtimes of + CI runner images have not been measured. +- The cause of the two stand-in failures is unknown (see above). From 5ac1b0c44fc13dbd6d7848532ee8452244a9a502 Mon Sep 17 00:00:00 2001 From: saii <120340942+Not-Saii@users.noreply.github.com> Date: Fri, 27 Nov 2026 21:35:36 +0200 Subject: [PATCH 2/3] docs: correct the native WARP note's control, size and field-25 statements Co-Authored-By: Claude Opus 5.5 --- docs/experiments/native-compute-warp.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/experiments/native-compute-warp.md b/docs/experiments/native-compute-warp.md index c4aa931c1c..b1aa4b06ce 100644 --- a/docs/experiments/native-compute-warp.md +++ b/docs/experiments/native-compute-warp.md @@ -9,7 +9,8 @@ beside the test executables. No translator or test code changes. ## Result -**The app-local `d3d10warp.dll` is what provides 32-lane waves. The Agility SDK runtime does not.** On this machine, +**The app-local `d3d10warp.dll` is what provides 32-lane waves. The Agility SDK runtime alone does not:** loaded +through `CreateDeviceFactory` (see below), Agility 1.620.2 with the in-box WARP reports 4..4 lanes. On this machine, WARP 1.0.22 loaded by the in-box D3D12 runtime reports `WaveOps=1`, lanes 4 to 128 and SM 6.8. A configure with `OFFSCREEN_WARP_DIR` already copies the DLL into the build root, next to every test executable, so the tests below use it without any change to their CMake targets. @@ -24,8 +25,9 @@ use it without any change to their CMake targets. | `shader_wave32_warp` (gate) | `offscreen_check` | not run | pass: `forced32 width=32 waves=2 ... mismatches=0`, debug layer enabled, 0 errors | | `bvh_wave64_warp` (#145) | `offscreen_check` | not run | **fail**: `record=0 field=25 expected=f0094d90 actual=f03aeb40` | -Control: the same `warp122` binaries with `d3d10warp.dll` renamed away report `(4..4)` and skip with 77. The -executables have no export table, so the in-box `D3D12Core.dll` loads. A scratch probe started from the same +Control: with `d3d10warp.dll` renamed away, the same `warp122` binaries of `native_heap_handle_probe_warp` and +`native_global_srv_heap_replay_warp` report `(4..4)` and skip with 77. The `native_comparison_pso_warp` row in the +in-box column comes from the options-unset build. The three executables have no export table, so the in-box `D3D12Core.dll` loads. A scratch probe started from the same directory printed `C:\WINDOWS\SYSTEM32\D3D12Core.dll` and the `d3d10warp.dll` from the build root. Negative control: changing one expected word in `reference_output()` of `tests/native_global_srv_heap_replay.cpp` @@ -40,7 +42,8 @@ as before: four skip with 77 and `native_startup_request_cache_warp` passes thro Both run the native module through the stand-in (`d3d12_xs_shim`). The dispatch is recorded and the fence signals, but the output keeps its `0xc5c5c5c5` fill. This is not the #145 shape, where values arrive from the wrong lanes: here no word is written. `startup_compute_dispatch_warp` uses the same stand-in, executable and WARP, with an HLSL -module compiled by DXC, and it passes. `X2W_TEST_DEBUG_LAYER=1` printed no `x2w-d3d12-debug` line. +module compiled by DXC, and it passes. A rerun with `X2W_TEST_DEBUG_LAYER=1` set printed no `x2w-d3d12-debug` line. +I did not confirm that the debug layer was active on that path. **Still open:** whether the native module fails in the stand-in only on WARP, or also on hardware (`startup_compute_dispatch_native_hardware` was not run for this note). These are the first runs of this path on a @@ -58,14 +61,18 @@ module compiled by DXC, and it passes. `X2W_TEST_DEBUG_LAYER=1` printed no `x2w- - **Unknown:** the cause of the export-path failure on this build. - **The opt-in build does not compile on current `main`.** `src/startup_stubs/d3d12_compute_dispatch.inl` asserts `sizeof(D3D12_SHADER_RESOURCE_VIEW_DESC) == 40` and the same for the UAV description. With the Agility 1.620 headers - both are 48 bytes, so `d3d12_xs_shim` and `offscreen_check` fail to build when `OFFSCREEN_AGILITY_620_DIR` is set. + the UAV description is 48 bytes (the SRV description stays 40), so `d3d12_xs_shim` and `offscreen_check` fail to build when `OFFSCREEN_AGILITY_620_DIR` is set. That is why the last four rows were measured in an options-unset build with the DLL copied in by hand. ## #145 and the native lowerings `bvh_wave64_warp` still fails at field 25, the non-uniform `WaveReadLaneAt` shuffle that #145 describes. On this -machine the actual value differs from the #145 report (`f053ba18` there, `f03aeb40` here). -I have not decoded or investigated it further. +machine the value is different. With the #145 encoding (`0xf0000001 ^ (lane * 0x319db)`): +- expected `f0094d90` is lane 3; +- this run's `f03aeb40` decodes to lane 19; +- the `f053ba18` in #145 decodes to lane 27, the inverse permutation. + +This run used the in-box runtime, not Agility. I have not investigated it further. None of the three passing native tests lowers `v_readlane`, DPP or `v_permlane*`. Those fixtures run on `native_store_replay`, which creates its device on the default adapter and has only `_hardware` entries. So whether From a0cad96e07629455eb736a4ee764fb8327e4ad82 Mon Sep 17 00:00:00 2001 From: saii <120340942+Not-Saii@users.noreply.github.com> Date: Fri, 27 Nov 2026 21:36:52 +0200 Subject: [PATCH 3/3] docs: record the stand-in native dispatch as WARP-only (passes on hardware) Co-Authored-By: Claude Opus 5.5 --- docs/experiments/native-compute-warp.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/experiments/native-compute-warp.md b/docs/experiments/native-compute-warp.md index b1aa4b06ce..5a083bc84e 100644 --- a/docs/experiments/native-compute-warp.md +++ b/docs/experiments/native-compute-warp.md @@ -45,9 +45,13 @@ here no word is written. `startup_compute_dispatch_warp` uses the same stand-in, module compiled by DXC, and it passes. A rerun with `X2W_TEST_DEBUG_LAYER=1` set printed no `x2w-d3d12-debug` line. I did not confirm that the debug layer was active on that path. -**Still open:** whether the native module fails in the stand-in only on WARP, or also on hardware -(`startup_compute_dispatch_native_hardware` was not run for this note). These are the first runs of this path on a -32-lane WARP, so a stand-in or translator defect is not ruled out. +On the RTX 4090 (driver 32.0.16.1088), `startup_compute_dispatch_native_hardware` (all 320 words match, from an +empty cache and from a published translation) and `native_startup_request_cache_hardware` pass in the same build. +The failure is therefore specific to WARP. It happens with a native module dispatched through the stand-in, and not +with the standalone native fixtures or with an HLSL module dispatched through the stand-in. + +**Still open:** the cause. A WARP 1.0.22 defect and a translator or stand-in construct that hardware tolerates are +both possible. ## Agility SDK 1.620.2 on this machine @@ -104,7 +108,7 @@ Remove-Item out/build/dev/d3d10warp.dll Commit `88cddb09`. Windows 11 build 26300, in-box `D3D12Core.dll` 10.0.26100.9818 (SDK version 616). MSVC 14.44.35207, Windows SDK 10.0.26100 (DXC from that SDK), Debug build. NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), -not used: no `_hardware` test was run. WARP `d3d10warp.dll` 1.0.22.0.20261027.1 and Agility `D3D12Core.dll` +used only for the two stand-in `_hardware` runs. WARP `d3d10warp.dll` 1.0.22.0.20261027.1 and Agility `D3D12Core.dll` 1.620.2.0.20261106.5 were Microsoft-signed. `offscreen_check` reported `debug_layer=enabled`. The native fixtures do not enable the debug layer. @@ -113,4 +117,4 @@ do not enable the debug layer. - The in-box result depends on this Windows build. On Windows 10, #147 found that WARP 1.0.22 on the in-box runtime misses every DXR ray. That is why `OFFSCREEN_WARP_DIR` requires `OFFSCREEN_AGILITY_620_DIR`. The in-box runtimes of CI runner images have not been measured. -- The cause of the two stand-in failures is unknown (see above). +- The cause of the two WARP-only stand-in failures is unknown (see above).