Repository navigation
Description
Part of #2935 (item "WARP") and #3074 (stage 4, "Verify wave32/wave64 ... behavior").
Problem. Natively translated compute modules never run on WARP, so CI never runs one.
- Every direct compute module declares wave size 32 (
src/dxil_module.h, thei32 11, i32 32entry property;[WaveSize(32)]in the HLSL path ofsrc/gfx1013_compute_native.cpp). - The in-box WARP reports 4-lane waves (
WaveLaneCountMin/Max4/4, docs/experiments.md, subgroup compaction notes). - So the native
_warpexecution tests skip with 77, and the in-process route refuses the adapter ("the adapter has no 32-lane waves",src/startup_stubs/d3d12_compute_dispatch.inl). - Native graphics modules do not declare a wave size and already run on WARP (for example
native_graphics_wqm_warp). The gap is compute only.
What is already known.
- With the app-local Agility SDK 1.620.2 and WARP 1.0.22 (Run the D3D12 WARP checks on Windows 10 with app-local Agility SDK and WARP #147), WARP reports lanes 4 to 128 and runs a forced wave64 check (bvh_wave64_warp: WARP 1.0.22 misroutes non-uniform WaveReadLaneAt reads across lane blocks at forced widths above 8 #145). A declared
WaveSize(32)should therefore be accepted there. This is not yet measured for these modules. - bvh_wave64_warp: WARP 1.0.22 misroutes non-uniform WaveReadLaneAt reads across lane blocks at forced widths above 8 #145 also found that WARP 1.0.22 routes a non-uniform
WaveReadLaneAtas the inverse permutation at forced widths above 8. The direct path lowersv_readlane, DPP16 andv_permlane*throughwaveReadLaneAt(src/gfx1013_direct_compute.inl), so those fixtures may mismatch on WARP for a reason that is not the translator's. - Today only
offscreen_check(and the archive GPU check) loads the Agility runtime.native_store_replayand the stand-in tests do not.
Proposal.
-
Stage 1, measurement (I'm taking this). Let the native compute test executables opt into the existing
OFFSCREEN_AGILITY_620_DIR+OFFSCREEN_WARP_DIRsetup, with the same exports and DLL copies asoffscreen_checkand no change when the options are unset. Then run the native compute_warptests on WARP 1.0.22 and record, per test, whether it runs, passes, mismatches or still skips. Any mismatch is checked against the bvh_wave64_warp: WARP 1.0.22 misroutes non-uniform WaveReadLaneAt reads across lane blocks at forced widths above 8 #145 pattern before it is called a translator defect. Deliverable: the opt-in wiring, adocs/experiments/native-compute-warp.mdtable, and a known-result note for bvh_wave64_warp: WARP 1.0.22 misroutes non-uniform WaveReadLaneAt reads across lane blocks at forced widths above 8 #145-shaped mismatches. No translator change. -
Stage 2, CI (decision needed, not claimed). CI uses in-box WARP. The options are:
- (a) fetch the Microsoft-signed Agility SDK and WARP NuGet packages in the CI job, as Run the D3D12 WARP checks on Windows 10 with app-local Agility SDK and WARP #147 does locally;
- (b) emit a wave-size-independent form for programs whose masks are only read per lane;
- (c) keep native
_warpas a skip and rely on_hardware.
(a) is the smallest if stage 1 passes. (b) is translator work: a 4-lane host wave splits each guest wave32, so
EXEC/ballot values,s_bcnt1,v_readlane, DPP, scalar values written under a skippeds_cbranch_execz, and the guest-wave index for groups over 32 threads all change meaning. I'd like a maintainer's view before anyone starts stage 2.
Test for stage 1. ctest on the native compute _warp entries with both options set, plus the same entries without the options. Those must still skip with 77, so nothing changes by default. Negative control: one native compute fixture with a deliberately wrong expected word fails on WARP 1.0.22, which shows the run is real and not a skip.
Environment: Windows 11 build 26300, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), Windows SDK 10.0.26100. WARP 1.0.22 and Agility SDK 1.620.2 app-local, from the Microsoft NuGet packages (not committed).
AI-assisted.
Activity
RonLogic commentedon Nov 27, 2026
Independent setup finding on Windows 11
26300.10075and Visual Studio 2026 18.12.1. With the official 1.620.2sdk.nupkgpresent inOFFSCREEN_AGILITY_620_DIR, buildingoffscreen_checkstops at the existingstatic_assertinsrc/startup_stubs/d3d12_compute_dispatch.inl: it requires both texture view descriptors to have size 40. The same assertion is onmain88cddb09. A trivial x64 probe printingsizeof(D3D12_SHADER_RESOURCE_VIEW_DESC)andsizeof(D3D12_UNORDERED_ACCESS_VIEW_DESC)measured40/40with SDK 10.0.26100 headers and40/48with the 1.620.2 headers. I am retesting the existingoffscreen_checkdirect atomics/gather fixtures through the DLL-only Agility configuration to isolate runtime behavior. This does not change your test-runner wiring.RonLogic commentedon Nov 27, 2026
Independent readback at
ed946ef8(#3162) using Agility DLLs only with SDK 10.0.26100 headers. Windows 1126300.10075, DXC1.9.2602.17, WARP1.0.22.0, debug layer enabled. In-box WARP10.0.26100.10068exposed4..4and skipped all four checks below. App-local WARP exposed4..128.shader_wave32_warpffffffffwere correct.wave_shuffle_warp0/64correct and64/64block-misrouted, rotation48/64correct. Native width 8 passed.native_image_atomic_warpCheckFeatureSupport1) in the DLL-only configuration. A separate replay matched all 336 words in each of the seven fixtures and rejected all three mutations that clear GLC.native_gather_lod_cs_warpword=0 expected=3f102100 actual=c5c5c5c5). A direct constant-only store reproduced the failure with 1 or 4 threads, and passed with 32.The gather failure can be separated from #145 and from the gather lowering. This independent DXC
cs_6_6control stores the entry mask without usingWaveReadLaneAtor any texture reads:I compiled this with
dxc -T cs_6_6 -E mainand usednative_gather_lod_check.render_computewith expected words[1, 0, 32, 0x12345678]followed by 316 sentinels. On WARP, group sizes 1 and 4 returned a zero ballot, where1and0xfwere expected. Group size 32 matched. RTX 4070 with the same Agility runtime matched all three sizes. A plain constant store without the ballot also passed on WARP at sizes 1, 4 and 32.Reproduction of the stock checks:
ctest --test-dir out/build/warp-1022 --no-tests=error -j 1 -R '^(shader_wave32_warp|wave_shuffle_warp|native_gather_lod_cs_warp|native_image_atomic_warp)$' -V. This uses the existing offscreen runner. Treat partial-wave ballots and per-lane shuffles as separate WARP failure classes when interpreting the upcoming runner results.RonLogic commentedon Nov 27, 2026
I’ll take the pre-existing Agility header build failure as a separate runtime fix. The scope is the temporary descriptor storage used when rebinding published Compute texture views. I’ll verify both SDK header configurations and leave the native WARP runner wiring and stage-2 options to your work.
Not-Saii commentedon Nov 27, 2026
Stage 1 measurement. It changes the plan above, so this note adds no wiring. The details are in
docs/experiments/native-compute-warp.md(#3166).The app-local WARP gives 32-lane waves here, not Agility. On Windows 11 build 26300 the in-box
D3D12Core.dllis 10.0.26100.9818 (SDK version 616). Loaded by that runtime, with noD3D12SDKVersionexport, WARP 1.0.22 reportsWaveOps=1, lanes 4 to 128 and SM 6.8. A configure withOFFSCREEN_WARP_DIRalready copiesd3d10warp.dllbeside every test EXE.native_comparison_pso_warpnative_heap_handle_probe_warpnative_global_srv_heap_replay_warpmismatch word 5).startup_compute_dispatch_native_warp0xc5c5c5c5fill (288 words)native_startup_request_cache_warpcompute dispatch output mismatch(translated branch)shader_wave32_warpbvh_wave64_warpf03aeb40decodes to source lane 19 (expected 3; the value in #145 decodes to 27, the inverse)With the DLL removed, the same binaries of the heap-probe and heap-replay tests report
(4..4)lanes and skip with 77. Without the options, the five native tests behave as before.The two stand-in failures are not #145-shaped: no word is written at all.
startup_compute_dispatch_warp(HLSL module, same stand-in and WARP) passes. On the RTX 4090,startup_compute_dispatch_native_hardwareandnative_startup_request_cache_hardwarepass in the same build. So the failure is WARP-only. Its cause, a WARP 1.0.22 defect or a construct in the native module that hardware tolerates, is not established.Agility on this machine.
D3D12SDKVersion = 620,".\\D3D12\\", theoffscreen_checkpattern) fails with0x887E0003. The loader saysUnable to load D3D12Core.dll. Verify D3D12SDKPath is correct.ID3D12SDKConfiguration1::CreateDeviceFactory(620, <absolute path>)loads the same DLL.main: the 40-byte view-descriptionstatic_assertfrom startup: compute input named by a resource heap record a root constant indexes #2532 fails, because the UAV description is 48 bytes in the 1.620 headers. Filed as build: OFFSCREEN_AGILITY_620_DIR builds fail on a 40-byte view-description static_assert #3165.Coverage gap. The
v_readlane, DPP andv_permlane*fixtures run onnative_store_replay, which uses the default adapter and has only_hardwareentries. Whether #145 affects native compute is still unmeasured.For stage 2, option (a) becomes "fetch the WARP package", with Agility only if a runner's in-box runtime needs it. Before CI can rely on it:
OFFSCREEN_WARP_DIRrequiresOFFSCREEN_AGILITY_620_DIR(added for the Windows 10 DXR results in Run the D3D12 WARP checks on Windows 10 with app-local Agility SDK and WARP #147), which now forces a configuration that does not build.Environment: Windows 11 build 26300, MSVC 14.44.35207, Windows SDK 10.0.26100, Debug, commit
88cddb09. RTX 4090 (driver 32.0.16.1088) for the two stand-in_hardwareruns only.d3d10warp.dll1.0.22.0.20261027.1 andD3D12Core.dll1.620.2.0.20261106.5 are Microsoft-signed. Debug layer enabled inoffscreen_check; the native fixtures do not enable it.AI-assisted.
docs: measure native wave32 compute on app-local WARP 1.0.22 (#3160 s…
xiaoqi72665 commentedon Nov 27, 2026
Independent Windows 10 / RX 7900 XT result: partial-wave ballots explain the 288 missing stores
Follow-up to #3166 and @RonLogic's partial-wave control above. Tested the retained local test-only candidate
2485076(basee0d8375on cpp-migration); its earlier equivalent candidatebd7a32fsupplied the original 57-pass / 1-fail native run. No production lowering changes.Environment: Windows 10 22H2 build 19045, AMD RX 7900 XT (1002:744c), driver 32.0.32029.2010, Windows SDK 10.0.26100 DXC, Debug build, signed app-local Agility 1.620.2 and WARP 1.0.22.0. D3D12 debug layer unavailable (0x887a002d).
Windows 10 difference from #3166: copied the original options-unset offscreen_check.exe and only WARP's d3d10warp.dll into an isolated directory (no Agility exports/D3D12 directory).
offscreen_check.exe warp --shader-wave32reported driver 1.0.22.0, range 4..128, shader model 0x65, then skipped with 77. With app-local Agility 620 DLLs, the earlier wave32 preflight actually passed on both adapters at SM 6.6. For #3165, keeping sdk.nupkg outside the OFFSCREEN_AGILITY_620_DIR and pointing it at a DLL-only directory preserves the desktop 40-byte view structures and builds without modifying the assertion. This is a local workaround, not the descriptor ABI fix already claimed.New sweep: independent DXC cs_6_6 source, not the native compiler; same source-built slot67 runtime fixture and descriptor manifest, only the published CSO and group-shape field substituted in a copied cache. Dispatch(3,2,2), write group zero only, complete 320-DWORD readback with untouched sentinel guards.
Compile with
dxc -T cs_6_6 -E main -Fo probe.cso probe.hlsl. Replace group dimensions in the source and manifest consistently. Every written record on each adapter was inspected:All 16 runs reported width 32 and lane indices 0..N-1; every guard was intact. This independently confirms the zero low ballot for the tested partial-wave sizes and an additional active-count discrepancy at 24 and 31. Full 32-thread control passes. It does not establish the behavior of every possible group shape or WARP version.
Connection to #3166's missing writes: on the original 2x3x4 cache fixture, native DXIL on WARP left 288 expected writes at 0xc5c5c5c5, hardware matched all 320 words. Python lowering of the same request on WARP matched all 320; native and Python binding manifests were identical. Independent DXC arithmetic/store shaders using either SV_GroupIndex or WaveGetLaneIndex matched on WARP without the ballot gate, but with
(WaveActiveBallot(true).x & (1u << WaveGetLaneIndex())) != 0all 288 writes were absent. The native DXIL initializes EXEC with the same low ballot and gates stores on it. This explains the observed missing stores without changing the compiler or relaxing the assertion. No WaveReadLaneAt operation is required, so keep this distinct from #145.The local test-only environment candidate is retained, not submitted as a competing wiring PR while #3160 and #3165 are owned. Stage 2 CI remains a separate maintainer decision.
Buhe (@xiaoqi72665). AI-assisted; source-built fixtures executed locally.
RonLogic commentedon Nov 27, 2026
The full-header setup fix is ready for review in #3223 (fixes #3165). With Agility 1.620.2 headers and signed DLLs, the four translated texture dispatch cases passed on both backends, including the 3D and swapped-mip controls. On app-local WARP 1.0.22,
shader_wave32_warpand the stocknative_image_atomic_warpnow pass with the debug layer enabled. The earlier warning-989-only failure came from the DLL-only build. All seven atomic readbacks matched and all three GLC mutations were detected.RonLogic commentedon Nov 28, 2026
I ran a source HLSL readback matrix on Windows 11 build 26300.10075, DXC 1.9.2602.17, Agility 1.620.2, and app-local WARP 1.0.22. The same SM 6.6 DXIL ran on RTX 4070 (32.0.16.2124) and WARP. Each invocation recorded its lane index and wave width. The CPU reconstructed the full and sparse masks from those indices, then checked every invocation's ballot, OR, count, and workgroup atomic result.
Nx1x1for N=1..32, plus2x2x2,3x2x2, and4x4x2.WaveActiveBallotreturned zero for both predicates on all 33 shapes with fewer than 32 threads. Both full-width shapes matched.WaveActiveBitOrandWaveActiveCountBitsworked at 1–8, 16, 24, and 32 threads in the linear matrix, but lost the tail at other sizes. At 9 threads, the full mask/count wereff/8instead of1ff/9; the sparse mask was6dinstead of16d. A repeated 9-thread WARP readback was byte-identical and had zero debug errors or warnings. Replacing ballot with either reduction would leave a gap.groupshared InterlockedOrmatched both masks on every shape on both backends. In the 32-thread tiled case both adapters returned sparse mask799ee779, which also shows why a sparse reference based on flat thread index alone would misreport that case.The 9-thread reproducer is below. Compile with
dxc -T cs_6_6 -Fo probe.dxil probe.hlsl; then runoffscreen_check <hardware|warp> --raw-uav-dump probe.dxil 1 432 probe.bin. Read 12 little-endian uint32s per thread. The 32-thread control uses the same source withnumthreads(32,1,1)and 1536 bytes.This confirms a converged, single-workgroup control. The group-shared result depends on every thread reaching both barriers, so it does not establish a replacement for general divergent wave operations.