test(d3d12): cover DispatchMesh bundle replay (D3D-BUNDLE-DISPATCH-MESH) #841

Closed
Maticcm wants to merge 3 commits from upstream-pr/841 into main
Maticcm commented 2026-11-24 14:26:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-24T14:26:52Z.


Claim: D3D-BUNDLE-DISPATCH-MESH

Main picked up the DispatchMesh bundle implementation in 85f806b916. 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 e6585b5572 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5474049411 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-24T14:26:52Z. --- 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.
abnalstlll-byte commented 2026-11-24 14:40:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:40:10Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6041289427 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#pullrequestreview-6041289427). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T14:40:10Z. **Review:** APPROVED --- 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.
Copilot commented 2026-11-24 14:43:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Copilot on 2026-11-24T14:43:46Z.

Code review location: runtime/test/d3d12_mesh_test.cpp; line 568

@@ -504,6 +504,108 @@ int main() {
             std::printf("pipelineStatisticsQuery not available: the D3D-291 statistics check is skipped\n");
         }
 
+        // Bundle DispatchMesh: a bundle starts with its creation PSO (mesh_pso) rather than the parent's (vs_pso),
+        // inherits the parent's render targets, viewport, scissor and root arguments across multiple executions, and
+        // hands its PSO and root arguments back to the parent.
+        {
+            Ref<ID3D12CommandAllocator> bundle_alloc, state_bundle_alloc, bad_bundle_alloc;
+            Ref<ID3D12GraphicsCommandList> bundle, state_bundle, bad_bundle;
+            Ref<ID3D12GraphicsCommandList6> bundle6, bad_bundle6;
+            EXPECT(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE,
+                                                            IID_PPV_ARGS(&bundle_alloc.p))));
+            EXPECT(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, bundle_alloc.p, mesh_pso.p,
+                                                       IID_PPV_ARGS(&bundle.p))));
+            EXPECT(SUCCEEDED(bundle->QueryInterface(IID_PPV_ARGS(&bundle6.p))));
+            bundle6->DispatchMesh(2, 2, 1);
+            EXPECT(bundle->Close() == S_OK);
+
+            const float down_left[2] = {0, -1};
+            EXPECT(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE,
+                                                            IID_PPV_ARGS(&state_bundle_alloc.p))));
+            EXPECT(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, state_bundle_alloc.p,
+                                                       mesh_pso.p, IID_PPV_ARGS(&state_bundle.p))));
+            state_bundle->SetGraphicsRootSignature(root.p);
+            state_bundle->SetGraphicsRoot32BitConstants(0, 2, down_left, 0);
+            state_bundle->SetGraphicsRootConstantBufferView(1, upload_va + 512);
+            EXPECT(state_bundle->Close() == S_OK);
+
+            EXPECT(SUCCEEDED(allocator->Reset()) && SUCCEEDED(list->Reset(allocator.p, vs_pso.p)));
+            if (!d.pipeline_statistics_query) {
+                D3D12_RESOURCE_BARRIER back_to_target =
+                    transition(target.p, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+                list->ResourceBarrier(1, &back_to_target);
+            }
+            list->ClearRenderTargetView(rtv, blue, 0, nullptr);
+            list->SetGraphicsRootSignature(root.p);
+            list->RSSetViewports(1, &viewport);
+            list->RSSetScissorRects(1, &scissor);
+            list->OMSetRenderTargets(1, &rtv, FALSE, nullptr);
+
+            list->SetGraphicsRoot32BitConstants(0, 2, origin, 0);
+            list->SetGraphicsRootConstantBufferView(1, upload_va);
+            list->ExecuteBundle(bundle.p);
+
+            list->SetGraphicsRoot32BitConstants(0, 2, down_right, 0);
+            list->SetGraphicsRootConstantBufferView(1, upload_va + 256);
+            list->ExecuteBundle(bundle.p);
+
+            list->ExecuteBundle(state_bundle.p);
+            list6->DispatchMesh(2, 2, 1);
+
+            list->ResourceBarrier(1, &to_copy);
+            list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
+            EXPECT(list->Close() == S_OK);
+            queue->ExecuteCommandLists(1, lists);
+            EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success);
+            const UINT64 bundle_fence = d.pipeline_statistics_query ? 4 : 3;
+            EXPECT(SUCCEEDED(queue->Signal(fence.p, bundle_fence)) &&
+                   SUCCEEDED(fence->SetEventOnCompletion(bundle_fence, nullptr)));
+
+            std::array<std::uint8_t, size * 256> bundle_pixels{};
+            void* bundle_mapped = nullptr;
+            EXPECT(SUCCEEDED(readback->Map(0, nullptr, &bundle_mapped)));
+            std::memcpy(bundle_pixels.data(), bundle_mapped, bundle_pixels.size());
+            readback->Unmap(0, nullptr);

This maps/reads back the readback resource without waiting for GPU completion. Also, ID3D12Fence::SetEventOnCompletion requires a valid event HANDLE; passing nullptr typically returns E_INVALIDARG and cannot be waited on. Use a real event + WaitForSingleObject, or an existing helper in this test file that waits for fence->GetCompletedValue() >= bundle_fence, before mapping/copying readback.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4681694190 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694190). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T14:43:46Z. **Code review location:** `runtime/test/d3d12_mesh_test.cpp`; line 568 ~~~~diff @@ -504,6 +504,108 @@ int main() { std::printf("pipelineStatisticsQuery not available: the D3D-291 statistics check is skipped\n"); } + // Bundle DispatchMesh: a bundle starts with its creation PSO (mesh_pso) rather than the parent's (vs_pso), + // inherits the parent's render targets, viewport, scissor and root arguments across multiple executions, and + // hands its PSO and root arguments back to the parent. + { + Ref<ID3D12CommandAllocator> bundle_alloc, state_bundle_alloc, bad_bundle_alloc; + Ref<ID3D12GraphicsCommandList> bundle, state_bundle, bad_bundle; + Ref<ID3D12GraphicsCommandList6> bundle6, bad_bundle6; + EXPECT(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, + IID_PPV_ARGS(&bundle_alloc.p)))); + EXPECT(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, bundle_alloc.p, mesh_pso.p, + IID_PPV_ARGS(&bundle.p)))); + EXPECT(SUCCEEDED(bundle->QueryInterface(IID_PPV_ARGS(&bundle6.p)))); + bundle6->DispatchMesh(2, 2, 1); + EXPECT(bundle->Close() == S_OK); + + const float down_left[2] = {0, -1}; + EXPECT(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, + IID_PPV_ARGS(&state_bundle_alloc.p)))); + EXPECT(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, state_bundle_alloc.p, + mesh_pso.p, IID_PPV_ARGS(&state_bundle.p)))); + state_bundle->SetGraphicsRootSignature(root.p); + state_bundle->SetGraphicsRoot32BitConstants(0, 2, down_left, 0); + state_bundle->SetGraphicsRootConstantBufferView(1, upload_va + 512); + EXPECT(state_bundle->Close() == S_OK); + + EXPECT(SUCCEEDED(allocator->Reset()) && SUCCEEDED(list->Reset(allocator.p, vs_pso.p))); + if (!d.pipeline_statistics_query) { + D3D12_RESOURCE_BARRIER back_to_target = + transition(target.p, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); + list->ResourceBarrier(1, &back_to_target); + } + list->ClearRenderTargetView(rtv, blue, 0, nullptr); + list->SetGraphicsRootSignature(root.p); + list->RSSetViewports(1, &viewport); + list->RSSetScissorRects(1, &scissor); + list->OMSetRenderTargets(1, &rtv, FALSE, nullptr); + + list->SetGraphicsRoot32BitConstants(0, 2, origin, 0); + list->SetGraphicsRootConstantBufferView(1, upload_va); + list->ExecuteBundle(bundle.p); + + list->SetGraphicsRoot32BitConstants(0, 2, down_right, 0); + list->SetGraphicsRootConstantBufferView(1, upload_va + 256); + list->ExecuteBundle(bundle.p); + + list->ExecuteBundle(state_bundle.p); + list6->DispatchMesh(2, 2, 1); + + list->ResourceBarrier(1, &to_copy); + list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr); + EXPECT(list->Close() == S_OK); + queue->ExecuteCommandLists(1, lists); + EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success); + const UINT64 bundle_fence = d.pipeline_statistics_query ? 4 : 3; + EXPECT(SUCCEEDED(queue->Signal(fence.p, bundle_fence)) && + SUCCEEDED(fence->SetEventOnCompletion(bundle_fence, nullptr))); + + std::array<std::uint8_t, size * 256> bundle_pixels{}; + void* bundle_mapped = nullptr; + EXPECT(SUCCEEDED(readback->Map(0, nullptr, &bundle_mapped))); + std::memcpy(bundle_pixels.data(), bundle_mapped, bundle_pixels.size()); + readback->Unmap(0, nullptr); ~~~~ --- This maps/reads back the readback resource without waiting for GPU completion. Also, `ID3D12Fence::SetEventOnCompletion` requires a valid event `HANDLE`; passing `nullptr` typically returns `E_INVALIDARG` and cannot be waited on. Use a real event + `WaitForSingleObject`, or an existing helper in this test file that waits for `fence->GetCompletedValue() >= bundle_fence`, before mapping/copying `readback`.
Copilot commented 2026-11-24 14:43:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Copilot on 2026-11-24T14:43:46Z.

Code review location: runtime/shims/d3d12_com.cpp; line 1424

@@ -1420,6 +1416,16 @@ class GraphicsCommandList final
                            first, base_vertex, first_instance};
         check(list_.draw(std::move(draw)));
     }
+
+    void record_dispatch_mesh(UINT x, UINT y, UINT z) {
+        if (!graphics_pipeline_ || !graphics_.layout) return check(false);
+        note_direct_heap_indexing(graphics_.layout);
+        if (!(viewport_.width > 0) || !(viewport_.height > 0)) return;  // as record_draw: nothing is rasterized
+        leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_,

note_direct_heap_indexing(graphics_.layout) runs even when the viewport is empty and the draw is skipped. The comment says this matches record_draw behavior, but the ordering here can record direct-heap indexing even when nothing is rasterized. Move the empty-viewport early-return before note_direct_heap_indexing(...) (or confirm record_draw does the same ordering) to avoid side effects when the command becomes a no-op.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4681694324 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694324). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T14:43:46Z. **Code review location:** `runtime/shims/d3d12_com.cpp`; line 1424 ~~~~diff @@ -1420,6 +1416,16 @@ class GraphicsCommandList final first, base_vertex, first_instance}; check(list_.draw(std::move(draw))); } + + void record_dispatch_mesh(UINT x, UINT y, UINT z) { + if (!graphics_pipeline_ || !graphics_.layout) return check(false); + note_direct_heap_indexing(graphics_.layout); + if (!(viewport_.width > 0) || !(viewport_.height > 0)) return; // as record_draw: nothing is rasterized + leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_, ~~~~ --- `note_direct_heap_indexing(graphics_.layout)` runs even when the viewport is empty and the draw is skipped. The comment says this matches `record_draw` behavior, but the ordering here can record direct-heap indexing even when nothing is rasterized. Move the empty-viewport early-return before `note_direct_heap_indexing(...)` (or confirm `record_draw` does the same ordering) to avoid side effects when the command becomes a no-op.
copilot-pull-request-reviewer[bot] commented 2026-11-24 14:43:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T14:43:47Z.

Review: COMMENTED


Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
What changed in this PR

Defers ID3D12GraphicsCommandList6::DispatchMesh through the bundle replay path so bundles correctly inherit parent state at ExecuteBundle, and adds regression tests + documentation for the behavior.

Changes:

  • Route DispatchMesh recording through defer() and add record_dispatch_mesh() to replay with inherited parent state.
  • Add GPU + negative bundle coverage for deferred DispatchMesh behavior.
  • Document that DispatchMesh is deferred like draws/dispatches for bundle replay.
File Description
runtime/​shims/​d3d12_com.cpp Defers DispatchMesh via defer() and adds record_dispatch_mesh() for replay-time state snapshotting.
runtime/​test/​d3d12_mesh_test.cpp Adds bundle execution + negative tests validating deferred DispatchMesh semantics and error cases.
docs/​d3d12_vulkan.md Updates bundle behavior documentation to include deferred DispatchMesh.

Review effort: Lite

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6041361623 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#pullrequestreview-6041361623). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T14:43:47Z. **Review:** COMMENTED --- > [!WARNING] > Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a `copilot-code-review.yml` file specifying one with the `runs-on` attribute. See the [docs](https://gh.io/AA11tgch) for more details. <!-- ccr-overview-v2 --> ## Copilot review overview <details open> <summary><strong>3 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [This maps/reads back the readback resource without waiting for GPU completion. Also,…](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694190) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> [`note_direct_heap_indexing(graphics_.layout)` runs even when the viewport is empty and the draw is…](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694324) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [The lambda uses `[=]` even though only `x`, `y`, and `z` are needed. Prefer explicitly capturing…](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694402) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> Defers `ID3D12GraphicsCommandList6::DispatchMesh` through the bundle replay path so bundles correctly inherit parent state at `ExecuteBundle`, and adds regression tests + documentation for the behavior. **Changes:** - Route `DispatchMesh` recording through `defer()` and add `record_dispatch_mesh()` to replay with inherited parent state. - Add GPU + negative bundle coverage for deferred `DispatchMesh` behavior. - Document that `DispatchMesh` is deferred like draws/dispatches for bundle replay. | File | Description | | ---- | ----------- | | runtime/​shims/​d3d12_com.cpp | Defers `DispatchMesh` via `defer()` and adds `record_dispatch_mesh()` for replay-time state snapshotting. | | runtime/​test/​d3d12_mesh_test.cpp | Adds bundle execution + negative tests validating deferred `DispatchMesh` semantics and error cases. | | docs/​d3d12_vulkan.md | Updates bundle behavior documentation to include deferred `DispatchMesh`. | </details> <sub>Review effort: Lite</sub>
Copilot commented 2026-11-24 14:43:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Copilot on 2026-11-24T14:43:47Z.

Code review location: runtime/shims/d3d12_com.cpp; line 488

@@ -485,12 +485,8 @@ class GraphicsCommandList final
     void STDMETHODCALLTYPE DispatchMesh(UINT x, UINT y, UINT z) override {
         d3d12_trace::record("ID3D12GraphicsCommandList6::DispatchMesh");
         if (x > 65535 || y > 65535 || z > 65535 || std::uint64_t(x) * y * z > (1u << 22)) return check(false);
-        if (!graphics_pipeline_ || !graphics_.layout) return check(false);
-        if (!(viewport_.width > 0) || !(viewport_.height > 0)) return;  // as record_draw: nothing is rasterized
-        leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_,
-                           scissor_, blend_factor_, front_stencil_ref_, back_stencil_ref_, false, x, y, z, 0, 0};
-        draw.mesh = true;
-        check(list_.draw(std::move(draw)));
+        if (defer([=](GraphicsCommandList& l) { l.record_dispatch_mesh(x, y, z); }, true)) return;

The lambda uses [=] even though only x, y, and z are needed. Prefer explicitly capturing [x, y, z] to avoid unintentionally capturing other state (and to avoid the deprecated implicit capture of this concerns in newer C++ standards, even if not used here).

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4681694402 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#discussion_r4681694402). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-24T14:43:47Z. **Code review location:** `runtime/shims/d3d12_com.cpp`; line 488 ~~~~diff @@ -485,12 +485,8 @@ class GraphicsCommandList final void STDMETHODCALLTYPE DispatchMesh(UINT x, UINT y, UINT z) override { d3d12_trace::record("ID3D12GraphicsCommandList6::DispatchMesh"); if (x > 65535 || y > 65535 || z > 65535 || std::uint64_t(x) * y * z > (1u << 22)) return check(false); - if (!graphics_pipeline_ || !graphics_.layout) return check(false); - if (!(viewport_.width > 0) || !(viewport_.height > 0)) return; // as record_draw: nothing is rasterized - leonida::Draw draw{graphics_pipeline_, graphics_.data, draw_views(), depth_, {}, 0, viewport_, - scissor_, blend_factor_, front_stencil_ref_, back_stencil_ref_, false, x, y, z, 0, 0}; - draw.mesh = true; - check(list_.draw(std::move(draw))); + if (defer([=](GraphicsCommandList& l) { l.record_dispatch_mesh(x, y, z); }, true)) return; ~~~~ --- The lambda uses `[=]` even though only `x`, `y`, and `z` are needed. Prefer explicitly capturing `[x, y, z]` to avoid unintentionally capturing other state (and to avoid the deprecated implicit capture of `this` concerns in newer C++ standards, even if not used here).
Maticcm commented 2026-11-24 15:15:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-24T15:15:07Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7135709900 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#issuecomment-7135709900). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-24T15:15:07Z. --- 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.
Sangonapou commented 2026-11-24 16:03:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Sangonapou on 2026-11-24T16:03:39Z.


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-mc 23.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 matched all 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 printed C 12/12 and mesh only: C 8/8 on the heads of #424 and #815 (older bases). I have not checked whether the second clipper count changed on main or in this branch; mentioning it in case it is the bundle path.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7137054295 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#issuecomment-7137054295). Originally posted by [Sangonapou](https://github.com/Sangonapou) on 2026-11-24T16:03:39Z. --- 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-mc` 23.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 matched` all 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 printed `C 12/12` and `mesh only: C 8/8` on the heads of #424 and #815 (older bases). I have not checked whether the second clipper count changed on `main` or in this branch; mentioning it in case it is the bundle path.
Timon360SB commented 2026-11-24 17:48:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Timon360SB on 2026-11-24T17:48:18Z.


Independent testing results

Verified deferred DispatchMesh execution in bundles on NVIDIA Blackwell hardware under native Windows, with Vulkan validation enabled.

Tested revisions

  • BASE: a28927849adb4e40dfdec8c32fb6758dcd205a37
  • HEAD: a74ab14076c803ecf7e9c34f6d2e1158e6d2d194

Test environment

Component Configuration
CPU AMD Ryzen 7 7800X3D
GPU NVIDIA GeForce RTX 5070 (Blackwell)
VRAM 12227 MiB
RAM 31.11 GiB
GPU driver 621.14
OS Windows 11 Pro, build 26200
Vulkan SDK 1.4.363.0
MSVC 19.44.35230
Windows SDK 10.0.26100.0

Test configuration

  • Build configuration: RelWithDebInfo.
  • Build generator: Ninja Multi-Config.
  • Build scope: selected targets.
  • Vulkan core, GPU-assisted and synchronization validation enabled.
  • Three repetitions per revision.
  • Synthetic fixtures only.

Both revisions compiled successfully.

CTest results

Test BASE HEAD
d3d12_mesh 3/3 3/3
d3d12_bundle 3/3 3/3
d3d12_bundle_forbidden 3/3 3/3
d3d12_close_parity 3/3 3/3
vk_sync_validation 3/3 3/3
Total 15/15 15/15

Combined: 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 DispatchMesh behavior.

The relevant HEAD diagnostic was:

DispatchMesh over X, Y and Z, deferred bundle DispatchMesh and a stream VS draw matched all 4096 pixels
Verification HEAD result
DispatchMesh over X, Y and Z PASS
Deferred bundle DispatchMesh PASS
Pipeline stream VS draw PASS
Pixel comparison 4096/4096 matched
Oversized dispatch grids Rejected at Close
Invalid bundle replays Rejected at Close
Wrong-kind draws Rejected at execution
Mesh statistics queries Resolved successfully

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:

  • 10 calls checked on the layer.
  • 10 compared with the host.
  • 0 host disagreements.
  • 0 failures.

The close-parity test also remained unchanged:

Property BASE HEAD
Cases 113 113
Match WARP 82 82
Known layer-stricter cases 16 16
Known layer-looser cases 15 15
Not run 0 0
Failures 0 0

Vulkan validation

The synchronization self-test produced the expected intentional WRITE_AFTER_WRITE hazard without a barrier and zero validation errors with a barrier.

Limitations

  • Tested on one NVIDIA Blackwell GPU.
  • No second hardware configuration was available for this run.
  • Testing was limited to the five selected CTest tests and synthetic fixtures.
  • No real-title execution was performed.

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7139728830 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/841#issuecomment-7139728830). Originally posted by [Timon360SB](https://github.com/Timon360SB) on 2026-11-24T17:48:18Z. --- ## Independent testing results Verified deferred `DispatchMesh` execution in bundles on NVIDIA Blackwell hardware under native Windows, with Vulkan validation enabled. ### Tested revisions - BASE: `a28927849adb4e40dfdec8c32fb6758dcd205a37` - HEAD: `a74ab14076c803ecf7e9c34f6d2e1158e6d2d194` ### Test environment | Component | Configuration | | --- | --- | | CPU | AMD Ryzen 7 7800X3D | | GPU | NVIDIA GeForce RTX 5070 (Blackwell) | | VRAM | 12227 MiB | | RAM | 31.11 GiB | | GPU driver | 621.14 | | OS | Windows 11 Pro, build 26200 | | Vulkan SDK | 1.4.363.0 | | MSVC | 19.44.35230 | | Windows SDK | 10.0.26100.0 | ### Test configuration - Build configuration: RelWithDebInfo. - Build generator: Ninja Multi-Config. - Build scope: selected targets. - Vulkan core, GPU-assisted and synchronization validation enabled. - Three repetitions per revision. - Synthetic fixtures only. Both revisions compiled successfully. ### CTest results | Test | BASE | HEAD | | --- | ---: | ---: | | `d3d12_mesh` | 3/3 | 3/3 | | `d3d12_bundle` | 3/3 | 3/3 | | `d3d12_bundle_forbidden` | 3/3 | 3/3 | | `d3d12_close_parity` | 3/3 | 3/3 | | `vk_sync_validation` | 3/3 | 3/3 | | **Total** | **15/15** | **15/15** | Combined: **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 `DispatchMesh` behavior. The relevant HEAD diagnostic was: ```text DispatchMesh over X, Y and Z, deferred bundle DispatchMesh and a stream VS draw matched all 4096 pixels ``` | Verification | HEAD result | | --- | --- | | DispatchMesh over X, Y and Z | PASS | | Deferred bundle DispatchMesh | PASS | | Pipeline stream VS draw | PASS | | Pixel comparison | 4096/4096 matched | | Oversized dispatch grids | Rejected at Close | | Invalid bundle replays | Rejected at Close | | Wrong-kind draws | Rejected at execution | | Mesh statistics queries | Resolved successfully | 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: - 10 calls checked on the layer. - 10 compared with the host. - 0 host disagreements. - 0 failures. The close-parity test also remained unchanged: | Property | BASE | HEAD | | --- | ---: | ---: | | Cases | 113 | 113 | | Match WARP | 82 | 82 | | Known layer-stricter cases | 16 | 16 | | Known layer-looser cases | 15 | 15 | | Not run | 0 | 0 | | Failures | 0 | 0 | ### Vulkan validation The synchronization self-test produced the expected intentional `WRITE_AFTER_WRITE` hazard without a barrier and zero validation errors with a barrier. ### Limitations - Tested on one NVIDIA Blackwell GPU. - No second hardware configuration was available for this run. - Testing was limited to the five selected CTest tests and synthetic fixtures. - No real-title execution was performed. ### 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.
MoonEyes commented 2026-11-27 23:20:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T23:20:19Z.


Hi @Maticcm, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/d3d12_com.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7230062706 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7230062706). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T23:20:19Z. --- Hi @Maticcm, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/d3d12_com.cpp`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; 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).
Maticcm commented 2026-11-28 20:23:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-28T20:23:01Z.


Rebased onto da4fd4ea0bb687be9ffda5db7d2bebbe4e461a39 and retested candidate c89e101688df10b6111e4ab2516398505c3b2ec6. 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.

  • Full C++ runtime builds completed on both revisions. The candidate fixture on baseline production code failed at bundle Close(). On the candidate, the new bundle draw matched all 4,096 pixels.
  • Focused CTest on both revisions: 8 passed with one validation-only skip in default mode, and 9 passed with Vulkan validation enabled. The clipping statistics were unchanged across the two revisions on this GPU, including mixed 12/2 and mesh-only 8/0.
  • Full Windows CTest on each revision: 515 listed, 500 passed, 2 failed, 11 skipped, 2 disabled. The same depth-resolve fence-completion and PresentX resize failures occurred on baseline and candidate. The disabled tests require SDL3, and package-dependent tests used their normal skips.
  • The ms_ subset of run_gpu_tests.py matched 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245245595 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7245245595). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-28T20:23:01Z. --- Rebased onto `da4fd4ea0bb687be9ffda5db7d2bebbe4e461a39` and retested candidate `c89e101688df10b6111e4ab2516398505c3b2ec6`. 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. - Full C++ runtime builds completed on both revisions. The candidate fixture on baseline production code failed at bundle `Close()`. On the candidate, the new bundle draw matched all 4,096 pixels. - Focused CTest on both revisions: 8 passed with one validation-only skip in default mode, and 9 passed with Vulkan validation enabled. The clipping statistics were unchanged across the two revisions on this GPU, including mixed 12/2 and mesh-only 8/0. - Full Windows CTest on each revision: 515 listed, 500 passed, 2 failed, 11 skipped, 2 disabled. The same depth-resolve fence-completion and PresentX resize failures occurred on baseline and candidate. The disabled tests require SDL3, and package-dependent tests used their normal skips. - The `ms_` subset of `run_gpu_tests.py` matched 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).
Maticcm commented 2026-11-28 20:33:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-28T20:33:23Z.


I compared the failing CI logs on c89e10168 against upstream runs.

  • The exact rebase base da4fd4ea0 has 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 CI
  • The nearby main run at 5cb45921e has the same Linux pipeline_workers assertions and the same MoltenVK failures, including vk_bindless_dimensions and the three GPU fixture mismatches. Main Runtime · PR Runtime

Windows CI was still running when I checked. AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7245372127 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7245372127). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-28T20:33:23Z. --- I compared the failing CI logs on `c89e10168` against upstream runs. - The exact rebase base `da4fd4ea0` has 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](https://github.com/ProjectLeonida/mandy/actions/runs/46182377763) · [PR CI](https://github.com/ProjectLeonida/mandy/actions/runs/46186096608) - The nearby `main` run at `5cb45921e` has the same Linux `pipeline_workers` assertions and the same MoltenVK failures, including `vk_bindless_dimensions` and the three GPU fixture mismatches. [Main Runtime](https://github.com/ProjectLeonida/mandy/actions/runs/46182726286) · [PR Runtime](https://github.com/ProjectLeonida/mandy/actions/runs/46186096621) Windows CI was still running when I checked. AI-assisted (Codex).
Maticcm commented 2026-11-28 22:04:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-28T22:04:24Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246476373 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7246476373). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-28T22:04:24Z. --- The [Windows Runtime job](https://github.com/ProjectLeonida/mandy/actions/runs/46186096621/job/141106214643) finished successfully on `c89e10168`. GitHub currently reports the rebased branch as mergeable. The [upstream failure comparison](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7245372127) covers the remaining red jobs. The rebased change is ready for another maintainer look.
Maticcm commented 2026-11-29 05:14:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-29T05:14:56Z.


Rebased onto ef329958483832297acb53e68be94b439e88a90e and retested PR head 19b598859d22eeddb5d99e4e5b4ef8fa278450c9. 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7251139914 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7251139914). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-29T05:14:56Z. --- Rebased onto `ef329958483832297acb53e68be94b439e88a90e` and retested PR head `19b598859d22eeddb5d99e4e5b4ef8fa278450c9`. 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.
enlight3d commented 2026-11-29 09:05:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T09:05:04Z.


RUN of #841 (red/green, GPU box, merged build)

Heads: PR head 19b598859d22, main 54b2a81e95c4. 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=ON
cmake --build runtime/build -j 8 --target d3d12_mesh_test d3d12_bundle_test gta6rt
ctest -R "^(d3d12_mesh|d3d12_mesh_heavy_cache)$" --output-on-failure -j1
Also run, as the neighbour that exercises bundles in the same file: ctest -R "^d3d12_bundle$" -j1

  • Red, behavioural (the PR's d3d12_com.cpp reverted to main's, the PR's test kept; it still compiles, so not a build failure): d3d12_mesh and d3d12_mesh_heavy_cache both fail at d3d12_mesh_test.cpp line 864, bundle->Close() == S_OK: on main a DispatchMesh recorded 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.
  • Green, merged: d3d12_mesh Passed, d3d12_mesh_heavy_cache Passed, d3d12_bundle Passed, none skipped (the RTX 3090 runs the mesh pipelines).
  • Link: no new imports vs main (dumpbin /imports of gta6rt.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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253525431 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7253525431). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T09:05:04Z. --- RUN of #841 (red/green, GPU box, merged build) Heads: PR head `19b598859d22`, main `54b2a81e95c4`. 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=ON` `cmake --build runtime/build -j 8 --target d3d12_mesh_test d3d12_bundle_test gta6rt` `ctest -R "^(d3d12_mesh|d3d12_mesh_heavy_cache)$" --output-on-failure -j1` Also run, as the neighbour that exercises bundles in the same file: `ctest -R "^d3d12_bundle$" -j1` - Red, behavioural (the PR's `d3d12_com.cpp` reverted to main's, the PR's test kept; it still compiles, so not a build failure): `d3d12_mesh` and `d3d12_mesh_heavy_cache` both fail at `d3d12_mesh_test.cpp` line 864, `bundle->Close() == S_OK`: on main a `DispatchMesh` recorded 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. - Green, merged: `d3d12_mesh` Passed, `d3d12_mesh_heavy_cache` Passed, `d3d12_bundle` Passed, none skipped (the RTX 3090 runs the mesh pipelines). - Link: no new imports vs main (`dumpbin /imports` of `gta6rt.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.
Maticcm commented 2026-11-29 14:51:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Maticcm on 2026-11-29T14:51:06Z.


Rebased on bd643e46e784daf6bf3a45d09f0ec20e669c4ddb. Head df8403726024cc07ed964972d808c1e8608d0f48 preserves 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257625616 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7257625616). Originally posted by [Maticcm](https://github.com/Maticcm) on 2026-11-29T14:51:06Z. --- Rebased on `bd643e46e784daf6bf3a45d09f0ec20e669c4ddb`. Head `df8403726024cc07ed964972d808c1e8608d0f48` preserves 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.
fiestorra commented 2026-11-30 09:56:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-30T09:56:44Z.


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-tree clean; the commits cherry-pick onto main 4014af7fe without a conflict. Three files: docs/d3d12_vulkan.md, runtime/shims/d3d12_com.cpp (the change) and runtime/test/d3d12_mesh_test.cpp.

2. With the branch, both tests pass:

ctest -R 'd3d12_mesh'
100% tests passed, 0 tests failed out of 2

3. The control - revert only the shim, keep the test:

git checkout origin/main -- runtime/shims/d3d12_com.cpp
cmake --build … --target d3d12_mesh_test
ctest -R 'd3d12_mesh' --output-on-failure
0% tests passed, 2 tests failed out of 2
[rt] d3d12: ExecuteCommandLists failed: draw kind does not match the pipeline (mesh or vertex); nothing …

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 ExecuteCommandLists rather 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 docs half of the change (documentation).

Why I am commenting: I verify open pull requests that replay onto current main by applying them in a scratch worktree, building the targets their tests name in ctest --show-only=json-v1, running them, and then reverting only the source change to see which tests stop passing.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7274898741 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7274898741). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-30T09:56:44Z. --- 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-tree` clean; the commits cherry-pick onto `main` `4014af7fe` without a conflict. Three files: `docs/d3d12_vulkan.md`, `runtime/shims/d3d12_com.cpp` (the change) and `runtime/test/d3d12_mesh_test.cpp`. **2. With the branch, both tests pass:** ``` ctest -R 'd3d12_mesh' 100% tests passed, 0 tests failed out of 2 ``` **3. The control - revert only the shim, keep the test:** ``` git checkout origin/main -- runtime/shims/d3d12_com.cpp cmake --build … --target d3d12_mesh_test ctest -R 'd3d12_mesh' --output-on-failure 0% tests passed, 2 tests failed out of 2 [rt] d3d12: ExecuteCommandLists failed: draw kind does not match the pipeline (mesh or vertex); nothing … ``` **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 `ExecuteCommandLists`** rather 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 `docs` half of the change (documentation). **Why I am commenting:** I verify open pull requests that replay onto current `main` by applying them in a scratch worktree, building the targets their tests name in `ctest --show-only=json-v1`, running them, and then reverting **only** the source change to see which tests stop passing. Written with an AI assistant.
aslan2142 commented 2026-12-01 16:32:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:32:11Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317768487 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/841#issuecomment-7317768487). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:32:11Z. --- 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!841
No description provided.