Repository navigation
Conversation
With XCL_PSO_WAIT_MS a compute bind waits that long for its pipeline and then goes on without it. It waited the whole time for every pipeline, also for one whose build stood behind others in the workers' queue and could not start in that time. A retail title binds hundreds of pipelines for the first time when its world starts: at 50 ms the first 513 such waits took 10.4 s and 10.9 s in two runs, thread dumps showed its three recording threads in resolve_within's wait, and nothing was submitted for 20 s (the title's hang watchdog fires at 30 s). A bind with a budget now waits only when a worker has started the build or is free to start it; otherwise the pipeline is late at once, as after a wait that ran out. Without XCL_PSO_WAIT_MS nothing changes. In two runs with the change the same 513 pipelines were passed over in 0.3 s and 0.2 s and the title went on submitting. It still crashed 6 s and 35 s later: this does not get it into the world. The new test fails without the change (six binds wait 6 x 300 ms). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested 930e8b4 and be8d052 on an RX 7600 with Adrenalin 26.11.2, Windows 11 build 26300.9974, and XCL_PSO_WAIT_MS=50 on both. The patched build logged at least 513 queued pipeline builds it did not wait for, and I saw slightly more of the first scene. Both runs ended with DXGI_ERROR_DEVICE_HUNG (0x887A0006). One run per build, baseline first, with a shared shader cache. |
…all#1248, ivall#1250, ivall#1265, ivall#1273, ivall#1277, ivall#1278 Fix sudden RAM OOM during world loading under XCL_PSO_WAIT_MS and integrate 6 new upstream PRs: - pso_async.rs: track active waiters via WantGuard so build_is_wanted() drops back to false once resolve_within times out, preventing all background workers from bypassing BIG_COMPILES and commit-memory guards simultaneously (adds unit test a_timed_out_bind_clears_wanted_demand). - ivall#1248: pack <= 4 KiB sampled textures into 4 KiB heap slots instead of 64 KiB tiles (~768 MiB VRAM saved). - ivall#1250: late_release seals/waits only when nothing is in flight. - ivall#1265: default SRVs of multisampled depth buffers use Texture2DMS/Texture2DMSArray. - ivall#1273: skip budgeted bind waits when all workers are busy / build is queued behind others. - ivall#1277: exit sparse::upload_dirty cleanly if staging ring fence wait times out. - ivall#1278: isolate >= 4 MiB DXIL compute driver compiles in a dedicated GIANT_COMPILES queue. Assisted-by: Antigravity (Google DeepMind)
|
RDNA4 run of Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 26200.9974, rustc 1.100.0 MSVC, release. Retail title 1.0.2.1, the same saved state for every run. With
A warning for anyone testing this on AMD: back-to-back runs with the variable froze this PC completely. Three runs in a row gave 4 GPU timeouts (LiveKernelEvent 141) in 6 minutes. The driver recovered each time until it didn't, and the machine needed a hard reset. The fourth run above was run on its own, with a script that kills the title as soon as its log says the device was removed: one timeout, and the driver recovered. Regression (without Tested
Not tested
AI use
|
|
Test report on an NVIDIA wave32 card, with where the title's threads wait in both builds. Short version: with this PR the subrender threads no longer wait in Setup
Results (counts from XCL's own log lines)
Where the threads wait at the watchdog (thread dumps, symbolized against each build's PDB; title RVAs from my own copy of the exe)
So on this card the PR does remove the PSO wait from the hang chain; what it leaves behind is more skipped work and the GPU-side waits / device hangs. Whether the extra skips cause the hangs or only coincide with them I cannot tell from five runs; the video-memory difference (11.9 vs ~10 GB on a 10 GB card) is a second possible cause. Not tested: plain AI use: Claude Code (Claude Opus 5.5) ran the runs, traced the waits (thread dumps, IDA on my own copy of the title) and wrote this. |
|
Linux (Wine + vkd3d-proton) + NVIDIA test of Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, Tested
The log line of the change in every run with it: One more run without it, of 175 s, ended the same way later: last present at 137.9 s, the first The fifth run of each tree was later throughout (its late binds started 14 s later than in the other four), and the fourth and fifth with the change had NVIDIA kernel messages during them (312 and 1; the 1 is an Xid 31 from another process on the card). The first three pairs had none and show the same. This card's video memory was full (9.6 GB local) from about 76 s in every run, so what follows the late binds here may be the card as much as the title. The order of events is the one the RX 9070 XT and RTX 3080 reports above give. Read
Not tested: without AI use: Claude Code (Claude Fable 5.2) read the diff, built the trees, ran the tests and the eleven runs with |
|
Test report for Tested
Not tested
AI use
|
|
Test report for #1273 (a bind does not wait for a pipeline behind the workers' queue) – PR head Tested
Not tested
AI use
|
|
Windows + NVIDIA datapoint: with this PR, the title still stops presenting during loading. At that moment the binds wait for pipelines that are already being compiled. Setup: Windows 11 Pro 26300, RTX 5080 16 GB (driver 32.0.16.1088), Ryzen 7 9800X3D, 62 GB. Rust 1.100.0, release. Retail title 1.0.2.1. The build was a local tree of What the dumps show: presents stopped after frame 947, at about 53 s.
Before this PR ( That run compiled 157 compute pipelines fresh: 52 s of driver time, with the slowest at 12.8 s. Seven of them took over 2 s each. With Not tested: this PR on its own, AMD, a fully warm driver-blob cache (in progress), and the regression-run pair. AI use: Claude Code (Claude Opus 5.5) built and ran this, symbolized the dumps and wrote the report. Posted with my approval. |
# Conflicts: # crates/xcl/src/hle/d3d12x/pso_async.rs
|
Closing this: the reports above and what
It also conflicts with AI use: Claude Code with Claude Fable 5.2 read the reports and the commits named above and wrote this comment. |
With
XCL_PSO_WAIT_MSa compute bind waited its whole budget for every pipeline not built yet, also for one whose build stood behind others in the workers' queue and could not start in that time. At a retail title's world start this held the title's threads for about 20 s, with a 30 s hang watchdog. A bind now waits only when a worker has started the build or is free to start it; otherwise the pipeline is late at once, as after a wait that ran out. WithoutXCL_PSO_WAIT_MSnothing changes. Part of #505.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs: the workers' queue counts the builds no worker has taken yet and the workers at a build (send,BACKLOG,BUSY);resolve_withinasksworth_waitingbefore it waits, and logs the pipelines it does not wait for (the first 4, then at powers of two). Tests:binds_of_pipelines_behind_the_workers_queue_do_not_wait(fails without the change: six binds wait 6 x 300 ms, 1.84 s measured) anda_bind_waits_only_for_a_build_a_worker_has_or_can_start.Tested
stable-x86_64-pc-windows-msvc; tests in debug, runs in releasecargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4onbe8d052: 753 passed, 0 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwaredevice_type = "lockhart"), 300 s runs withXCL_NETWORK=0 XCL_PSO_WAIT_MS=50 XCL_COHERENT_MB=512and scripted A presses, from the same saved state. These runs are not of this head:maindoes not reach the world on this profile, so they are of a local merge of47efa2e+ D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT #605 + kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 + D3D12.X: composite multi-plane PresentX overlays #615, without this change and with it applied on top (as it was before its rebase onto930e8b4; the same condition inresolve_within).+0x32648e1at 174.9 s,+0x43c5d59at 171.7 s+0x5228010at 165.7 s,+0x27c195dat 193.2 sXCL_THREAD_DUMP_ATevery 4 s) three of the title's threads are inbind.rs:710→resolve_for_bind→resolve_wait→ the condvar wait ofresolve_withinin the dumps of the stall.GPU queue.Wait … did not complete within 5000 mslines from 171 s; that is not this wait (17 to 32 binds ran out of their 50 ms in the whole run).Regression run
main(930e8b4):this PR's head (
be8d052):Both with the default (Series X) profile and without
XCL_PSO_WAIT_MS: 60 s stay in the title's first screens and do not reach the changed code.Not tested
AI use
🤖 Generated with Claude Code