Repository navigation
Runtime: milestone M5 synthetic gate (without mesh) — ExecuteIndirect draws render now, multi-threaded lists, 5,120-SRV bindless table, pipeline cache - #1865
Conversation
…ad recording, 5120-SRV table, pipeline cache) Test d3d12_m5_world_test (D3D12 API only, translator-output shaders, every pixel against a CPU reference): (a) five ExecuteIndirect calls (DRAW and DRAW_INDEXED signatures, CPU- and GPU-written records at offsets in placed buffers, count buffer, count 0, count above MaxCommandCount), (b) four threads recording four lists run in one ExecuteCommandLists, eight rounds, (c) a descriptor table of 5120 SRVs of distinct textures read at a byte offset from a root constant, (d) a PSO created twice through the device's VkPipelineCache. Layer gaps fixed on the way: - ExecuteIndirect draws carry the list's graphics state and replay as whole draws; they used to replay as a bare vkCmdDraw*Indirect outside any render pass with no pipeline bound. - multiDrawIndirect, drawIndirectCount and drawIndirectFirstInstance are enabled on the layer's device where present (VulkanDeviceInfo::multi_draw_indirect / draw_indirect_count); without multiDrawIndirect each record is its own call. - One VkPipelineCache per device for every graphics and compute pipeline (was VK_NULL_HANDLE), with VkPipelineCreationFeedback hit counting (rt::d3d12::pipeline_cache_stats). Section 6 M5 row: synthetic part met except mesh shaders (D3D-29). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent native Windows verification of
Each GPU passed the unmodified fixture with exact CPU-reference pixels, zero skips, and zero Khronos validation errors with synchronization validation enabled. The runs were serial, each with one process-local ICD and implicit layers disabled. Both GPUs exposed the required indirect and bindless features. Coverage included all five stock indirect calls (including the initialized zero-count case and the count clamped by One source-review note for future runs on other adapters. The fixture says “the layer's fallbacks are what runs” when Live AI-assisted verification (Codex). |
…ature flags, test leniency - A draw-kind ExecuteIndirect with no graphics state is unsupported at prepare unless it is marked raw (ExecuteIndirect::raw, set by the unit tests that wrap the call in rendering themselves). - Calls take at most VkPhysicalDeviceLimits::maxDrawIndirectCount records (ReplayFunctions, VulkanDeviceInfo). - VulkanDeviceInfo::draw_indirect_first_instance is recorded; the layer logs once when it is absent. - VulkanDeviceInfo::draw_indirect_count defaults to false. - d3d12_m5_world_test: without drawIndirectCount the count-buffer calls are left out; pipeline-cache checks only run when the driver returns valid creation feedback, and size equality only when both sizes are known. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # runtime/src/vulkan_replay.h
evilclanker9000
left a comment
There was a problem hiding this comment.
The new fixed-count chunk loops in detail::emit_indirect can wrap their 32-bit cursor after a short final chunk. I ran a CPU callback probe on Windows with MSVC 19.44 at 77d86d0c. With a synthetic max_count = UINT32_MAX and maxDrawIndirectCount = 0x80000000, both DRAW kinds emitted counts 0x80000000, then 0x7fffffff, then started over at argument offset zero. The probe stopped on the third call. No backing GPU buffer or GPU run was needed.
Advancing by the actual emitted count, min(per_call, max_count - k), in both loops made the same probe emit exactly two calls. Can the chunking test cover a clipped final chunk with this mock so it catches wraparound without iterating billions of records?
AI-assisted.
The fixed-count loops added a full chunk to a 32-bit cursor, so a short final chunk could wrap it and restart at argument offset 0 (MaxCommandCount UINT32_MAX with maxDrawIndirectCount 0x80000000). Found by @Vonsek in review of ItsNotRexed#1865. d3d12_state_map now checks the calls (counts and offsets, not records) for both draw kinds with a huge count and for a limit that does not divide the count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent native Windows retest of
Both serial runs used one process-local ICD and an empty implicit-layer path. Only Khronos validation loaded, with synchronization validation enabled by the fixture. Zero skips, zero validation errors, and every pixel matched the CPU reference. Both devices exposed New fixture issue found by source review: The raw draw opt-in was reviewed in source. The ordinary M5 draws carry graphics state. I also checked Vonsek’s cursor-wrap finding against the source and did not run that probe. Live AI-assisted verification (Codex). |
|
Thanks @Vonsek, good catch. Fixed in
The same push has the other review fixes:
The branch is merged up to AI-assisted (Claude Code). |
|
Thanks. I rebuilt the CPU-only One test hardening detail: the new mock appends to a vector until AI-assisted. |
…wing without bound A cursor that wraps again now ends the loop with a failed check rather than appending until memory runs out. Checked by lowering the cap to 1: the check fails at the call. Suggested by @Vonsek in ItsNotRexed#1865. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Good point, @Vonsek. As of AI-assisted (Claude Code). |
|
Independent native Windows retest after the rebase, AI-assisted. Stock M5 at Current head |
|
I verified the bounded callback on AI-assisted. |
# Conflicts: # docs/d3d12_vulkan.md # runtime/CMakeLists.txt # runtime/src/command_list.h # runtime/src/vulkan_replay.h # scripts/run_gpu_tests.py
|
Merged up after #1791 (M4) and #1858 landed ( AI-assisted (Claude Code). |
|
rebased this onto current main for you, since it conflicts after #1791 (M4) merged ^^ branch: conflicts, all "both sides added something":
tested on the rebase, Windows 10 22H2, NVIDIA RTX 6000 Ada (582.70), MSVC 2022, llvm-mc 23.1.5, SPIRV-Tools built from main:
TL;DR: rebased onto main after M4 landed, M4 and M5 both pass on a third GPU (Win10 + RTX 6000 Ada), and the whole suite is green. branch is ready to pull. AI-assisted (Claude Code). |
|
Independent Windows integration check at
M4 used the stock copy → compute → readback order, with producer signals queued before the dependent waits. All four serial CTest runs passed with zero skips and zero validation errors, one ICD per process, an empty implicit-layer path, and only Khronos validation with synchronization validation enabled. Both targets registered skip code 77. Built with MSVC x64 / Ninja, Windows SDK 10.0.26100.0, uv Python 3.12.13, and WSL LLVM 21.1.8 AMDGPU. All eight modules passed a separate The previously reported count-guard shadow is still present at this head (MSVC C4456). Both adapters exposed native indirect count, multi-draw, and indirect first instance. The runs cover the supported stock paths, with no hardware-limit split. AI-assisted verification (Codex). |
|
Thanks @IAmNotSiob, nice of you. Our resolutions crossed: I had already merged AI-assisted (Claude Code). |
# Conflicts: # runtime/CMakeLists.txt # runtime/src/vulkan_backend.h # scripts/run_gpu_tests.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note for when you rebase (no action needed from me): this PR conflicts with
Built on top of that: AI-assisted (Claude Code). |
# Conflicts: # docs/d3d12_vulkan.md # runtime/src/vulkan_replay.h
|
I've merged main at Main now keeps a draw's prepared state in
The raw flag, chunking and dispatch-kind capture are unchanged. Full ctest with
AI-assisted (Claude Code). |
|
Tested 9a74588 on RTX 5090, 621.24, Windows 11: pass. Built the runtime from this tree and ran M5 is the gate that matters for the world path, so this is the one I would most like to see green on more GPUs than mine: it is one command and 1.4 s on this box. |
|
Tested |
|
Independent GPU confirmation of the graphics The test program is our own synthetic guest. It has no game data: hand-written RDNA2 shaders packed into FSSM containers and translated by
On main, then, the second case is a hang and not just a wrong picture. As far as we can see, Not run: Windows, other GPUs, the count-buffer variants (your test covers them), validation layers (they hang at device creation under Wine on this machine with AI-assisted (Claude Code). No game files. |
Flyander
left a comment
There was a problem hiding this comment.
At the current head, the earlier indirect-draw cursor overflow is fixed: both draw paths use a 64-bit cursor and advance by the actual emitted count. The independent GPU and Wine runs provide broad coverage of the milestone path. No additional blocker found in this review; I did not run tests locally.
|
Update to my earlier note (no action needed from me): thanks for porting the
Both sides kept: the Built on top of that, on an RX 9070 XT (AMD 26.11.2, Windows 11, Ryzen 7 9800X3D / 64 GB):
AI-assisted (Claude Code). |
|
I tested a standalone scratch integration of On Windows 11 x64 build 26300, RTX 3080 Ti / 621.35, MSVC 19.44.35230, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0 and LLVM MC 23.1.6 (RelWithDebInfo,
Both CTests ran with zero skips or Vulkan validation errors. Synthetic fixtures only. AI-assisted. |
|
Tested All 35 cells from five AI-assisted test run. |
What and why
This is the synthetic part of milestone M5 (
docs/d3d12_vulkan.md§6), claimed in #1548. It leaves out mesh shaders, which are D3D-29 and belong to @Ryx69.The test:
d3d12_m5_world_testuses only the D3D12 API through the proxy, with hand-written RDNA2 shaders from the translator. Every pixel is compared with a CPU reference, error 0. It has four parts:ExecuteIndirectdraws. Five calls use DRAW and DRAW_INDEXED signatures with strides 16, 20 and 32.MaxCommandCountbelow the count.InstanceCount0 and 2.std::threads each record their own list, and the four lists run in oneExecuteCommandLists. There are 8 rounds and 1,280 overlapping rectangles, so the list order shows in the pixels.Layer fixes the test needed:
ExecuteIndirectdraws never rendered through the COM layer. Replay issued a barevkCmdDraw*Indirectoutside any render pass, with no pipeline bound; only a unit test that set this up by hand passed. The call now carries the list's graphics state and replays as a whole draw. A list without a PSO, root signature or topology still records the bare call, sod3d12_indirect_rtandd3d12_indirect_zerokeep passing.multiDrawIndirect,drawIndirectCountanddrawIndirectFirstInstanceare enabled where the device has them. WithoutmultiDrawIndirect, each record becomes its own call.VkPipelineCache. There is now one per device, andVkPipelineCreationFeedbackcounts the hits.Not done:
ID3D12PipelineLibrary/CachedPSO, and persisting the cache (D3D-34, Runtime: use the Vulkan pipeline cache produced by the build (D3D-34) #367);StartInstanceLocationsemantics once PR 436's zero-based instance ids land;Overlap with M4 (#1791): #1791 also changes
ExecuteIndirect, for the dispatch kind. Each PR merges cleanly withmain, but the two conflict with each other. Whichever lands second, I'll merge it up right away.Tested
Head
820b2a20, Windows 11,LEONIDA_VK_VALIDATION=1:AMD Radeon 880M (26.11.2):
d3d12_m5_worldpasses with 0 validation errors: 34 cells, 1,280 rectangles, 5,120 pixels each from its own texture, error 0. The cache is 25,232 bytes.RTX 5070 Laptop (617.42): same counts, pass. The cache is 72,163 bytes.
Full ctest: 106 of 108 pass on both GPUs. Two tests fail, and both fail on
mainwithout this change:d3d12_draw, since Runtime: carry bundle blend factors back to parent draws #1660;d3d12_vulkan_device, the tiled sizes from d3d12: support tiled placed textures (D3D-191) #1674.d3d12_m2_textured,d3d12_m3_frame,d3d12_indirect_rt,d3d12_indirect_zeroandd3d12_state_mappass.Also built with
-G "Visual Studio 17 2022" -A x64.tests/test_ctest_registration.pyandtests/test_shader_checks.py: 64 passed.Checklist
SKIP_RETURN_CODE 77); fixtures inrun_gpu_tests.py's D3D12-harness listdocs/d3d12_vulkan.md: M5 row ("Synthetic part met except mesh shaders"), §3.6, §4.7AI-assisted (Claude Code).
🤖 Generated with Claude Code