Repository navigation
startup: opt-in skip of the graphics root SRV copy that no draw reads - #3028
lukaslw-lab wants to merge 7 commits into
Conversation
…s it Slot 44 (SetGraphicsRootShaderResourceView) at a title address without an upload mapping copies a 64 KiB window of title memory into the upload ring and binds it on the desktop list. Only a real-pipeline draw (list_draw) and an indirect graphics draw on the title's root signature read that binding; translated draws set their own root signature and copy the SRV from pass.root_address themselves. X2W_D3D12_ROOT_SRV_AT_DRAW=1 keeps the address pending at slot 44 (pass.srv_pending) and makes the copy in bind_pending_root_srvs at those two draws. Pending bits are cleared wherever srv_bound is cleared. The copy and bind are shared (bind_root_srv_copy). A report line counts deferred copies and those made at a draw. Unset, slot 44 behaves as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd without the copy
startup_root_srv_draw_{warp,hardware}: slot 44 sees red at a title address without an upload mapping, the title writes green, then a translated draw reads it through its root pointer. Both modes draw green; with X2W_D3D12_ROOT_SRV_AT_DRAW unset slot 44 also logs its copy, with it set nothing is copied. Mutant: ignoring the switch fails 'X2W_D3D12_ROOT_SRV_AT_DRAW=1: 1 slot 44 copy lines, expected none'.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… before the render totals; document the switch Moves bind_root_srv_copy and bind_pending_root_srvs below list_root_srv and the report line above the render totals, away from the lines open PRs R0Y00#2491 and R0Y00#2919 also change. No behaviour change. Adds the switch row, a root SRV paragraph in docs/startup-runtime.md and docs/experiments/startup-root-srv-at-draw.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
x2w_d3d12_root_srv_copies exports the deferred, made-at-a-draw and copied counts; startup_root_srv_draw prints them after the draw is recorded and the check expects (0, 0, 1) unset and (1, 0, 0) with X2W_D3D12_ROOT_SRV_AT_DRAW=1. Mutant: ignoring the switch fails with (0, 0, 1), expected (1, 0, 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R0Y00
left a comment
There was a problem hiding this comment.
Independent integration run at bedfcafc with main 3b6c38a8. I rebuilt startup_stream_consumer and d3d12_xs_shim, then ran ctest --preset <dev|release> --no-tests=error -V -R '^startup_(root_srv_draw|stream_draw|root_reset|root_cbv|table_alias)_(warp|hardware)$'. Each preset passed 10/10 without skips on Windows 11 build 26200.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656. Both adapters drew the expected green through the translated path, with the copied count 1 when the switch was unset and 0 when set. Table-alias debug checks reported zero errors. The PR's original-executable benchmark remains contributor evidence.
The positive deferred desktop bind remains untested. In list_draw, bind_pending_root_srvs runs before the target/topology gate, so a skipped draw with a real pipeline can consume and copy a pending SRV. Also, bind_pending_root_srvs clears the pending mask and counts an at-draw copy before bind_root_srv_copy confirms it obtained a desktop address. The direct and indirect callers cannot distinguish a failed copy from a successful bind. Please defer until the remaining draw checks accept the draw, preserve or explicitly invalidate the pending state on copy failure, and make the counter match successful copies. Add a narrow fixture for a consuming desktop draw and a skipped or failed bind, so the two new call sites have observable coverage.
Review of R0Y00#3028: no draw can read the desktop root SRV binding. list_draw forwards only with pipeline_real, which holds only for compute pipelines (every accepted desktop graphics stream gets an indirect graphics root), and a slot 61 graphics draw binds a pipeline over the list's root (empty, or the cached mesh root whose only SRV comes from its lease). The pending state, bind_pending_root_srvs and both call sites are removed: with X2W_D3D12_ROOT_SRV_AT_DRAW=1 slot 44 counts and skips the copy and the parameter stays unbound. The fixture export reports (skipped, copied). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two startup pairs (second reversed) on 41b3c77 with ring and alias set: 6.3 / 6.5 fps unset against 13.9 / 13.4 set, no buffer nulls or ring refusals, the same commit peak. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the integration run and the careful read. Following the deferred bind into a fixture showed that no draw can read the desktop binding in the current stand-in, so Why no consuming draw can be built:
What changed (
Receipts on
The experiment note keeps the |
|
I rebuilt All six tests passed, with no skips. The root SRV fixture read exactly 32 green pixels in both switch modes on WARP (10.0.26100.10068) and RTX 4070 (32.0.16.2124). With the switch disabled, the counter showed 0 skipped and 1 copied. With it enabled, it showed 1 skipped and 0 copied. That verifies the translated draw observed the write after Slot 44 in both modes. The two hardware resubmit tests that segfaulted on the reported Windows 10 setup both passed here, with a device removal reason of |
Change
Fixes #3027 (slot 44 copies a 64 KiB root SRV window at every call, but no draw reads the copy). Refs #2948, #2949.
X2W_D3D12_ROOT_SRV_AT_DRAW=1(opt-in): list slot 44 at a title address without an upload mapping skips the 64 KiB copy into the upload ring. The title address is kept for translated draws as before, and the parameter stays unbound on the desktop list (srv_boundclear). Unset, slot 44 copies at every call, as onmain.No draw reads that desktop binding in the current stand-in:
pass.root_address) at the draw.list_drawforwards only withpass.pipeline_real.build_stream_pipelineaccepts a graphics stream only with VS/PS or MS/PS, and every accepted one gets an indirect graphics root, sopipeline_realholds only for compute pipelines.indirect_graphics.root == pass.graphics_root: an empty root, or for a cached mesh pipeline the title's root, whose only root SRV comes from the validated lease.Changes:
d3d12_xs_device.cpplist_root_srv: under the switch, it counts and returns beforereadable_window/upload_from_title. The comment there says a desktop graphics pipeline that reads a root SRV would need the copy at its draw.x2w_d3d12_root_srv_copies(skipped, copied); a report line before the render totals when the switch is set:x2w-render root SRV copies (X2W_D3D12_ROOT_SRV_AT_DRAW): skipped N, copied M.docs/startup-runtime.md;docs/experiments/startup-root-srv-at-draw.md.bedfcafc) kept the address pending and copied at a reading draw. Review showed that no such draw can exist, so the pending state and its two call sites were removed.maine446b072): merges cleanly and adds no conflict withcpp-migrationor runtime: compile a supported graphics pair on first use in the stand-in #2981. The one new text conflict is with draft Integrate mesh translation, D3D12 rendering and memory handling #2603, on theX2W_TEST_ROOT_CBVline oftests/startup_stream_setup.cpp.Verification
Windows 10 22H2, i7-4790K, RTX 3080 Ti (NVIDIA 32.0.16.1047) and WARP; dev and release; commit
41b3c771(d4d76b88adds only the retest table).125 tests per preset, run with the switch unset and set: 123/125 pass in each of the four runs. The two failures are
startup_list_resubmit_nodebug_hardwareandstartup_list_resubmit_nodebug_untracked_hardware(SegFault). Both fail the same way on unmodifiedmainon this host. 18 capability skips (WARP without mesh shaders,startup_root_heapwithout the debug layer), the same in every run.startup_root_srv_draw_{warp,hardware}: slot 44 binds a title buffer holding red, the title writes green, then a translated draw reads the SRV through its root pointer. Both modes draw green. The fixture then reads the stand-in's counts: unsetskipped 0, copied 1; setskipped 1, copied 0.X2W_D3D12_ROOT_SRV_AT_DRAW=1: copies (skipped, copied) (0, 1), expected (1, 0)on both adapters.Startup run of the main executable (#870), release, warm shader cache, scripted input, 250 s,
X2W_D3D12_RING_RELEASE_AT_SUBMIT=1andX2W_D3D12_TABLE_ALIAS=1in every run, two pairs (second in reverse order), on41b3c771:buffer;tokenper 1,000 translated drawsThe first revision gave 6.3 / 7.1 → 14.8 / 14.0 fps in the same setup. Without other switches, it cut the buffer null bindings from 164,727 to 88 (#2948), but some ring reservations were still refused, so this complements #2949. No device removal and no ring refusals in any retest run.
AI-assisted: the change, tests and this description were written with Claude; I ran the startup comparison.
🤖 Generated with Claude Code