Repository navigation
gpu: trace descriptor history and GPU-written Mesh arguments - #3321
wish131400 wants to merge 2 commits into
Conversation
|
Follow-up integration check, separate from the passing fixture in this PR: I found an existing source-built scalar-input positive failing on the public #3248 head Two bounded local integration runs did not reach a valid Mesh argument capture. The later run reached native Compute attempts but stopped earlier in the rendering dependency chain: one PSO creation failure and two unsupported texture-UAV bindings, with zero translated draws/Mesh submissions. #3049 already supplies the relevant broader in-process texture binding work. A separate original-source constant-store The generic descriptor history also reaches its 8192-event truncation limit during initialization; it must be targeted before claiming complete later producer history. This PR remains draft and does not close #3310: the actual producer, same-resource/same-offset nonzero post-write/pre-consume records, and a real Mesh scene-color change remain unverified. No title assets, shader bytes, captures or private logs are included here. |
Leyukaka
left a comment
There was a problem hiding this comment.
Reviewed 42a18553 by its diff. Writes go through the existing log() only, tracing off costs one cached flag check, and the GPU readbacks wait on the fence. Three points:
- Conflicts with
main.mainaddednative_fixed_mesh_fixtureintests/startup_indirect_draw_indexed.cppwhere this PR adds its#include "startup_mesh_argument_provenance.inl"; a rebase is needed. - The trace does not fit a real run. As your comment says, the 8192-event cap is reached during initialization, and a copy is counted per descriptor, so one large
CopyDescriptorscan use the whole budget. A filter (address or heap range, slot, start after N events) or a ring of the last N events would make it usable; otherwise the docs should say it is for the fixture only. - The debug-layer check passes when there is no
ID3D12InfoQueue. The test should print whether the info queue was present, since the docs list "no debug-layer ERROR/CORRUPTION" as part of the check.
The PR is not marked draft on GitHub while your comment calls it a draft; marking it would match that. Request changes for 1-2.
|
I reviewed
MUST SHOULD NIT
AI-assisted. |
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed 029dfefe by reading the diff; not built or run.
Verdict: approve. The switch is inert when unset, and the history it records reflects the order shadow slots are updated in. It conflicts with main again (below). No MUST.
- Off path (
d3d12_capture.inl:851,:809). Unset,note_copyadds one cached flag check and skips bothtitle_descriptor_stridecalls.note_viewreturns fromtrace_descriptor_historyon the same flag. When the switch is on,title_descriptor_stridetakesdescriptor_lockbeforenote_lock, not under it, so this adds no new lock order. - "guest_before" is really before. The
createevent reads guest bytes before*slot_ptrand the token write. Thecopyevents run undernote_lock, and the title-memorymemmovehappens only after the lock is released (:896-901). The per-indexto[i]/from[i]reads come before the shadowmemmove, so overlapping copies log pre-copy ids. - SHOULD: copies into or out of untracked slots log as empty (
:851-857). When the destination has no shadow slot,previousandnextare both 0. When the source is untracked,nextis 0, the same as copying an empty descriptor. In both cases the event doesn't say which view was copied:sourceis only the title address. A missing or stale copy is exactly what the diagnostic should catch, so asource_id=field (from[i]when tracked) would separate "copied an untracked view" from "copied nothing". The fixture reaches none of these branches, nor the 8,192 truncation: every event it checks is a tracked slot-18 SRV (check script:64-66). - Conflict:
git merge-tree --write-treeagainstmain903fcc85conflicts inCMakePresets.jsononly (theprtest filter).
Tests: the six processes pin the positive oracle and four controls against the same pixels. The trace-off run proves no x2w-descriptor-history line is written when the switch is unset. CI ran startup_mesh_argument_provenance_warp at this head (Windows job: Passed, 87/87). The red Linux job is startup_triage_run_check.py on base 44a3ad5a; main has fixed that since #3542.
|
Reviewed These are separate from lukaslw-lab's
The AI-assisted. Ready for more review |
Independent reproduction and proposed follow-upI've independently reproduced Test environment
VerificationGPU tests were executed serially using the reproduction commands documented in this PR:
The reproduction used the unmodified PR revision and source-built fixtures. Proposed contributionBuilding on the descriptor-history implementation in this PR, the event-budget limitation identified by @Leyukaka, and the post-truncation traversal observation from @Jess-Doit, I'd like to develop a focused follow-up addressing targeted descriptor-history filtering. The proposed scope is:
I'm currently evaluating absolute-address and heap-relative filtering, particularly how relevant descriptor ranges can be identified reliably across separate executions. The intention is to preserve existing unfiltered behavior, descriptor-copy semantics, lock ordering and GPU synchronization. I would keep the other diagnostic correctness findings raised during review outside this initial contribution so that each change remains independently reviewable. This follow-up would reference #3310 and depend on #3321. It would not claim to satisfy #3310's remaining integration acceptance criteria. Are you currently working on targeted descriptor-history filtering, or would you be comfortable with me developing this as a separate follow-up contribution? AI-assisted architectural research, implementation planning and independent verification. |
Targeted descriptor history follow-up — implementation completeFollowing the previous comment, I've finished work on the targeted descriptor-history filtering implementation, including compatibility integration of your contribution against upstream revision Verification results:
The implementation introduces optional heap-relative filtering, source and destination range selection, bounded history admission, conservative descriptor attribution, and early termination of diagnostic traversal following truncation. Given the existing merge conflicts in #3321, I'm preparing an integrated upstream draft PR that incorporates your original contribution with preserved Git authorship, followed by a separate commit containing the filtering implementation, regression coverage, and documentation. Credit will also be given to @Leyukaka and @Jess-Doit for their relevant review findings. The contribution will reference #3310 without claiming to satisfy its remaining integration acceptance criteria. Thank you for establishing the foundation for this work. Any feedback during the review process is welcome. AI-assisted implementation, testing and verification. |
|
@wish131400 Heyo, following up regarding this after the reviews on PR #3772 The remaining blocking concern is coordination between this PR and #3772. Would you prefer to land your PR independently first, after which I would rebase #3772, or would you be comfortable with #3772 superseding this PR? I'm perfectly fine with either way you'd like to handle it. |
Change
Refs #3310. A zero indirect Mesh count can come from a missing or stale descriptor copy, an SRV pointing at the wrong scalar, or the consumer using a different argument offset. Add a source-built fixture that distinguishes these cases and an opt-in runtime descriptor-history diagnostic.
The fixture follows a Compute write of scalar
2, an SRV-driven updater writing(2,1,1), fenced post-write and pre-consume snapshots of the same 12-byte interval, and a guestExecuteIndirectMesh submission. It checks every pixel of the 4x2 scene-color target. Missing-copy, stale-copy, wrong-SRV-offset and wrong-argument-offset controls must fail the same positive oracle. A sixth process repeats the positive case with history disabled.X2W_D3D12_DESCRIPTOR_HISTORY=1records guest token bytes before publication, old/new shadow IDs, create/copy/overwrite order, descriptor identities, buffer SRV first element/stride and backing resources. CPU publication sequence is separate from GPU queue/fence evidence. The switch is off by default and adds no GPU commands or synchronization.The diagnostic supports this fixture and short startup reproductions only. It records the first 8,192 events and then truncates. Initialization or a large descriptor copy can exhaust that budget before a later producer runs; each copied descriptor counts separately. No filtering, delayed start or rolling history is implemented. Later integration history needs a separately targeted diagnostic. Arbitrary guest CPU stores are not intercepted. With
X2W_D3D12_VIEW_CONTENT_TOKENS=1, shadow-record IDs can be reused at different sequence points.Each fixture process explicitly prints
provenance debug info_queue=presentorinfo_queue=absent, and the driver requires this report. An absent queue leaves pixel/argument checks active but provides no evidence about debug-layer errors.Experiment, reproduction commands and limits are documented with the runtime switch. The fixture reuses the existing indirect Mesh executable and source-built shaders. Its WARP variant is in the PR smoke preset.
Verification
Tested merge commit
029dfefef4c273b5d9c5565fbff1ee2acfd9a3ca, which merges main44a3ad5aa9c679cc039b8cb8275738dd6e4405d2into the published PR head42a185536bfd5e9df81d786d55fceb48046f1b32. Conflict resolution preserves main's current smoke-test selections and native fixed-Mesh/MRT fixture alongside the provenance fixture.30 November 2026: Windows 10 Pro build 19045; NVIDIA GeForce RTX 4070 Ti SUPER; driver
32.0.15.7270; MSVC19.43.34810; DXC1.9.2609; Agility SDK 620; D3D12 debug layer enabled. GPU tests ran serially.Both builds passed. Each configuration produced:
The four skips in each configuration were
startup_indirect_mesh_warp,startup_mesh_argument_provenance_warp,native_fixed_mesh57_warpandnative_fixed_mesh57_mrt_warp: Mesh shaders are unavailable on this host's WARP adapter. Hardware tests passed. All six hardware provenance processes reportedinfo_queue=present, with no device removal or debug-layer ERROR/CORRUPTION messages.(2,1,1)(2,1,1)(0,1,1)(0,1,1)(0,1,1)(0,1,1)(0,1,1)(0,1,1)(2,1,1)(0,1,1)Mutation check: locally changed
src/startup_stubs/d3d12_capture.inl:855fromtrace_descriptor_history("copy", ...)totrace_descriptor_history("create", ...). The Debug build succeeded; the previously passingstartup_mesh_argument_provenance_hardwaretest failed its copy-history assertion, while positive pixel readback remained 8/8. Restored the mutation, rebuilt, and confirmed the hardware test passes again. The mutation is not committed.Also passed:
python -B tests/docs_links_check.py: 182 Markdown files, 728 links.python -B tests/bidi_controls_check.py: 2,695 tracked source, script and build/CI files.git diff --cached origin/main --checkbefore the merge commit.The previous head
42a18553passed Actions run 46130729442, including the provenance test on hosted WARP. Those historical CI results do not establish CI status for the new merge commit; its checks must run again.Evidence and follow-up
The fixture is original source under the repository's MIT license. Inputs are source-built or synthetic. Producer HLSL and submission/fences are native desktop D3D12; descriptor creation/copy and the indirect Mesh consumer use guest wrappers.
This supplies the fixture and diagnostic portion of #3310. Its matched integration acceptance remains outstanding: the reported 48 zero records were not reproduced. A matching integration must identify its scalar-input write and descriptor history, prove identical nonzero records at the same resource/offset, and show a Mesh submission changing scene color before composition. This fixture does not exercise translated gfx1013 producer code, guest queue preprocessing or XMem refresh. Keep #3310 open; integration work referenced in #3091/#3094 needs its own execution evidence.
AI-assisted implementation, conflict resolution and local verification.