runtime: bind directly indexed sampler heap in native compute #3781
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3781
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3779"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@R0D4X on GitHub · 2026-12-01 19:30 UTC · original
R0D4X:runtime/native-compute-sampler-heap→main· +216 −11 · 5 files · 2 commits · merged 2026-12-02 02:39 UTCFixes #3076
Refs #2935
Summary
Completes the remaining scope of #3076: binding the directly indexed sampler heap (
ComputeViewKind::heap_sampler) on the in-process native compute translation route (translate_compute_natively), matching the published-manifestsmpidx <bytes>path (#3542, #3628).Changes
src/startup_stubs/d3d12_compute_dispatch.inl:tr.sampler_heap_bytes = 0inrefuse_nativeso a failed native translation cannot leave a stale span before a fallback manifest read.ComputeViewKind::heap_samplerbinding before sorting and validating SRV/UAV registers, enforcing the same span invariants asformat_compute_runtime_manifestand the manifest reader (compute_sampler_heap, register 0, array count 1, nonzero multiple of 16 bytes, <=16 * 2047) and storing it intr.sampler_heap_bytes.tests/startup_compute_sampler_heap_check.pyandtests/cmake/startup_compute_sampler_heap.cmake:nativemode (X2W_NATIVE_SHADERS,X2W_NATIVE_SHADERS_ONLY=1, no published.cs.csoor<key>.txt) registered asstartup_compute_dispatch_sampler_heap_native_{warp,hardware}.tests/standin_exports_check.py:x2w_d3d12_compute_censusinsrc/startup_stubs/d3d12_compute_dispatch.inlfrom the source file instead of hardcoding:1744, keeping the exactpath:lineassertion without breaking on edits tod3d12_compute_dispatch.inl.Verification
9e5a0947(based onmain158ef794)10.0.26300.9974), MSVC19.44.35230, Windows SDK / DXC10.0.26100.0, NVIDIA GeForce RTX 5080 (10de:2c02, driver32.0.16.2140), Microsoft Basic Render Driver (10.0.26100.9818), D3D12 debug layer enabled (no error messages).Commands and results
dev(Debug):startup_compute_dispatch_sampler_heap_warp: Skipped (77) —adapter has no 32-lane waves(manifest and 6 reader refusals verified)startup_compute_dispatch_sampler_heap_hardware: Passed (6.28 s, RTX 5080, debug layer clean)startup_compute_dispatch_sampler_heap_native_warp: Skipped (77) —the adapter has no 32-lane wavesstartup_compute_dispatch_sampler_heap_native_hardware: Passed (4.63 s, RTX 5080, debug layer clean)release(/O2):startup_compute_dispatch_sampler_heap_warp: Skipped (77) —adapter has no 32-lane wavesstartup_compute_dispatch_sampler_heap_hardware: Passed (6.28 s, RTX 5080, debug layer clean)startup_compute_dispatch_sampler_heap_native_warp: Skipped (77) —the adapter has no 32-lane wavesstartup_compute_dispatch_sampler_heap_native_hardware: Passed (4.77 s, RTX 5080, debug layer clean)Fail-first / mutation control
Reverting the
d3d12_compute_dispatch.inlhunk and rebuildingd3d12_xs_shimfailsstartup_compute_dispatch_sampler_heap_native_hardware(exit 8) with:Pure-Python checks
standin_exports: 470 cases, 6/6 mutations killed PASSdocs_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 on GitHub · 2026-12-01 21:57 UTC · original · reviewed
Reviewed
9e5a09475. Thanks for the change. The skip attests/startup_compute_sampler_heap_check.py:118looks forroot signature creation failed (adapter lacks directly indexed sampler heap). The runtime emitsthe device does not take a directly indexed sampler heapatsrc/startup_stubs/translated_sampler_bindings.h:186, so the skip never matches. An unsupported adapter can also reject the fixture's initial root signature attests/startup_stream_consumer.cpp:1482, before native translation, and the test then fails instead of skipping. Please detect that capability before creating the fixture and return 77 for that case.The entry-2047 case at
tests/startup_compute_sampler_heap_check.py:170reaches the existing frontend refusal atsrc/gfx1013_direct_compute.inl:892, so removing the new runtime span guard would still pass it. To test the guard, please exercise it with out-of-range binding metadata.@R0D4X on GitHub · 2026-12-01 23:08 UTC · original
Addressed both review points in
63f63251:tests/startup_compute_sampler_heap_check.pytothe device does not take a directly indexed sampler heap(matchingsrc/startup_stubs/translated_sampler_bindings.h:186).sampler-heap-probemode intests/startup_stream_consumer.cppthat checksD3D_SHADER_MODEL_6_6andD3D12_RESOURCE_BINDING_TIER_3beforecreate_slot67runs and returns77on unsupported adapters instead of failingCreateRootSignature.compile_dxil --prepare-compute-pack) for theSAMPLErequest and patched itsheap_samplerbinding metadata (required_bytes=0,20,32768, andshader_register=1), then ranstartup_stream_consumerwithX2W_NATIVE_COMPUTE_PACKand verified each is refused bytranslate_compute_nativelywitha sampler heap span that is not 16-byte entries below the fallbackand leaves the output untouched. These 4 controls also run on WARP before the wave32 capability skip.Re-verified on
dev(Debug) andrelease(/O2) on Windows 11 (10.0.26300.9974), RTX 5080 (32.0.16.2140) + WARP (10.0.26100.9818):startup_compute_dispatch_sampler_heap_native_hardware: Passed (dev5.79 s /release5.66 s, debug layer enabled, no error message)startup_compute_dispatch_sampler_heap_native_warp: Skipped (77) after verifying all 4 runtime span guard controls.