test(d3d12): cover DispatchMesh bundle replay (D3D-BUNDLE-DISPATCH-MESH) #841
Closed
leonida/mandy
Maticcm wants to merge 0 commits from
feat/d3d12-bundle-dispatch-mesh into main
pull from: feat/d3d12-bundle-dispatch-mesh
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!841
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/d3d12-bundle-dispatch-mesh"
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 closed
This pull request cannot be reopened because the branch was deleted.
Claim: D3D-BUNDLE-DISPATCH-MESH
Main picked up the DispatchMesh bundle implementation in 85f806b9168ca9696bcf12baf54c6d0846c883ec. This revision adds direct regression coverage and documents the behavior.
The synthetic mesh fixture executes the same bundle twice with different inherited root arguments. It resets the parent to a vertex PSO before a state-only bundle, then checks a direct mesh dispatch that depends on the bundle handing its PSO and root arguments back. It also checks that Close rejects an oversized grid, missing inherited root state and replay of an invalidated bundle.
Tested e6585b5572ae648d1d6d77071d8851966e798b98 on Windows 11 with RTX 3080, NVIDIA driver 630.20. All 10 focused mesh, bundle, indirect-bundle, close-parity and root-layout CTests passed in each of two runs, with and without Vulkan validation. Both mesh variants matched all 4,096 expected pixels in both runs. Changed-file game-data and whitespace checks passed. Synthetic fixtures only.
AI-assisted with OpenAI Codex (GPT-6.2 Sol), with a separate reviewer.
Audited and verified. Implements deferred DispatchMesh recording for D3D12 bundle command lists, validating dispatch grid dimensions (<= 65535) at record time and replaying calls onto the parent command list during ExecuteBundle. Includes comprehensive test additions in
untime/tests/d3d12_mesh_shader_test.cpp covering state inheritance, constant buffer offset updates across bundle executions, and negative error conditions. Approved.
Addressed @Copilot review comments (rebased onto current main):
1.
untime/shims/d3d12_com.cpp (DispatchMesh): replaced implicit [=] lambda capture with explicit [x, y, z].
2.
untime/shims/d3d12_com.cpp (
ecord_dispatch_mesh): confirmed
ecord_draw (L1408-1418) uses the exact same ordering (
ote_direct_heap_indexing before the empty-viewport early-return), so both paths behave identically.
3.
untime/test/d3d12_mesh_test.cpp: replaced the
ullptr event in the bundle fence wait with an explicit CreateEventW / WaitForSingleObject / CloseHandle wait before mapping
eadback.
Rebuilt d3d12_mesh_test and verified on NVIDIA GeForce RTX 3080 (LEONIDA_VK_VALIDATION=1, 0 validation errors). AI-assisted.
Tested a74ab140 on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32, mesh shaders), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300), native Windows: pass
Built at this head with
scripts\build_runtime.ps1(MSVC 19.51, VS Build Tools 2026, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0);llvm-mc23.1.6, SPIRV-Tools 2026.4. No game files.ctest -R ^d3d12_mesh$ -V: passed,D3D-29: mesh tier 1; ... DispatchMesh over X, Y and Z, deferred bundle DispatchMesh and a stream VS draw matchedall 4096 pixels on the native mesh stage.One observation, not a failure: the statistics line here reads
statistics, mixed: IA 6/2 VS 6 C 12/2 PS 3328 CS 0; mesh only: C 8/0 PS 1024; vertex only: C 2 PS 2048, while on this card the same test printedC 12/12andmesh only: C 8/8on the heads of #424 and #815 (older bases). I have not checked whether the second clipper count changed onmainor in this branch; mentioning it in case it is the bundle path.Independent testing results
Verified deferred
DispatchMeshexecution in bundles on NVIDIA Blackwell hardware under native Windows, with Vulkan validation enabled.Tested revisions
a28927849adb4e40dfdec8c32fb6758dcd205a37a74ab14076c803ecf7e9c34f6d2e1158e6d2d194Test environment
Test configuration
Both revisions compiled successfully.
CTest results
d3d12_meshd3d12_bundled3d12_bundle_forbiddend3d12_close_parityvk_sync_validationCombined: 30/30 PASS, with no failed or skipped CTest executions.
Deferred DispatchMesh
The mesh test reported mesh shader tier 1 support on the RTX 5070.
All three HEAD executions explicitly confirmed successful deferred bundle
DispatchMeshbehavior.The relevant HEAD diagnostic was:
The pipeline state stream checks also consistently reported nine invalid cases and two not-implemented cases being rejected.
Bundle regression coverage
The forbidden bundle calls test reported the same results on BASE and HEAD:
The close-parity test also remained unchanged:
Vulkan validation
The synchronization self-test produced the expected intentional
WRITE_AFTER_WRITEhazard without a barrier and zero validation errors with a barrier.Limitations
Conclusion
Result: PASS — no regressions detected within the tested scope.
The new deferred bundle DispatchMesh scenario successfully matched all 4096 pixels in every HEAD repetition. Invalid bundle replays were rejected as expected, and the existing bundle and close-parity regression tests remained successful.
AI-assisted log analysis and report preparation.
Hi @Maticcm, thanks for this pull request. It currently conflicts with
main(conflicting file(s):runtime/shims/d3d12_com.cpp), so it carries theneeds rebaselabel. CONTRIBUTING.md asks authors to rebase their branch onmain; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.AI-assisted (Claude Code, Claude Opus 5.5).
Rebased onto
da4fd4ea0bb687be9ffda5db7d2bebbe4e461a39and retested candidatec89e101688df10b6111e4ab2516398505c3b2ec6. The conflict resolution preserves the current mesh root-window checks, mesh stubs, viewport arrays, depth bounds and pipeline requests. It moves state-dependent recording to bundle replay while keeping the trace and dispatch-grid validation at record time.Close(). On the candidate, the new bundle draw matched all 4,096 pixels.ms_subset ofrun_gpu_tests.pymatched on both revisions: 5 passed and 3 skipped in default subgroup mode, 8 passed with wave64 emulation. Source smoke, CTest registration, diff and game-data checks passed. Synthetic fixtures only.GPUs tested: Profile M, NVIDIA GeForce RTX 3080 desktop (10 GiB), driver 630.20, Windows 11 build 26340, MSVC 19.50.35717, Vulkan SDK 1.4.363.1. AI-assisted (Codex).
I compared the failing CI logs on
c89e10168against upstream runs.da4fd4ea0has the same Python test failures: both f16-to-int16 modifier assertions, the macOS case/accents path test, and the Linux fallback stack-reserve assertion. Base CI · PR CImainrun at5cb45921ehas the same Linuxpipeline_workersassertions and the same MoltenVK failures, includingvk_bindless_dimensionsand the three GPU fixture mismatches. Main Runtime · PR RuntimeWindows CI was still running when I checked. AI-assisted (Codex).
The Windows Runtime job finished successfully on
c89e10168. GitHub currently reports the rebased branch as mergeable. The upstream failure comparison covers the remaining red jobs. The rebased change is ready for another maintainer look.Rebased onto
ef329958483832297acb53e68be94b439e88a90eand retested PR head19b598859d22eeddb5d99e4e5b4ef8fa278450c9. The resolution uses main's shared mesh root-window check in the deferred recorder. The dispatch grid check still runs when the call is recorded.On Windows 11 with RTX 3080 (NVIDIA 630.20), all 10 focused mesh, bundle, indirect-bundle, root-layout and close-parity CTests passed both with and without Vulkan validation. The mesh and heavy-cache variants matched all 4,096 pixels, including the deferred bundle draw. No validation errors were reported. Changed-file game-data and whitespace checks passed. Synthetic fixtures only. AI-assisted with OpenAI Codex.
RUN of #841 (red/green, GPU box, merged build)
Heads: PR head
19b598859d22, main54b2a81e95c4. Tested as main + PR head (git merge --no-ff, local only): merged cleanly, no conflicts.Commands (VS 2022 x64 environment, from the worktree root):
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ONcmake --build runtime/build -j 8 --target d3d12_mesh_test d3d12_bundle_test gta6rtctest -R "^(d3d12_mesh|d3d12_mesh_heavy_cache)$" --output-on-failure -j1Also run, as the neighbour that exercises bundles in the same file:
ctest -R "^d3d12_bundle$" -j1d3d12_com.cppreverted to main's, the PR's test kept; it still compiles, so not a build failure):d3d12_meshandd3d12_mesh_heavy_cacheboth fail atd3d12_mesh_test.cppline 864,bundle->Close() == S_OK: on main aDispatchMeshrecorded in a bundle is not deferred, is checked against the (not yet inherited) graphics state at record time and makes the bundle's Close return E_INVALIDARG. The earlier checks of that test (the direct-list and ExecuteIndirect mesh cases) pass on main, so the failure is the bundle case.d3d12_meshPassed,d3d12_mesh_heavy_cachePassed,d3d12_bundlePassed, none skipped (the RTX 3090 runs the mesh pipelines).dumpbin /importsofgta6rt.exe, DLL!symbol, sorted: 700 entries on main and on main + PR, identical).Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 Pro 10.0.26300, MSVC 19.44 (VS 2022 Build Tools), CMake + Ninja, RelWithDebInfo,
-DLEONIDA_REQUIRE_VULKAN=ON, Vulkan SDK 1.4.363.1.Rebased on
bd643e46e784daf6bf3a45d09f0ec20e669c4ddb. Headdf8403726024cc07ed964972d808c1e8608d0f48preserves main’s ExecuteIndirect documentation and adds the direct DispatchMesh coverage. GitHub reports the branch as mergeable.RTX 3080 on Windows 11 passed 10/10 focused tests both with and without Vulkan validation. The normal and heavy-cache mesh variants each matched all 4,096 pixels. No validation errors were reported. Changed-file game-data and whitespace checks passed. Synthetic fixtures only. AI-assisted with OpenAI Codex.
Independent verification on this machine (Windows 11, RTX 4090, MSVC 19.44.35226), with a negative control that bites on both tests.
1. It applies.
merge-treeclean; the commits cherry-pick ontomain4014af7fewithout a conflict. Three files:docs/d3d12_vulkan.md,runtime/shims/d3d12_com.cpp(the change) andruntime/test/d3d12_mesh_test.cpp.2. With the branch, both tests pass:
3. The control - revert only the shim, keep the test:
Both bite, and the run-time line names the rule the change adds: a draw whose kind does not match the bound pipeline (mesh or vertex) must be refused at
ExecuteCommandListsrather than reaching the device.main's shim lets it through, and the test then fails on the pixels or the state that result from it.What I did not test: whether the shim refuses every mismatched combination the pipeline state allows, and the
docshalf of the change (documentation).Why I am commenting: I verify open pull requests that replay onto current
mainby applying them in a scratch worktree, building the targets their tests name inctest --show-only=json-v1, running them, and then reverting only the source change to see which tests stop passing.Written with an AI assistant.
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (
d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools,d3d12/, or general docs), please feel free to reopen it.