Repository navigation
d3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept (D3D-EXECIND-RANGE) - #337
Conversation
…es accept PC D3D12 runtimes disagree on five ExecuteIndirect cases. Older Windows 11 builds bound max_count * stride and check the argument offset at a zero count; newer ones (D3D12Core 10.0.26100.9818 on Windows 11 26300, WARP and NVIDIA alike) bound (max_count - 1) * stride + record_size and check nothing at a zero count. e1ec785 moved the layer to the older rule, so d3d12_execute_indirect_validation failed on every newer host, as it had failed on older ones before. The layer takes the wider rule again, in recording (d3d12_com.cpp) and in replay (vulkan_replay.h): it is the rule vkCmdDraw*Indirect states, no byte outside the buffer is read, and a refusal drops the whole command list for a call a shipping runtime runs. The test marks the five cases host_varies: the layer has to accept them and a live host may answer either way, so the test stops failing on one group of machines or the other. Two cases that neither rule accepts are added, and the positive GPU path replays both disputed shapes with validation on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Tested on a second host with the runtime this PR describes. Host: NVIDIA GeForce RTX 4060 Ti (driver 32.0.16.1088), Windows 11 26300, D3D12Core and WARP (
So this host's runtime has the same (AI-assisted: Claude Code ran the build and tests.) |
|
Tested 7f96cff on Linux with an RTX 3060. The runtime suite reported 68 passed, 2 skipped, and 0 failed. In a replay harness, the PR accepted all three padded-stride cases where the last indirect record ended exactly at the buffer boundary. The merge base (84347bb) rejected those same cases. The PR still rejected all three cases where the last record extended past the buffer. This covers the Linux replay path. The Windows D3D12 shim and its ExecuteIndirect validation test remain unverified in this run. |
|
Independent check on Windows 11 26100.7623, RTX 5070 Ti (610.74), MSVC 19.44.35220 Release. I verified that this test process loaded the system D3D12Core.dll and d3d10warp.dll, both 10.0.26100.7309.
This extends the measured wider behavior to D3D12Core 10.0.26100.7309 on Windows build 26100. Vulkan validation was off for these runs because the Khronos validation layer was unavailable on this host. Synthetic fixtures only. AI-assisted verification. |
|
Reviewed the diff against What I checked in the layer change itself:
Two notes for whoever triages this against draft #306:
Not reviewed here: the 🤖 AI-assisted (Hermes agent; CPU review only, no measurements added) |
Independent GPU verification — RTX 5070 and RTX 2060 SUPERTested PR head Test environments
ExecuteIndirect results
All five previously failing cases now return S_OK on the layer, WARP and hardware D3D12 on both systems. Both newly added out-of-bounds cases are correctly rejected on all three paths. Verified against the complete Full Runtime CTest
Both systems reproduce the known The five additional RTX 2060 SUPER failures were also present in my earlier baseline at All eight tested ExecuteIndirect-related runtime checks pass on both systems. ConclusionThe wider argument-range behavior is confirmed on Blackwell and Turing, including both VRAM-backed and system-memory upload heaps. Limitations: Global Vulkan validation was not enabled. Exact loaded D3D12Core and WARP DLL versions were not collected. The earlier baseline was not the exact PR merge base. AI-assisted testing and report analysis. |
…on main 21625bc (GPU-RTX5070TI-WIN) run_gpu_tests.py on a clean main build: 257/257 translated and valid; 197/248 passed, 49 skipped native, 229/248 passed, 17 skipped with LEONIDA_W64_EMULATE=1; the two failures are the known tfe fixtures (#31). Runtime CTest: 281 passed, 11 skipped, 1 disabled, 1 failed (the known d3d12_execute_indirect_validation parity cases, #337 / #306). ms_wave_info_s3 passes, so the original repository's issue 8369 no longer reproduces on this GPU. The record is indexed in docs/gpu_test_results.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: D3D-EXECIND-RANGE (#14)
Alternative to: #306 (draft, carried over from
old-pr/10041). Both start from the same measurement; they decide the layer's behaviour in opposite ways, so please take one and close the other. See "Why not only the test" below.What and why
d3d12_execute_indirect_validationfails onmainon any host with a current D3D12 runtime. PC runtimes disagree on fiveExecuteIndirectcases:max_count * stride(max_count - 1) * stride + record_sizemax_count0e1ec785 moved the layer from the wider rule to the narrower one to match the hosts its author had, which made the test fail on every host with the wider rule, as it had failed on narrower hosts before. On this machine:
49 parity cases ... 5 failures, eachlayer=0 warp=1 hw=1 expected=0.This change:
runtime/shims/d3d12_com.cpp): the argument range is(max_count - 1) * stride + record_size, checked only whenmax_countis non-zero. The record-size, stride, alignment, buffer-dimension and count-buffer checks are unchanged.runtime/src/vulkan_replay.h): the same arithmetic. A zero count, which recording never passes on, needs alignment only.host_varies. The layer has to accept them; a live host may answer either way and is reported, not judged. Every other case still requires layer, WARP and hardware to agree. Two cases neither rule accepts are added (244+16>256,224+20+16>256), so the wider rule's own boundary is pinned. The positive GPU path now also replays a padded-stride dispatch at the end of the buffer and a zero count at an offset outside it, with validation on.Why not only the test
Keeping the layer strict and making the test tolerant (the approach of #306) leaves the layer refusing calls that the current Windows runtime runs. A refusal here fails
Close()and the whole command list is dropped. Accepting costs nothing:vkCmdDrawIndirect/vkCmdDrawIndexedIndirect(stride * (drawCount - 1) + offset + sizeof(command) <= size), so replay needs no special handling;What neither pull request can answer is which rule the console's own driver applies; that needs the executable. If you would rather keep the layer strict until then, #306 is the one to take.
Tested
Windows 11 10.0.26300.9974, NVIDIA GeForce RTX 3080 Ti, driver 621.24, D3D12Core and WARP 10.0.26100.9818, MSVC 19.44.35230, Vulkan SDK 1.4.363.0. Clean build of this branch (
RelWithDebInfo). No game files.d3d12_execute_indirect_validation: before, 5 failures of 49 cases. After:51 parity cases (WARP=live, HW=NVIDIA GeForce RTX 3080 Ti), positive GPU dispatch ok, 0 validation errors, 0 failures, andruntime-dependent cases: the live hosts accepted 10 and refused 0 answers. The two added cases are refused by the layer, WARP and the hardware driver alike.ctest: 290 tests, 2 failed, 9 skipped. The two ared3d12_vulkan_device(line 6576: tiles == 1, d3d12_vulkan_device_test: CreateReservedResource2 through the inner device (slot 78 is SetFrameIntervalX on the Xbox proxy) #262 / d3d12_vulkan_device_test: query ID3D12Device10 on inner device to avoid slot 78 SetFrameIntervalX shadow #238) andd3d12_depth_resolve(d3d12_depth_resolve_test: clears, resolve and read-back as three lists (refused cases fail since 4da716493) #66); both fail the same way onmainhere.d3d12_indirect_zero,d3d12_indirect_rt,d3d12_indirect_rt_upload_sysmem,d3d12_indirect_dispatch_count,d3d12_state_mapandcommand_listpass.%TEMP%, MSBuild warns (MSB8029) and then does not rebuild after a header edit, so my first run tested stale code. The numbers above are from a clean build outside%TEMP%.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (not applicable: no translator change)🤖 Generated with Claude Code