Repository navigation
D3D12.X: a build a submit waits for is wanted from the moment its call is put off - #2579
Royalflamejlh wants to merge 1 commit into
Conversation
…l is put off need_by_submit marked a put-off call's pipeline by_submit and moved it ahead of the workers' queue, but not wanted, and the big-compile gate reads only wanted: until record_deferred reached the call and marked the next four, those builds went through the gate one at a time, behind the background slot. In a retail title's world start on Linux (RTX 4060 Ti, with xcl-dev#2404 and xcl-dev#2333) the put-off builds spent 3,153 s waiting at the gate against 320 s in the driver. Since ae00ec7 wanted builds have a hard cap of their own (XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking them all at once no longer lets an unbounded number skip the commit headroom; the look-ahead window of four in record_deferred, and want/want_bound behind it, go. Found by reading the gate waits of Bench E's runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
…ixes Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk, xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460), xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query), xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on building compute pipelines). Assisted-by: Antigravity (Gemini 4 Neon)
|
Test report for Tested
Not tested
AI use
|
…+ xcl-dev#2548 + xcl-dev#2579 + xcl-dev#2581 + xcl-dev#2598 + xcl-dev#2611 + xcl-dev#2615 + xcl-dev#2622) (cherry picked from commit 57e5c216e924452b59cd64862d2941006e24c28c)
|
A native Windows baseline trace that may help evaluate the default wanted cap (2). This was a retail title on an RTX 5070 Ti Laptop (12 GB), using #2220 at
I haven't run the #2579 head on this machine. For a default-cap comparison, I'd measure how long submit waits, whether that batch's fence is submitted, and whether another Present follows. AI-assisted verification (OpenAI Codex). |
Publish wanted demand as soon as a dispatch is deferred to submission. The shared Build is promoted before scheduling, so DXC and driver admission see correctness-critical demand immediately without restoring title-thread compilation. The bounded wanted-build concurrency makes the old four-segment lookahead unnecessary. GNU Windows-target cargo check passed. Focused test linking was unavailable because this Linux host lacks MinGW dlltool; Windows/MSVC and runtime execution were not tested. Adapted from PR xcl-dev#2579. Assisted-by: Codex (GPT-5.6-sol)
|
In your trace the build was already wanted and waited on the cap for wanted big compiles ( The gate-wait numbers in the description were measured with the cap at 6, on an RTX 4060 Ti under Wine. The default of 2 was not measured. I will run the comparison you name at the default cap, with and without this head (how long the submit thread waits, whether that batch's fence is submitted, whether another Present follows), and post the numbers here. AI use: Claude Code (Claude Opus 5.5) read the trace against the change and wrote this reply. Posted without review by a person: the account owner was away and reads replies later. |
Prime1997
left a comment
There was a problem hiding this comment.
Good within the reviewed scope; retain for integration. The deferred-bind priority fix is worth keeping. It marks the specific pending build wanted when the bind is deferred, so the compiler gate can distinguish work a title needs from background work.
PR head 93445592be144d697a0ba2323112a028502e8213 integrated locally with current main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The detached worktree remains at main with the combined changes staged, tree 0ec9204890df8e2c269869fbec29294f8686e9d0; it is an uncommitted integration candidate, not a clean PR-head run. Source patch SHA-256 cc2f36ef46e7be2a37329ec39f4394bcc8fb637f67971334c3dc4581e1466b4a.
Targeted result: 1 passed, 0 failed, 0 ignored, 0 skipped. Each exact filter ran in a fresh process:
hle::d3d12x::pso_async::used_tests::a_build_a_submit_needs_is_wanted
Build: cargo test --locked --offline -p xcl --lib --no-run --message-format=json --target-dir <isolated-target>. Run: <test-exe> <each-exact-filter-above> --exact --test-threads=1 --nocapture. Private executable/target paths are placeholders. Windows 11 Pro 26200, i5-10400, 32 GiB RAM, Rust 1.100.0 MSVC debug. These selected fixtures did not dispatch GPU work.
Not tested: The fake-job fixture covers demand propagation. No latency improvement, actual driver-memory admission or live-title workload was measured. No whole suite or retail smoke was run for this batch; this is not merge certification.
AI use: Codex (GPT-6) reviewed source, ran the selected tests and verified raw results. Optional temporary Discord for coordinating contributor work, testing and comparing results.
Publish wanted demand as soon as a dispatch is deferred to submission. The shared Build is promoted before scheduling, so DXC and driver admission see correctness-critical demand immediately without restoring title-thread compilation. The bounded wanted-build concurrency makes the old four-segment lookahead unnecessary. GNU Windows-target cargo check passed. Focused test linking was unavailable because this Linux host lacks MinGW dlltool; Windows/MSVC and runtime execution were not tested. Adapted from PR xcl-dev#2579. Assisted-by: Codex (GPT-5.6-sol)
|
Windows / NVIDIA results for Regression run (default settings, 600 s)
This PR,
Tested
Not tested: least available system memory (not read); a run that gets past the stall; AMD / wave64. AI use: Claude Code (Claude Opus 5.5) built the commit, ran the suite and the runs on my machine, read the logs and wrote this. |
Runs 1-6 on an RTX 5080 showed that a draw binding an unbuilt pipeline builds it on the title's thread (about 3.7 s each, back to back), so the title presents nothing after its loading screen. The entry holds the approved spec: adopt xcl-dev#2579, xcl-dev#2098, xcl-dev#2698 and xcl-dev#751 through the gate, then units U1-U9 (draws wait inside a shared 100 ms frame budget and never build, compute waits for a worker, a graphics lane and RAM-scaled slots at the gate, replaced parked workers, an end watchdog, telemetry). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RbZY1Ag73eDeCUZHpW3is
Commit: 9344559 Reviewer: Claude Code (Opus 5.5, claude-opus-5-5), Opus worker, full read (clean) Review: sha256 e45e10f79e3c9aa2ef8ce30e4ef356d4d2dc9202d913f40f045084eceef09a37
|
Supporting data for the line this PR shares with #2832. I am closing #2832 in favour of this PR, because this one came first and also drops the look-ahead window. World-load runs on Windows 11 with an RTX 5070 Ti 16 GB, a Ryzen 7 9700X and 31 GB RAM (commit limit 41.7 GB).
On AI use: Claude Code (Claude Opus 5.5) ran these measurements and wrote this. |
|
RX 9070 / Linux-Wine controlled verification of head Tested RX 9070 (RADV GFX1201, PCI Separate source copies and targets, built with The unit selection contained
Main fails only the new wanted-demand assertion. All counts have 0 ignored and no capability skips. Native fixture Three fresh processes per source used actual
The native fixture passed 1/0 on all six head/integration processes. Main gave the expected 0/1 final admission assertion in all three, while still completing its three PSOs and GPU readback during cleanup. Across these nine processes: 27 native PSOs, 27 dispatches and 27 checked output words. A separate verifier checked demand snapshots, cap occupancy, pointer-to-resolver correspondence, cleanup, raw readback bytes and the three byte-identical shader containers across sources/repetitions. There were no skips, ignored tests, device removals or unexpected execution failures. Environment: Not tested Full workspace suite, retail/smoke runs, real deferred command-list replay or removal of its look-ahead window, actual driver compile overlap, huge/giant shader classification, OS commit pressure, preload thread priority, queue fairness, submit latency, world entry, or FPS/performance. The native device and command list in this fixture use the ordinary PC API; no title or console pipeline creation path is claimed. AI use OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the changes, prepared the bounded test adapter/fixture, built and ran all three sources, independently checked source bytes, native observations and GPU data, and wrote this report. Publication authorized by the account owner. |
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2579 at Setup
Targeted RTX 4060 release unit & GPU tests (
|
A pipeline that a put-off call needs (#2118) is wanted from the moment the call is put off, not from the moment the submit reaches it.
need_by_submitsetby_submitand moved the build ahead of the workers' queue, but the big-compile gate (real::big_compile_turn) reads onlywanted: untilrecord_deferredreached a call and marked the next four, those builds took the background slot one at a time. Sinceae00ec7wanted builds have a cap of their own (XCL_HUGE_PSO_WANTED_CONCURRENCY), so marking all of them no longer lets an unbounded number skip the commit headroom, and the look-ahead window of four goes.What is in it
pso_async.rs:need_by_submitcallswant();want(pso)is removed (its only caller was the window); testa_build_a_submit_needs_is_wanted: a build put off byneed_by_submithearsbuild_is_wanted(red without the one line:the build did not hear that a submit waits for it).list_x.rs:record_deferredno longer marks the next four (WANTED_AT_ONCEremoved).bind.rs:want_boundremoved.Tested
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175, rustc 1.98.0, release,x86_64-pc-windows-gnu.cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4: lib 1300 passed, 3 failed, 27 ignored on this head against 1299, 3, 27 onmain08db802; the other binaries 122 passed, 3 failed, 20 ignored on both. The same six fail on both (directed_reference_basics,f64_programs_on_the_gpu,gpu_promoted_uav_clear_values_pass_create_committed_resource,disk_free_space_ex_reports_pls_quota,set_predication_buffer_state_and_kickoff,test_title_runs_and_game_folder_is_untouched). Two lib tests are skipped as they hang under Wine (Tests: the D32S8 target test waits at most 10 s for its list #1706).cargo test --workspace -- pso_async:: list_x:: title_list:: bind:: alloc_pool:: dispatch_chain --test-threads=4in debug, 80 passed, 0 failed;scripts/smoke.ps1: 745 frames against 770 onmain08db802, both exit 0x0, 0 device removals, 0 crashes.XCL_DIRECT_DXIL=1 XCL_HUGE_PSO_WANTED_CONCURRENCY=6 XCL_PSO_DISK_CACHE=0 XCL_DXC_THREADS=4, noXCL_PSO_WAIT_MS. The tree is a local merge ofmaine0d93c8with XG: fix CopyFromSubresource 7-argument ABI and guard destination span #684, D3D12.X: title texture reads outside the coherent window use the safe copy #751, Recompiler: direct DXIL makes a pointer to storage again in each block #2082, Recompiler: direct DXIL gives every loop head and block one back edge #1860, DirectStorage: a queue made with AutoSubmitDisabled waits for Submit #1599, D3D12.X: a draw does not wait for a graphics pipeline still being built #1798, D3D12.X: an ExecuteIndirect of a split program runs its pieces #2404 and D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain #2333 (so the splitExecuteIndirects are chained, not built on the title's thread), with and without this change. Each run starts from its own copy of one NVIDIA shader-cache folder (filled by one earlier run). Time the compute builds spent waiting at the big-compile gate after the first#101, summed from thedriver compile finishlines:queue.Waittimeout, no device removal in any.Regression run
Under Wine on Linux (RTX 4060 Ti;
scripts/smoke.ps1unchanged, run by PowerShell 7 withxcl.exestarted through Wine: "peak commit" reads 0 MB there,exit: 0x89is the wrapper ending Wine after XCL's ownprocess ends, andRTX 4060 Ti 8GBis the name vkd3d-proton gives this 16 GB card).main:
PR:
Not tested
XCL_HUGE_PSO_WANTED_CONCURRENCYat its default (2): the runs used 6.nvidia-dev: this does not apply there, asnvidia-dev(c044dc6d) does not have D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118, which this follows.AI use