startup: check the draw dump budget and removal fences #1543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1550"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T13:49:37Z.
Change
Refs #1149. This extends
startup_dump_fence, the check forsrc/startup_stubs/draw_dump_tracking.h. That header is the tracker behindX2W_DRAW_DUMP_FRAME, the draw-dump capture. It does four things:Signal.The only test,
startup_dump_fence_warp, submits one list on a real WARP queue and checks one completed copy. No other test setsX2W_DRAW_DUMP_FRAME. So 8 of 10 mutants left it passing (table below). One example: a copy whose fence completes withUINT64_MAX, as on device removal, was published anyway.The new
run_budget()drives the tracker throughScriptedQueue, a stand-inID3D12CommandQueue. ItsGetDevicereturns the real WARP device, so the tracker creates a real fence. ItsSignalkeeps that fence and returns a chosen HRESULT, and the test completes the fence from the CPU with 1 orUINT64_MAX. The expectations are hand-worked:Signalof 1;full()is false before each of 45 records and true after them, and a 46th record fails;UINT64_MAXpublishes nothing and leaves 46 slots;SignalreturnsDXGI_ERROR_DEVICE_REMOVED; the copy is kept afterdiscard, is never published, and leaves 45 slots.The new
startup_dump_fence_removed_control_warp(--mutate removed) expects the removed copy to be published, and must fail (WILL_FAIL).The existing
run()is unchanged. The change touchestests/startup_dump_fence.cpp, one CTest registered afterstartup_dump_fence_warp, and one sentence in theX2W_DRAW_DUMP_FRAMErow ofdocs/startup-runtime.md.Verification
Commit
309cfede(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0, WARP 10.0.26100.9818.tests/docs_links_check.py,tests/bidi_controls_check.pyandgit diff --checkpassed. The test is registered for WARP only, so it has no hardware variant.Mutation probe
I applied each mutation to the header alone, rebuilt
startup_dump_fence_check, ran the test, then reverted. None of this is committed.discardmatches!=limit = 49full()ignores consumed copiesrecord()checks>instead of>=++consumed_removedUINT64_MAX) publishedentry.recording = nullptrdroppedexecutereturnsS_OKinstead of theSignalHRESULTNotes for review:
execute()callsqueue->GetDevice()andCreateFence, so this uses a real WARP device and fakes only the queue. A fakeID3D12Devicewould need about 44 stubbed methods.UINT64_MAXcompletion is signalled from the CPU as a stand-in for a real device removal.Signalis left alone, because no real caller can later complete such a fence.Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T16:09:22Z.
Review: COMMENTED
Reviewed at
a3a6c3184bfa412ee795753b7f700f1491d58fdf.The new
run_budget()coverage intests/startup_dump_fence.cppexercises the 48-capture budget (entries_.size() + consumed_ >= limit), 1-based capture numbering across a multi-list batch, unwritten release onUINT64_MAXfence completion, and retention acrossdiscard()whenID3D12CommandQueue::Signalfails.ScriptedQueuedelegatesGetDeviceto the WARP device so fence creation uses a real D3D12 fence whileSignalreturns the scriptedHRESULT.Checks executed locally:
tests/docs_links_check.py,tests/bidi_controls_check.py,git diff --check): passed.cmake --build --preset dev --target startup_dump_fence_check,ctest --preset dev -R '^(startup_dump_fence_removed_control_warp|startup_dump_fence_warp)$' --no-tests=error --output-on-failure): 2/2 passed./O2(cmake --build --preset release --target startup_dump_fence_check,ctest --preset release -R '^(startup_dump_fence_removed_control_warp|startup_dump_fence_warp)$' --no-tests=error --output-on-failure): 2/2 passed.startup_dump_fence_removed_control_warpvia--mutate removed,WILL_FAIL TRUE): passed (failed as expected when expecting aUINT64_MAX-completed capture to be published).AI-assisted; commands listed were executed locally.