Repository navigation
Conversation
|
One thing in A fill at record time is what the tests do, so they don't show it. AI-assisted (Claude Code, Claude Opus 5.5). |
1acc285 to
137e2d1
Compare
|
Rebased onto Verified after the rebase, not before: built Written with an AI assistant. |
Independent Testing Results — PR #1937PR #1937 — compound ExecuteIndirect state replay The compound fixture passed 18/18 executions with zero pixel mismatches. The observed resource-lifetime validation diagnostics reproduce on BASE and HEAD and are pre-existing relative to this comparison. Revisions and configuration
Both revisions built successfully on both GPUs. Post-run remote checks matched the tested HEAD. Results
These are 288 actual case executions including repetitions, covering 12 distinct test names. No checkpoint-restored results were identified. JUnit and recorded SHA/build/binary evidence were consistent.
No VUID messages were captured in the compound-fixture logs. Validation findingsThe following tests emit
The follow-up confirms that these diagnostic signatures already occur on BASE. Their source-level cause remains unidentified; matching counts do not prove identical underlying allocations. All four isolated synchronization controls passed. GPU-assisted validation remains unconfirmed. Interpretation and remaining checksNo functional regression was detected within the eight scenarios executed on both revisions. The compound results support the tested HEAD behavior, but the new fixture was not run against an independent runtime-revert negative control. Still unverified:
Initial CTest wall-time screening also showed increases in two scenarios. Small sample counts and substantial BASE dispersion prevent classifying them as performance regressions; no dedicated GPU benchmark was performed. The results support the tested synthetic scenarios, not full runtime correctness. The overall run is not validation-clean because the pre-existing lifetime diagnostics remain. Testing used physical GPUs and synthetic fixtures. AI assisted artifact analysis and report preparation. No proprietary game assets were used. |
137e2d1 to
cdeac21
Compare
|
You are right, and the description was wrong to state only the host-visible restriction. The bytes are read when the call is recorded, not when the list executes, so a ring buffer filled just before I have documented the timing rather than implemented the deferral, and pushed a commit for it: I did not do the deferred expansion in this PR, and I want to be explicit about why rather than hide it behind scope: If a maintainer would rather have this PR held until the deferral is in, say so and I will close this one and open the larger change; the documented restriction is the part I am confident in today. Written with an AI assistant. |
|
Two documentation fixes from review, and what is still open Head
Still open, not addressed here: the expansions that no test exercises (the non-indexed The CI queue is still stalled repo-wide, so there is no signal from the current run yet. Written with an AI assistant. |
|
The two red jobs, from their logs Head
So neither red job is the compound replay. The Written with an AI assistant. |
|
Updating my own message: when I wrote it,
That test is not this branch's: it is an XDXR postbuild read-back under What I could not do, and say so rather than imply otherwise: compare against a completed If a maintainer wants the proof to be direct, one Written with an AI assistant. |
|
Current main For a combined candidate, run |
|
The decision, stated: the guard should refuse only what cannot be replayed You are right that the merge is not the hard part. This branch does not touch My position for the combined candidate: the creation guard should refuse only the shapes that cannot be replayed, and those are already the ones
Everything else is a compound draw that now draws with the bindings its record names, which is the whole point of the branch. So if #1737 lands first, the follow-up I would push is that guard narrowed to those four; if this one lands first, #1737's guard is what needs narrowing. I would rather agree that here than leave the two PRs to disagree after a merge. What I have not done: Written with an AI assistant. |
…TATE-REPLAY) The compound branch of ExecuteIndirect reset the bindings a signature writes and recorded no draw, so a signature whose records carry vertex buffer views, an index buffer view or root arguments bound nothing. Vulkan has no indirect call that rebinds state and the replay's Draw carries one state snapshot, so expand each record in the command list into the state calls it stands for and the DRAW or DRAW_INDEXED that follows, when the argument and count buffers are host-visible. A device-local buffer keeps the reset-only path. The bindings the signature writes are still reset after the call, as D3D12 does. Written with an AI assistant.
Snooozs (with reason): the expansion reads the argument and count bytes while ExecuteIndirect is recorded, while D3D12 reads them when the list executes, so an application that rewrites a host-visible argument buffer between the two - a ring buffer filled just before ExecuteCommandLists, or a list reused with a new buffer - replays the records that were there at record time. The description and the docs stated the host-visible restriction but not this one, and the fixture fills at record time, so it cannot show the difference. A sentence in the same paragraph, with the deferral named as what would match the runtime's timing.
… signature is guarded only when its bytes are not mappable
3d1dadb to
8d36e84
Compare
|
Rebased onto current What the overnight CI drained to, on this branch and on the other three we have open:
New head after the rebase: So: one red job is the repository's ( Written with an AI assistant. |
|
Measured, not argued: the two PRs cannot both land as they stand, and here is the build that makes them compatible I built the runtime on Windows and ran the tests, because you were right that a merge is not the whole question. Environment: Windows x64, MSVC 14.44.35207 (VS 2022 Build Tools), CMake + Ninja, Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 4090 (subgroup 32,
The failure in the middle row is the guard, in its own words:
So the narrowing I would take, in the guard #1737 adds: if (desc->NumArgumentDescs > 1) {
const D3D12_INDIRECT_ARGUMENT_TYPE last = desc->pArgumentDescs[desc->NumArgumentDescs - 1].Type;
if (last != D3D12_INDIRECT_ARGUMENT_TYPE_DRAW && last != D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED) {
log_once("CreateCommandSignature refused (not implemented): arguments before a dispatch, "
"first argument type", int(desc->pArgumentDescs[0].Type));
return E_NOTIMPL;
}
}Draw shapes are replayed per record now, dispatch shapes are not — the dispatch arm is the one that has no replay behind it, so it is the one that keeps refusing. The built candidate is pushed as I have not touched #1737's branch. If you want the narrowing there, say so and I will push it as a commit on top of Written with an AI assistant. |
|
The complete measurement, including a correction to what I posted an hour ago Everything below is the same machine and toolchain: Windows x64, MSVC 14.44.35207, CMake + Ninja, Vulkan SDK 1.4.363.0, NVIDIA GeForce RTX 4090, 1. Creation time, every shape #1737 refuses, on four treesProbe: #1737's own
So the guard's premise — "accepted, their bytes would be read as the draw's arguments" — is true of 2. Execution, the six
|
| tree | result |
|---|---|
main (no replay) |
2/6 fail: d3d12_stateful_indirect_pixels and ..._nonindexed_pixels, indirect pixels line 184: recorded.size() == (scenario == 0 ? 4u : 2u) |
main + #1737 |
same as main (the guard does not change what executes) |
main + #1937 |
6/6 pass |
main + both |
0/6, all at SUCCEEDED(device->CreateCommandSignature(...)) with arguments before the draw or dispatch, first argument type 3 |
main + both, narrowed to dispatch |
6/6 pass |
A detail worth knowing: with main's own copy of that test file, main passes 6/6. The two failures in the first row only appear with this PR's version, which asserts the recorded command count — so this PR also makes the test stronger, and the bug it fixes is real on main but invisible to main's own assertions.
3. What the replay decodes, so the narrowing does not just move the silent case
expand_compound_indirect decodes VERTEX_BUFFER_VIEW, INDEX_BUFFER_VIEW, CONSTANT_BUFFER_VIEW, SHADER_RESOURCE_VIEW, UNORDERED_ACCESS_VIEW, CONSTANT and the incrementing constant, and returns "skip" only for: no pipeline or topology, an unmappable argument or count buffer, a vertex-buffer slot outside the bound ones, a CONSTANT outside D3D12_MAX_ROOT_COST, or a type creation excludes. Every graphics shape the guard refused is decoded; only the two dispatch shapes have no replay behind them, which is exactly what the narrowing keeps refusing.
4. Full suite, no regressions
ctest on the narrowed candidate: 491 tests, 489 passed, 2 failed — xbox_present and d3d12_set_descriptor_heaps. Both fail identically on main and on #1937 alone on this machine, so they are this environment's, not either PR's.
The gap I still cannot close: only the {VBV, DRAW} and {IBV, DRAW_INDEXED} shapes have an end-to-end test. {CONSTANT, DRAW}, {CBV, DRAW}, {SRV, DRAW_INDEXED} and {VBV, CONSTANT, DRAW} are created and decoded but nothing exercises them; my table says what creation answers, not what they draw.
Written with an AI assistant.
|
Confirmed, and with the merge done locally against the current head (
What the two PRs are is worth stating plainly, because it decides who moves: #1737 refuses the shapes that #1937 implements. #1737's comment says the refusal is there because "the replay does not do yet" what those arguments need, and this branch is the replay. So a landing order exists that is not a coin toss: with #1937 in first, #1737's guard should be narrowed to the shapes the replay still does not cover (if any are left) rather than to The fixture that would catch it is the one you cite, Thanks for comparing the two trees rather than the two descriptions; that is what turns "these touch the same code" into a decision. Written with an AI assistant. |
|
Ran the combined candidate. You are right, and here are the numbers so the decision does not rest on reading. Candidate: this branch's head
So the pair does not work as merged: git takes both files, and #1737's guard refuses the signature this PR's fixture needs before the replay is ever reached. That is exactly the negative control you predicted, now measured rather than argued. Two details worth carrying into the decision:
The landing order I would argue for, from what the two PRs are: #1937 first, then #1737 narrowed to the shapes the replay still does not cover (argument type 5 among them, if root CBVs before the draw stay unsupported). The other order works too, but then this branch must remove or narrow the guard itself, and its fixture is the proof. Written with an AI assistant. |
Claimed in the coordination issue as: D3D-INDIRECT-STATE-REPLAY
Depends on: #1737 — not for code, but for the same rules from the other end: that pull request refuses multi-argument signatures in
CreateCommandSignature, which is exactly the shape this one replays. Whichever lands second has to take the other's part. If #1737 lands first it must keep the vertex/index-buffer shapes creatable (its own description says so) and it also has to updateruntime/test/d3d12_stateful_indirect_pixels.cpp, which creates a two-argument and a five-argument signature and checks that both are created. Textually both edit theExecuteIndirectparagraph ofdocs/d3d12_vulkan.mdsection 4.7. It also sharesruntime/shims/d3d12_com.cppwith #1896, in different hunks.What and why
The
finding:of 2026-11-25T12:04:43Z (BubsMcgee): a compound graphics command signature —VERTEX_BUFFER_VIEW,INDEX_BUFFER_VIEWor root arguments before itsDRAW/DRAW_INDEXED— bound nothing.ExecuteIndirectreset the bindings the signature writes and recorded no draw at all, so a signature that carries state arguments never drew, and a record's own vertex and index buffer views, root constants and root CBV/SRV/UAVs were lost.A driver applies those per record on the GPU. Vulkan has no indirect call that rebinds state, and the replay's
Drawcarries one state snapshot per command, so the layer expands the record list in the command list instead — the expansion that section 4.7 ofdocs/d3d12_vulkan.mdalready names for state arguments:runtime/shims/d3d12_com.cpp:expand_compound_indirect(). For each record, in the signature's argument order, it applies both vertex buffer views, the index buffer view, the root constants (and tier 1.1's incrementing constant, which occupies no record bytes) and the root CBV/SRV/UAV addresses, then records the record'sDRAWorDRAW_INDEXEDas an ordinary draw. Every argument shape is checked before the first record is recorded, so a shape this code cannot decode leaves the list as it was instead of expanding half of it. The bindings the signature writes are still reset after the call: that is D3D12's state-leakage rule, and this pull request keeps it, records or not.runtime/test/d3d12_stateful_indirect_pixels.cpp: a new compound pixel fixture, and the existing record-only compound scenario now checks the replay record by record instead of the reset alone.runtime/test/d3d12_draw_test.cpp,runtime/CMakeLists.txt: thed3d12_compound_indirect_pixelsmode and its ctest entry.docs/d3d12_vulkan.mdsection 4.7 and the test list say what is replayed and what is not.Tested
Built with VS 2022 Build Tools (MSVC 14.44), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, RelWithDebInfo, on current
mainb0f3d3998. No game files.d3d12_compound_indirect_pixels(new): one compound signature, two records, each carrying two vertex buffer views, the index buffer view, two root constants and a root CBV. The list binds a different vertex buffer, a different index buffer and different root arguments before the call. The test renders the record list throughExecuteIndirect, the same calls made by hand, and the pre-bound state alone, into three offscreen targets, then compares every pixel:runtime/shims/d3d12_com.cpphunk reverted, test kept: the indirect list lights 0 pixels and 1536/4096 pixels differ, i.e. it draws nothing, which ismain's behaviour.LEONIDA_VK_VALIDATION=1: the same numbers, 0 validation errors.d3d12_stateful_indirect_pixels: the record-only compound scenario now asserts the two expanded draws carry slot 5's vertex buffer view and the index buffer view from the argument buffer and the record's root constant (recorded.size()is 4, was 2), and a fourth scenario pins the boundary — the same records in a device-local buffer are not expanded, draw nothing and only reset. The state-leakage postcondition is unchanged.ctest -R "^(d3d12_draw|d3d12_stateful_indirect|d3d12_compound_indirect|xbox_geometry_upload_batch)": 9 of 9 pass. With the shim hunk reverted, 3 of those 9 fail:d3d12_stateful_indirect_pixels,d3d12_stateful_indirect_nonindexed_pixelsandd3d12_compound_indirect_pixels.d3d12_state_map,d3d12_execute_indirect_validation,d3d12_indirect_zero,d3d12_indirect_rt,d3d12_indirect_rt_upload_sysmem,d3d12_bundle,d3d12_bundle_indirect_warp,d3d12_bundle_indirect_layer,d3d12_bundle_indirect_off,d3d12_bundle_forbiddenand the fourd3d12_indirect_policymodes. The whole runtime suite was not run on this machine.What the measurement does not prove: that a GPU-written (device-local) record list replays — it does not, and the fourth scenario pins that. It also says nothing about frames: no title uses a compound signature today (section 4.9 lists its five startup signatures, one argument each), so this path was measured only by the synthetic test, not in a frame.
GPUs tested: AMD Radeon(TM) Graphics (gfx1036 iGPU), driver 32.0.21045.29003, Windows 11 Pro build 26300
AI-assisted: yes (DeepSeek Harness)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: D3D12 layer, no translator change)Written with an AI assistant.