d3d12: test bundle ExecuteIndirect(DISPATCH) and fix the stale bundle note (D3D-BUNDLE-EXECUTE-INDIRECT) #2575
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2575"
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?
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:54:31Z.
Claimed in the coordination issue as: D3D-BUNDLE-EXECUTE-INDIRECT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7240691025)
Item: D3D-BUNDLE-EXECUTE-INDIRECT
What and why
Doc fix and regression test, no shim code change.
ExecuteIndirectin a bundle is already deferred on main(
ba626820e): a single DRAW, DRAW_INDEXED, DISPATCH or DISPATCH_MESH operation with no count buffer plays at eachExecuteBundlewith the parent's state at that call. Only DRAW/DRAW_INDEXED had a GPU test, anddocs/d3d12_vulkan.md(bundles) still listed it as "Not deferred yet". A test failing on main is therefore notpossible; the new test instead fails when the bundle branch of
ExecuteIndirectis disabled.d3d12_indirect_dispatch_count_test --bundle(ctestd3d12_bundle_indirect_dispatch): a fixed-count DISPATCHrecorded in a bundle, executed twice from a direct list with a different parent root UAV each time, then a direct
Dispatch. The layer, WARP and the default adapter all give 6/10 7/11 1/1, with and without the bundle setting theparent's root signature first. A count buffer or a root-constant signature fails the bundle's
ClosewithE_INVALIDARGon both host adapters, as on the layer.ExecuteIndirectsection points tothe new test.
Tested
On the branch merged with current main: the new test,
d3d12_bundle_test(default,--indirect-bundle-layer,--indirect-bundle-warp),d3d12_bundle_forbidden_testandd3d12_indirect_dispatch_count_testpass. With thebundle branch of
ExecuteIndirectdisabled, the new test and--indirect-bundle-layerfail.check_no_game_data.pyis clean on the three files.GPUs tested: NVIDIA GeForce RTX 4060, driver 610.88, Windows 11 10.0.26300.9974; WARP on the same machine.
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T15:34:59Z.
Code review location:
runtime/test/d3d12_indirect_dispatch_count_test.cpp; line 259The test description says the parent's UAV remains bound after
ExecuteBundle. This explicit rebind makes the existing readback unable to detect losing that argument. I added a UAV barrier and a direct dispatch immediately after the secondExecuteBundle, before changing the UAV. The resulting6/10 7/11 1/1passed on the Vulkan layer, WARP and native D3D12 in bothsame_rootmodes. Could the fixture keep that extra readback check?Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T15:34:59Z.
Review: COMMENTED
Tested
860eea035merged locally withmainc1ecf04edcon Windows 11, MSVC 19.44, RTX 5070 (610.88).d3d12_bundle_indirect_dispatch,d3d12_indirect_dispatch_countandd3d12_indirect_group_budgetpassed. WARP, native D3D12 and the Vulkan layer agreed on both bundle variants and refused both invalid signatures withE_INVALIDARG.I also ran the direct-dispatch retention check described inline. The extra case passed on all three paths.
AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T19:45:37Z.
Code review location:
runtime/test/d3d12_indirect_dispatch_count_test.cpp; line 259Added in
b5447692f(UAV barrier and a directDispatch(1, 1, 1)right after the secondExecuteBundle, before any rebind): 6/10 7/11 1/1 on the layer, WARP and native D3D12 (RTX 4060, 610.88) in bothsame_rootcases, merged with current main in3c108a339. Thanks. AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-28T20:02:20Z.
Review: APPROVED
Re-reviewed
3c108a339(includingb5447692fand themainmerge) and verified on RTX 5070 with Khronos validation enabled.Code audit:
runtime/test/d3d12_indirect_dispatch_count_test.cpp,docs/d3d12_vulkan.md: adding the UAV barrier and directDispatch(1, 1, 1)immediately after the secondExecuteBundlewithout rebinding cleanly proves the parent's root UAV survives the bundle (6/10 7/11 1/1in bothsame_rootmodes across the Vulkan layer, WARP, and native D3D12).Verification at
3c108a339(Windows 11, MSVC 19.44, Ninja Release,LEONIDA_VK_VALIDATION=1):d3d12_indirect_dispatch_count_test.ctest -R '^(d3d12_bundle_indirect_dispatch|d3d12_indirect_dispatch_count|d3d12_indirect_group_budget)$': 3/3 passed (0 validation errors).python -I scripts/check_no_game_data.py: passed.GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341,
VK_LAYER_KHRONOS_validation1.4.363).AI-assisted (Antigravity, Gemini).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T20:02:45Z.
@DadaCap could you review this one when you have a moment? It merges cleanly with
main. The red checks are the three tests that fail onmain5cb45921etoo, already claimed:test_valu_cvt_f16_int16_mods(translator f16),test_the_loader_gets_the_stack_reserve_cmake_gives_it(loader stack) andtest_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive(path dedup). None of them touches this diff. TheERROR:lines in those logs come from tests that pass.AI-assisted (Claude Code, Claude Opus 5.5), posted for MoonEyes.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:50:49Z.
Physical Hardware Verification — Windows 11 + NVIDIA GeForce RTX 3090 (
610.88, Khronos Validation1.4.363.1) + WARPVerified head commit
3c108a33959e82a143f7a6c055f0c20f876c9842cleanly merged (no-commit) ontoorigin/main(1bc055e6c2dedaa0de23ec79d8c4007c1dff1fb3;git merge-tree --write-treerc=0, and also conflict-free with#2582).Red -> Green Verification
origin/main1bc055e6c2): CTestd3d12_bundle_indirect_dispatchdoes not exist (ctest -R "^d3d12_bundle_indirect_dispatch$"finds0tests), and passing--bundletod3d12_indirect_dispatch_count_testonorigin/mainis ignored without checkingargcor running any bundle test.origin/main+3c108a3395, built with MSVC19.44,LEONIDA_VK_VALIDATION=1):d3d12_indirect_dispatch_count_test --bundle:WARP: bundle ExecuteIndirect Close with a count buffer 0x80070057, with a root constant 0x80070057the default adapter: bundle ExecuteIndirect Close with a count buffer 0x80070057, with a root constant 0x80070057(NVIDIA GeForce RTX 3090 native D3D12)device: NVIDIA GeForce RTX 3090 (validation on)bundle ExecuteIndirect(DISPATCH): layer and 2 host adapter(s) gave 6/10 7/11 1/1 in both cases; count buffer and root constant refused(0Khronos Vulkan validation errors acrosssame_root = falseandsame_root = true).ctest -C Release -R "^(d3d12_bundle_indirect_dispatch|d3d12_indirect_dispatch_count|d3d12_indirect_group_budget)$" --output-on-failure -j 4: 3/3 passed.python -I tests/test_docs_encoding.py(1/1),python -I tests/test_docs_links.py(17/17),python -I tests/test_docs_env_vars.py(5/5), andpython -I scripts/check_no_game_data.py docs/d3d12_vulkan.md runtime/CMakeLists.txt runtime/test/d3d12_indirect_dispatch_count_test.cpp(0issues) all pass.Code Review Notes
Dispatch(1, 1, 1)immediately after the secondExecuteBundlebehind a UAV barrier without rebindingSetComputeRootUnorderedAccessViewverifies that the parent direct list's root signature and root UAV survive bundle replay (7/11in slot 1,1/1in slot 2), whilebundle_refusalschecksClose()(E_INVALIDARG) without submitting the rejected bundle. No blockers found.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-28T21:29:40Z.
Re-checked on
mainc8bf0e7b6(head unchanged,3c108a339). GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300:d3d12_bundle_indirect_dispatchandd3d12_indirect_dispatch_countpass on the merge.ExecuteIndirectcut inruntime/shims/d3d12_com.cpp, it fails again withlayer same_root=0: 0/0 0/0 0/0, expected 6/10 7/11 1/1.xbox_presentfails, as on plainmain.gta6rt.exelinked withoutws2_32.libgivesmain's 26 unresolved Rust-std symbols, nothing new. Its imports are identical tomain's.Tested
3c108a339merged (no commit) withmainaa918e5d9. GPUs tested: NVIDIA GeForce RTX 3080, driver 621.40, Windows 11 10.0.26300, plus WARP.d3d12_bundle_indirect_dispatch(--bundle) andd3d12_indirect_dispatch_countpass. The layer, WARP and the default adapter give 6/10 7/11 1/1 in both cases. The count-buffer and root-constant bundles failClosewith0x80070057on both host adapters.ExecuteIndirectcut inruntime/shims/d3d12_com.cpp(if (false && type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE)),--bundlefails:layer same_root=0: 0/0 0/0 0/0, expected 6/10 7/11 1/1.check_no_game_data.pyis clean on the three files.Nit: the description still says 6/10 6/10 1/1. Since
b5447692fthe test expects 6/10 7/11 1/1.No blocker from my side. AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T01:07:45Z.
Review: COMMENTED
Static audit of
3c108a339against48bae6cad. The two bundle calls and the direct follow-up cover the parent root UAV and bundle PSO behavior.In
run_bundle, the upload ends after the third record, so an extra indirect dispatch can read a zero-group fourth record and leave the counters unchanged. Could you upload a fourth valid record such as(4, 1, 1)while still passingMaxCommandCount = 3? The expected counters can stay the same.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T11:45:40Z.
Linux GPU check and fourth-record control for the review above. With
f58143876merged on8fb974878, I rand3d12_bundle_indirect_dispatch,d3d12_indirect_dispatch_count, andd3d12_indirect_group_budgetunder Wine 11.22 on CachyOS. All three passed on the Radeon 610M (RADV Mesa 26.3.1) and on the RTX 4070 SUPER (NVIDIA 620.73.04). The bundle checks used the Vulkan layer and included bothsame_rootvariants and bothE_INVALIDARGcases. No game files.I tested the suggested fourth record in a local fixture-only copy. I initialized and copied four records and kept
MaxCommandCount=3. Both GPUs still read back6/10 7/11 1/1in both variants. In the same binary, changing onlyMaxCommandCountto 4 madesame_root=0fail on both GPUs with10/20 11/21 1/1. The fourth record makes an extra execution observable without changing the expected values.Khronos validation 1.4.363.1 was loaded by the Linux Vulkan loader. The one host-layer VUID across these runs was the same device-creation extension dependency (
01387,VK_EXT_external_memory_dma_buf) seen in the separate #2184 runs. AI-assisted with OpenAI Codex (GPT-6).