D3D12.X: run whole split-PSO builds on one late worker without pc_call #2921
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2921
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2921"
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?
@saintwolf on GitHub · 2026-11-26 23:34 UTC · original
saintwolf:fix/pso-whole-worker-queue→nvidia-dev· +118 −22 · 2 files · 1 commits · openFixes 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
@JJAutoCompare on GitHub · 2026-11-27 00:08 UTC · original
Tested: Clean
8b57c36e7971d8d16e6ee48dc526e157ca43c400, Windows 11 build 26200, Ryzen 7 3800X, Rust 1.100.0 MSVC, debug. CPU only. Built withcargo test --locked -j 2 -p xcl --lib --no-run, then rancargo test --locked -j 2 -p xcl --lib -- --test-threads=1 --nocapturewith filters fordispatch_chain::tests,big_compile_tests,pso_async::used_tests,execute_indirect_with_a_pipeline_still_building_is_skipped,async_compute_pso_success_and_failure_in_dispatch_and_execute_indirect, andexecute_indirect_skips_failed_shared_console_compute_standin: 61 passed, 0 failed, 0 ignored, 0 skips. A separaterustc --edition=2021 --testharness using the head worker and gate code passed 1 test with zero skips. With 128 jobs queued under simulated low commit, the waiter used zero compile slots. At 2 GiB simulated free commit, one worker drained all 128 jobs in FIFO order.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 (
gpt-6.2-sol) ran and independently reran the checks and drafted this report.@3L1A5-1 on GitHub · 2026-11-27 00:27 UTC · original · edited 2026-11-27 01:18 UTC
In-game observation on 8 GB NVIDIA / 16 GB RAM: with
8b57c36ethe thread count stays flat through the world burst. Without it,nvidia-devdoubles its threads there. One run per arm. The second arm also carries other local changes (listed below), so this shows the thread behaviour, not a clean A/B of everything else.Tested
XCL_CS_PSO_WAIT_MS=50in both arms (so #2893's whole-form path is active), scripted input into the world load, 300 s title limit.nvidia-deveff3bcabas is.eff3bcab+ this PR (8b57c36e, merged as is) + local, unpublished memory changes (shader-code release, sparse tile reclaim, #2630). None of them creates threads.Results
eff3bcabeff3bcab+8b57c36e(+ local changes)ExecuteIndirect skipped)xcl-pso-wholethread per split program. I counted threads per process, not by name, so attributing them toxcl-pso-wholeis an inference.Not tested: this PR alone on
eff3bcab(arm B has other changes too), repeats, AMD.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
eff3bcab(same recipe, 450 s limit) shows the same jump: 131–137 → 302 threads and +4 GB private bytes at the start of the world burst. So the doubling reproduces in 2 of 2 baseline runs. That run ended in a device removal (0x887a0005) at title 272.5 s, with local video memory 4.5 GB over budget, so the 8 GB removal also happens without our local changes.Update 2 (clean arm):
eff3bcab+ this PR + #2630 only, with none of our local changes (#2630 creates no threads), same recipe, 450 s limit: threads stayed at 121–136 through the world burst, against 267 and 302 in the twoeff3bcabruns. Commit peak 29.7 GB. That run had no device removal (the title stopped presenting at title 241 s; the base alone also ended three different ways in three runs on this PC, so I'm not attributing that). So the thread bound holds without our changes.@ettehn on GitHub · 2026-11-27 00:29 UTC · original
Native Windows GPU check for
8b57c36e(RTX 5070 Ti Laptop, driver 621.24, Windows 11 26200.9974, Rust 1.97.1 MSVC, DXC/DXIL 1.8.2502.11, debug).cargo test --offline --locked -p xcl -j 4 --lib dispatch_chain::tests -- --test-threads=1 --nocapturepassed 4/4. The worker test ran 16 jobs on the same late worker.whole_readywith an actual NVIDIA PSO. WithXCL_CS_PSO_WAIT_MS=1, a synthetic wave32 compute shader split at 12 instructions and one shader memory window, I held the worker behind a channel barrier. Two calls returnedLatewhile the worker was held. After releasing it, the calls returnedReadytwice with the same PSO, and D3D12 returned a 1,978-byte driver blob. This verifies creation and reuse through the worker path.gpu_compute_e2eharness reported 5 passed / 2 failed / 0 ignored, with no skips, on botheff3bcab(exact parent) and8b57c36e(exact head). The failures matched:async_compute_pso_registers_real_pso_and_not_standinat theTRANSLATED_COMPUTEcleanup assertion, andsplit_compute_prefers_the_offline_whole_pipelineatcompiled.dispatch_chain.is_some().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.
@Decodere on GitHub · 2026-11-27 01:26 UTC · original
Independent desktop NVIDIA (natural 8 GB VRAM) verification of PR #2921 at head
8b57c36e7971d8d16e6ee48dc526e157ca43c400(1commit; exact parent & merge-base:eff3bcabf1b6f99223796ece166948003a53e0bconnvidia-dev,MERGEABLEagainst livenvidia-devecc0bb57).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
8b57c36e)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,0skipped)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,0skipped)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,0skipped)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,0skipped)cargo build --release -p xcl1m 25s, exit0,0new warnings vs. parenteff3bcab)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
eff3bcabf1b6f99223796ece166948003a53e0bc, fresh back-to-back baseline on the same machine):PR #2921 (
8b57c36e7971d8d16e6ee48dc526e157ca43c400):Runtime log observations (
xcl.log)9430log lines,0[ERROR]/ device-removal / panic lines.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
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).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).
@LocranKing on GitHub · 2026-11-27 04:49 UTC · original
Independent 180 s paired check on NVIDIA GeForce RTX 3060 Ti (8 GB) (
8b57c36emerged withnvidia-devecc0bb57, Series S /lockhartprofile, identical warm cache snapshot).Setup
621.40,nvprofileshader heap 2048 MB), DXC1.9.2602.17.XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PSO_WAIT_MS=50 XCL_GFX_PSO_WAIT_MS=200 XCL_CS_PSO_WAIT_MS=50 XCL_PREPARE_GRAPHICS=0 XCL_DRED=1+XCL_PRESS_AT(18:A..74:A).Results (180 s paired runs)
PresentX)nvidia-dev(ecc0bb57)#2921(8b57c36e+ecc0bb57)Both runs entered the 3D world and exited
0x0with0device removals and0crashes (put-off dispatches:287put off,48recorded,239skipped on#2921vs390put off,76recorded,314skipped onecc0bb57).Not tested: cold world entry without cached driver blobs, Series X (
anaconda) profile.@luckyteagirl on GitHub · 2026-11-27 06:12 UTC · original · reviewed
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 returnLatewithout 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 fallbackAI 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.