Repository navigation
Conversation
|
Independent Ampere trace relevant to the worker-gate change. RTX 3090 Ti, driver 621.40, Windows 10, 32 GiB RAM. This was For 31 gated compute compiles completing from 225 to 380 s, the median recorded gate wait was 10.441 s and the median time in the driver was 4.941 s. The longest recorded gate wait was 47.588 s, followed by 5.006 s of native compilation. Correlating the driver starts with their measured gate durations shows three of the four PSO workers waiting at the gate concurrently. The 435.403 s summed across workers is overlapping time, not wall time. The title stopped presenting for this interval while compiles continued to finish. The trace establishes substantial worker occupancy at the gate on Ampere under the conservative compile limit. It does not establish how much of the Present gap a helper would remove. The experiment was left running while the queue progressed. AI use: OpenAI Codex (GPT-6) correlated the log events and drafted this report. |
|
Wine 11.0, Test-only diagnostic: replace the wait condition with |
luckyteagirl
left a comment
There was a problem hiding this comment.
Could helper retirement and park admission use one synchronized state? A retiring helper can read HELPERS=1 and PARKED=0, then pause before its CAS. The worker can park again, increment PARKED to 1, see HELPERS=1, and start no replacement. The helper's CAS from 1 to 0 then succeeds and it exits. With XCL_DXC_THREADS=1, the final state is one parked worker and no helper, so a queued small build is unserved until the big-compile wait ends. This is a sequentially consistent interleaving; stronger atomic ordering alone would not close it. A controlled retirement/new-park overlap should assert a helper remains available for a later job. Exact-head source review at 3693d9efe41c7f69b4f4d9a04b98c66ab6a94b7d; no live stall reproduction. AI-assisted review with Codex.
|
Source review of head A base worker waits with Not tested: no build or run of this head on our side. AI use: Gemini (Antigravity) flagged it in a first-pass review; Claude Code (Claude Opus 5.5) checked it against the source at |
(cherry picked from commit bbc6cf5b9b21ad6a8e2fb4314745667af5868239)
Let a bounded normal-band helper serve demanded pipeline work when a normal worker first blocks at the huge-driver-compile gate. Helpers retain BuildQueue priority, shared-Build wanted state, DXC admission, driver slot, and commit limits, then retire once parked workers return. The helper count never exceeds the configured normal worker count and preload/speculative work stays isolated. GNU Windows-target cargo check passed; Windows/MSVC, peak commit, thread churn, GPU, and title smoke were not measured on this host. Adapted from PR xcl-dev#2628. Assisted-by: Codex (GPT-5.6-sol)
3693d9e to
8b15bae
Compare
|
@GodlyBDS Thanks for the Ampere trace. Three of four workers waiting at the gate at the same time, with a median gate wait of 10.4 s against 4.9 s in the driver, is the case this PR is for. As you say, it doesn't show how much of the Present gap a helper would close; on Turing most of what is left is the graphics pipelines built at first bind (#1798). AI use: Claude Code (Claude Opus 5.5) drafted this reply. |
|
@pickles976 Thanks, confirmed and fixed in AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply. |
|
@KDenKC Right, an idle base worker in AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply. |
|
@luckyteagirl Agreed, that interleaving was real. Fixed in AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply. |
|
Independent Windows/NVIDIA check of PR head
The focused test exercised queue handoff and helper retirement under synthetic waits. I did not measure a cold title run, NVIDIA driver compilation time, peak commit with helpers active, or AMD/wave64 behavior. The PR's title A/B predates this queue revision, and its smoke title did not start a helper, so the runtime benefit still needs an exact-head run that reaches the big-compile wait. AI use: Codex (GPT-6.2 Sol) checked the changed queue and gate paths, ran the tests, and drafted this report. |
Let a bounded normal-band helper serve demanded pipeline work when a normal worker first blocks at the huge-driver-compile gate. Helpers retain BuildQueue priority, shared-Build wanted state, DXC admission, driver slot, and commit limits, then retire once parked workers return. The helper count never exceeds the configured normal worker count and preload/speculative work stays isolated. GNU Windows-target cargo check passed; Windows/MSVC, peak commit, thread churn, GPU, and title smoke were not measured on this host. Adapted from PR xcl-dev#2628. Assisted-by: Codex (GPT-5.6-sol)
…a helper A huge driver compile on an xcl-pso worker waits in big_compile_turn for one of the few slots (one at a time by default, 3 GB of free commit each) and keeps its worker thread while it waits. When the retail title of xcl-dev#505 starts its world, every worker takes one of its huge compute programs and waits there with one or two of them compiling, so the rest of the queue has no worker. A worker of the queue that has to wait now gets a helper thread in its place, and a helper that takes a huge program and parks too gets one of its own, so as many threads as the pool has keep serving the queue (at most 4 helpers per worker); a helper leaves once a parked thread is back. The slots and the commit check are unchanged, so no more driver compiles run at once than before. The queue is now one mutex and condvar holding the work and the counts of parked workers and helpers, instead of an mpsc channel. Nobody holds the lock while waiting for work, so an idle worker does not keep a helper from leaving, and a helper's leaving and a worker's parking are decided under the same lock, so a worker cannot park just as the last helper leaves and end up with none. Measured on an RTX 2070 SUPER from cold caches (empty XCL_DXIL_CACHE, NVIDIA / D3D12 implicit caches off), one run each: helpers start (32 in the run), but the pipelines built in the first 60 to 420 s after the world load match main's (336 against 342 at 420 s); frames do not come back in either run. Most of the title's own waiting is graphics pipelines built at a draw's first bind (xcl-dev#1798). Test: workers_parked_for_big_compiles_leave_the_queue_to_helpers fails without the change (the job queued behind the parked workers never runs); it parks every worker and as many helpers, twice, and waits for both counts to return to 0. With the helpers capped at the pool size, as before, the job queued behind them never runs. Part of xcl-dev#1269, xcl-dev#2088. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015csBcd63KUE2T1kW2P15nC
8b15bae to
16bf648
Compare
|
Checked at AI use: Claude Code (Claude Opus 5.5) checked the source at that head and wrote this. |
|
Updated to
Retail A/B, the new head against Tests on AI use: Claude Code (Claude Opus 5.5) did the review, wrote the fixes and this comment, and ran the tests, smoke runs and A/B; I started the game in each A/B run. |
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2628 updated head Setup
Targeted RTX 4060 release unit & GPU tests (
|
A huge driver compile on an
xcl-psoworker waits inbig_compile_turnfor one of the few slots (one at a time by default, 3 GB of free commit each), and it keeps its worker thread while it waits. When the retail title of #505 starts its world, every worker takes one of the title's huge compute programs and waits there, with only one or two of them compiling, so the rest of the queue has no worker. With this change, a pool thread that has to wait gets a helper thread in its place (a helper that parks too gets one of its own, up to 4 helpers per worker), so as many threads as the pool has keep serving the queue. A helper leaves once a parked thread is back. The slots and the commit check are unchanged, so no more driver compiles run at once than before. This is not "more workers" in the sense #2088 warns against.On the retail title of #505, this does not measurably speed up pipeline builds on my machine (see Tested): the PR fixes the stall that the test reproduces, not the title's long wait for frames.
Part of #1269, #2088 (scheduling).
What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:Mutex+Condvarholding the work and the counts of parked workers and helpers, instead of anmpscchannel. Nobody holds the lock while waiting for work.parked()returns a guard. On a pool worker it counts the worker as parked and starts a helper (xcl-pso-h{n}, numbered in start order) while there are fewer helpers than parked threads (workers and helpers), up toMOST_HELPERS_PER_WORKER(4) × the pool size. Off the pool, it does nothing.workers_parked_for_big_compiles_leave_the_queue_to_helpers: parks every worker and as many helpers, checks that a job queued behind them still runs, and that the counts return to 0 with no new work; twice. Without the change, that job never runs; with the helpers capped at the pool size, it fails too.parked_outside_the_pool_starts_no_helper.crates/xcl/src/hle/d3d12x/real.rs:big_compile_turntakes the guard before its first wait (outside the slots' lock) and holds it until it gets its slot.Tested
cargo test --workspace -- --test-threads=4on8cdbc6c(the same tree as the head16bf648, which only changes the commit message): 1431 passed, 0 failed, 47 ignored; 25SKIPPEDchecks: 21 "no wave64", 3 f16 per-lane forms refused (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426), 1 "no heap windows"cargo test -p xcl --lib parked, 30 runs withXCL_DXC_THREADS1, 2 and 3: 0 failures.main08db802and8cdbc6c:Setup:
XCL_DXIL_CACHEShaderCacheControlcall, the same in both trees, not in this PR)XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_TRACE=1Results, one run each, from
xcl.log. The world load started at 314 s in themainrun and at 184 s in this PR's, so themainlog covers only 464 s after it, and the table stops at 420 s:mainHelpers start, but the build rate is the same within run-to-run noise. Frames do not come back after the world load in either run. Most of the title's own waiting is graphics pipelines built at a draw's first bind, which D3D12.X: a draw does not wait for a graphics pipeline still being built #1798 addresses. An earlier A/B of the first version of this PR (helpers capped at the pool size) showed +7 % builds over 600 s; that window does not fit both runs here, and with one run each it may have been noise.
Regression run
main:This PR:
Not tested
mainhas moved by 17 commits since08db802. The PR merges into it without conflicts, but it was not rebased or rerun on it.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_015csBcd63KUE2T1kW2P15nC