mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #337] [CLOSED] d3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept (D3D-EXECIND-RANGE) #389
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#389
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/337
Author: @natterman12
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:d3d12/execute-indirect-host-divergence📝 Commits (1)
7f96cffd3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes accept📊 Changes
3 files changed (+63 additions, -26 deletions)
View changed files
📝
runtime/shims/d3d12_com.cpp(+13 -6)📝
runtime/src/vulkan_replay.h(+7 -7)📝
runtime/test/d3d12_execute_indirect_validation_test.cpp(+43 -13)📄 Description
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_count0e1ec785b2moved 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, #262 / #238) andd3d12_depth_resolve(#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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.