Repository navigation
Conversation
Fixes three issues introduced when xcl-dev#2893 moved split compute PSO whole-form compilation off the title thread: 1. Unbounded 64 MiB-stack OS threads: whole_ready() spawned a fresh thread per distinct split PSO, piling up 100+ live xcl-pso-whole threads behind real::huge_compile_turn (6+ GiB stack VA reserved, ~2000 wakeups/s polling GlobalMemoryStatusEx). Replaced with a single persistent xcl-pso-whole worker thread fed by an mpsc channel. 2. Missed xcl-dev#2894 half-headroom rule: standalone xcl-pso-whole threads had pso_async::BUILDING == None, so build_is_late() returned false and every whole-form compile waited for the full 3 GiB+ commit headroom even while indirect dispatches were actively skipped. Added pso_async::with_late_build() (RAII thread-local override) around the worker's jobs. 3. False pc_call() registration: Chain::whole() still called pso_async::pc_call() on background threads, marking parked background workers in PC_CALLS as if a title thread were stalled. Now pc_call() is only taken when building synchronously on a title thread. Assisted-by: Antigravity
|
Tested: Clean Not tested: Live split-compute ExecuteIndirect submission, driver compilation and PC_CALLS, GPU readback, full workspace suite and retail smoke. AI use: T3 Code / Codex ( |
|
In-game observation on 8 GB NVIDIA / 16 GB RAM: with Tested
Results
Not tested: this PR alone on AI use: runs and analysis by Claude Code agents (Claude Sonnet 5.5), report written and checked against the run logs by Claude Code (Claude Opus 5.5). Update: a second baseline run on Update 2 (clean arm): |
|
Native Windows GPU check for
Coverage is synthetic. The local fixture did not execute the resulting whole PSO or run a retail title, so it does not resolve the reported device removal. OpenAI Codex (6.2sol) assisted with verification. |
|
Independent desktop NVIDIA (natural 8 GB VRAM) verification of PR #2921 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib whole_worker_runs_all_jobs_on_one_late_thread -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1727 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo test --release -p xcl --lib with_late_build_resets_after_return_and_panic -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1727 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo test --release -p xcl --lib hle::d3d12x::pso_async:: -- --test-threads=1 (3 consecutive runs) |
39 passed; 0 failed; 0 ignored; 1689 filtered out × 3 (3.88s, 3.87s, 3.86s, 0 skipped) |
cargo test --release -p xcl --lib hle::d3d12x::real::dispatch_chain:: -- --test-threads=1 (3 consecutive runs) |
4 passed; 0 failed; 0 ignored; 1724 filtered out × 3 (0.17s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 25s, exit 0, 0 new warnings vs. parent eff3bcab) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (eff3bcabf1b6f99223796ece166948003a53e0bc, fresh back-to-back baseline on the same machine):
xcl-smoke v1
commit: eff3bcabf1b6f99223796ece166948003a53e0bc
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1579 (PresentX 1579)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14695 MB
PR #2921 (8b57c36e7971d8d16e6ee48dc526e157ca43c400):
xcl-smoke v1
commit: 8b57c36e7971d8d16e6ee48dc526e157ca43c400
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1637 (PresentX 1637)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14743 MB
Runtime log observations (xcl.log)
9430log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19357 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14743 MB committed by the process; video memory 6118 MB local, 4812 MB non-local. 0backgroundxcl-pso-wholewhole-form split PSO spawns triggered during the warm-cache 60 s smoke ontitle: 29640639.
Limits of coverage
- Serialized single-worker late whole-PSO execution and
with_late_buildpanic/return guard reset were verified via both new unit tests (3/3each),hle::d3d12x::pso_async::(39/39× 3), andhle::d3d12x::real::dispatch_chain::(4/4× 3). - The paired 60 s retail smoke ran with warm shader/driver caches on
title: 29640639(0cold split whole-form PSO builds triggered), so it confirms zero runtime regression onnvidia-devrather than reproducing a cold split-program whole-PSO compilation burst (frame-count and peak-commit deltas vs. back-to-back parent reflect single-run startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
Independent 180 s paired check on NVIDIA GeForce RTX 3060 Ti (8 GB) ( Setup
Results (180 s paired runs)
Both runs entered the 3D world and exited Not tested: cold world entry without cached driver blobs, Series X ( |
luckyteagirl
left a comment
There was a problem hiding this comment.
A panic on the shared whole-PSO worker can leave unrelated pipelines permanently pending. The worker exits and drops jobs already accepted by its channel. Each affected chain has already set whole_sent=true, so later calls return Late without retrying even though its job is gone. The synchronous fallback only covers a send that fails immediately. I verified the channel behavior with the exact worker code on Windows: a gated first job panicked after the worker accepted a second job, the second job was discarded, and the stored sender refused new work. Could worker failure explicitly resolve the accepted jobs or clear their pending state so they can recover? A two-job fault-injection fixture would cover this path. Worker loop · Pending flag and fallback
AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source, ran the isolated CPU-only harness, and drafted this comment. The harness injects a panic in a synthetic job and does not call the driver or run a title.
Fixes three issues introduced when #2893 moved split compute PSO whole-form compilation off the title thread:
dispatch_chain::whole_ready()spawned a freshxcl-pso-wholethread (stack_size(64 << 20)) for every distinct split compute PSO hitting an indirect dispatch whenXCL_CS_PSO_WAIT_MSwas set. On a retail title run, 100+xcl-pso-wholethreads piled up simultaneously behindreal::huge_compile_turn(6+ GiB of reserved stack VA, ~2,000 condvar wakeups/s pollingGlobalMemoryStatusEx, andslots.urgent > 100).xcl-pso-wholethreads hadpso_async::BUILDING == None, sopso_async::build_is_late()always returnedfalse. Every whole-form compile waited for the full 3 GiB+ commit headroom even while indirect dispatches were actively skipped waiting for it.pc_call()registration:Chain::whole()still calledpso_async::pc_call()on backgroundxcl-pso-wholethreads, registering parked background workers inPC_CALLSas if a title thread were stalled in a long PC call.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs: adds a thread-localJOB_LATEoverride and RAII-guardedwith_late_build()helper checked bybuild_is_late().crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:std::thread::Builder::spawninwhole_ready()with a single persistentxcl-pso-wholeworker thread (64 MiBstack) fed by anmpscchannel, running each job underpso_async::with_late_build().on_title_thread: booltoChain::whole()sopso_async::pc_call()is only taken when building synchronously on a title thread.whole_worker_runs_all_jobs_on_one_late_threadandwith_late_build_resets_after_return_and_panic.Tested
32.0.16.2140), AMD Ryzen 7 7800X3D,rustc 1.100.0, debug test build + release smoke build.cargo test -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=1: 4 passed, 0 failed, 0 ignored, 0 skipped (including both new tests).cargo test --workspace -- --test-threads=4(withXCL_DXIL_CACHEset): 1,697 passed, 3 failed, 28 ignored (all 3 failures are pre-existing onnvidia-dev:gpu_compute_thread_limits_leave_the_lanes_past_them_outand twotexture_uploadoverflow tests; wave64 GPU tests printedSKIPPED ...: no wave64on NVIDIA).Regression run
main:PR head (
XCL_DIRECT_DXIL=1,XCL_PREPARE_GRAPHICS=0):Not tested
AI use