Repository navigation
d3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept (D3D-EXECIND-RANGE-CARRY) - #1066
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>
KernelSmoker
left a comment
There was a problem hiding this comment.
Reviewed the range change on head 10f7fc2. The checked formula, (max_count - 1) * stride + record_size, matches the bytes consumed by the final indirect record; zero count performs no Vulkan dispatch iterations. The Vulkan replay uses the same final-record range, with alignment retained for zero-count offsets. The added overrun rows distinguish cases where the record itself exceeds the resource. The PR merges cleanly onto current main; no-game-data and diff checks pass; an independent boundary arithmetic check passed 8/8. This Linux host cannot run the Windows D3D12/WARP/hardware integration test; those results are PR-author-reported and not counted as locally reproduced.
|
Tested on a 7th host: NVIDIA GeForce RTX 4070 SUPER (Ada), driver 621.24, Windows 11 build 26300.9974, Windows SDK 10.0.28000.0, Vulkan SDK 1.4.363.1, MSVC 19.42 with Ninja, RelWithDebInfo. Built and ran at 10f7fc2 (this branch).
No game files needed. AI-assisted (Claude Code). |
|
Tested 10f7fc2 on NVIDIA GeForce RTX 4060 (Ada), driver 617.42, Windows 11 Pro build 26200 (d3d12core.dll 10.0.26100.7309), native Windows: pass. This is a 26100-based d3d12core rather than 26300, and it already has the relaxed behaviour: on main @ 6293c1c the test failed the same five cases (arg_offset=260 >width (max=0 no-op), arg_offset=U64MAX-3 aligned (max=0 no-op), draw stride=20 off=240 max=1, draw stride=20 off=220 max=2, dispatch stride=20 off=244 max=1), with WARP and HW both returning S_OK. So the fix is needed on stock Windows 11, not only 26300+. Built at this head with
AI-assisted (Claude Code ran the build and tests). No game files. |
|
Tested 10f7fc2 applied onto main 23c4596 on an AMD Radeon RX 7900 XT: d3d12_execute_indirect_validation fails on main (5 failures) and passes with this PR, 4/4 runs. No new failures in the full ctest run. Hardware/software: AMD Radeon RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010 (Adrenalin 26.11.2), Windows 11 build 26300, D3D12Core.dll and d3d10warp.dll 10.0.26100.9818, VS 2022 (x64, RelWithDebInfo), Vulkan SDK 1.4.363.0. No game files. Build: Targeted test:
On main the five failures are the five rows this PR marks The AMD hardware path answers the same as WARP on every row of the table, including the two new overrun rows ( Full ctest, run once on each build:
The only difference is d3d12_execute_indirect_validation going from failed to passed. The other four fail on main on this machine too and are unrelated (d3d12_clear: #787; d3d12_pipeline_library_host: #533, merged after this base; d3d12_texture_tiles: #964). I also read the change before running it. I found no problem with the range rule itself: recording and replay use the same bound,
Not tested: NVIDIA, Intel, other AMD drivers, Wine/Proton. |
|
Merged. This was compared with the test-only alternative (#306 / #749), and it is the better fix because it changes the layer itself:
AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
Claimed in the coordination issue as: D3D-EXECIND-RANGE-CARRY
Fixes: #504
What and why
d3d12_execute_indirect_validationis red onmainon current Windows 11: the layer refuses fiveExecuteIndirectcalls that live WARP and the hardware driver both accept (#504, reported from seven machines today). #337 by @natterman12 fixed it and was verified independently on six hosts (RTX 5070 Ti, 4060 Ti, 5070, 2060 SUPER, Radeon 660M, and Linux replay on an RTX 3060), but its author closed it on 24 November along with his other open pull requests, so nothing open carries the fix.This is that one commit,
7f96cff90, cherry-picked onto currentmainwith its author kept. No change of mine is in it; the cherry-pick applied without conflicts.(max_count - 1) * stride + record_size, and checks no range at a zero count, in recording (d3d12_com.cpp) and in replay (vulkan_replay.h).@natterman12: this is your work. If you reopen #337 or want this branch, say so and I will close this.
The alternative is draft #306 (old PR 10041), which keeps the layer strict and relaxes the test only. Only one of the two should land.
Tested
Windows 11 26200.9974, D3D12Core and
d3d10warp.dll10.0.26100.9818, MSVC 14.44.35207 with Ninja,RelWithDebInfo, Windows SDK 10.0.26100.0, Vulkan 1.4.357. Built and run at base32950551e; the four commitsmaingained since do not touchruntime/.main32950551ectest -j 6d3d12_execute_indirect_validationOn
mainthe five failing rows are the ones in #504, eachlayer=0 warp=1 hw=1 expected=0: the two aligned offsets past the buffer atmax=0, and the three padded-stride exact fits (240+20,220+40,244+20in a 256-byte buffer). The two new overrun rows (244+16>256,224+20+16>256) are refused by the layer, WARP and the hardware alike.python -I scripts/check_no_game_data.pyon the three changed files: no hits.git diff --check: clean.GPUs tested: NVIDIA GeForce RTX 3060 Ti (Ampere), driver 621.14, Windows 11 26200
AI-assisted: yes (Claude Code; built, run and measured on the machine above)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: n/a (no translator rule).🤖 Generated with Claude Code