D3D12.X: compile compute pipelines eagerly on background workers #1442
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!1442
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1442"
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?
@WTactic on GitHub · 2026-11-24 16:01 UTC · original
WTactic:perf/parallel-compute-pso→main· +34 −8 · 4 files · 1 commits · openLazy PSO compilation previously meant compute pipelines were built synchronously on the calling thread during their first bind, leaving worker threads idle while large compute shaders blocked the title.
Submit compute pipelines eagerly so worker threads can build them in parallel across all CPU cores. Also track active driver PSO compiles and surface them in the window title, and make the DXC memory wait timeout and reserve configurable (
XCL_MEMORY_WAIT_SECS,XCL_MEMORY_RESERVE_GB, keeping the 60 s default per review feedback).What is in it
crates/xcl/src/hle/d3d12x/real.rs: eagerly submit compute pipelines to workers (!computeremaining lazy).crates/xcl/src/hle/d3d12x/pso_async.rs: add atomic counter tracking active driver PSO compilations across worker threads.crates/xcl/src/hle/d3d12x/present.rs: display active/built PSO counts in window title.crates/xcl/src/gpu/recomp/dxc.rs: make memory reserve and wait timeout configurable via environment variables (defaulting to 60 s).Tested
rustc 1.97.1, release/debugcargo test -p xcl --lib pso: 26 passed, 0 failed, 1 ignoredRegression run
main(1d027e5):PR (
293584e):Not tested
AI use
@eizispark on GitHub · 2026-11-24 16:42 UTC · original
Hardware test report — commit
e9c84b0Verified clean merge with
main(b7aa9f3) one9c84b0ea1195e39dbea352aa6f4f723d77c4ec7: workspace tests pass (0failures,0skips),0crashes /0device removals on AMD RDNA4, +4.0 to +5.2 GB higher peak commit (14855 MBonmain→20089 MBcold /18881 MBsecond run) and-119frames on the initial 60 s run while background compute PSO workers run concurrently.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:751 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)report.jsond3d12):frames shown: 1559 (PresentX 1560)vs1678onmain,peak commit: 20089 MB(+5234 MBvsmain's14855 MB),translated_pipelines: 446,failed_pipelines: 0,background_pipelines: [446, 0, 57377],dxil_cache: { hits: 461, misses: 232, compilations: 232 }exit: 0x0,frames shown: 1674 (PresentX 1674),presents per 2 s (last 3): 60 60 60,device removals: 0,crashes: 0,peak commit: 18881 MB(+4026 MBvsmain),translated_pipelines: 475,failed_pipelines: 0,background_pipelines: [475, 0, 57348],dxil_cache: { hits: 693, misses: 29, compilations: 29 }pso_async::active()counter, thedxc::wait_for_memorytimeout change (60 s→5 sdefault) /XCL_MEMORY_RESERVE_GB&XCL_MEMORY_WAIT_SECSoverrides, or eager compute submission; the two newXCL_MEMORY_*environment variables are also not listed inREADME.mdRegression run
main(b7aa9f3):PR (
e9c84b0):Not tested
wait_for_memorytimeout;XCL_MEMORY_RESERVE_GB/XCL_MEMORY_WAIT_SECSoverrides; gameplay past the menusAI use
@LocranKing on GitHub · 2026-11-24 16:55 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, 6C/12T CPU, 32 GB RAM) test report for
e9c84b0ea1195e39dbea352aa6f4f723d77c4ec7.In the 60 s smoke run,
xcl.logconfirmed multiple background worker threads actively compiling compute PSOs concurrently without crashes or frame drops; peak commit rose by +1511 MB relative tomainb7aa9f3(16241 MBvs14730 MB, 110.3%, within the 125% ceiling).Tested
e9c84b0ea1195e39dbea352aa6f4f723d77c4ec7(clean tree, merge-base930e8b4)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo build --release --workspace: ok (exit 0)cargo test --workspace --release --no-fail-fast -- --test-threads=4: 751 passed, 0 failed, 41 ignored, exit0SKIPPED(no wave64):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareRegression run
mainbaseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):PR head (
e9c84b0ea1195e39dbea352aa6f4f723d77c4ec7):Not tested: debug build, custom
XCL_MEMORY_WAIT_SECS/XCL_MEMORY_RESERVE_GBoverrides,XCL_SAMPLE_*tests on this branch, AMD / wave64 hardware.AI use: Antigravity (
Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.@mastrr9 on GitHub · 2026-11-24 17:05 UTC · original
Verified head
e9c84b0ea1195e39dbea352aa6f4f723d77c4ec7on Windows 11 / NVIDIA RTX 5080:cargo build --workspace: OK (0 new compiler warnings)cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignoredOne small review note: lowering
wait_for_memorydefault timeout from 60 s to 5 s (unwrap_or(5)) could let multiple background DXC workers pile into commit memory on tighter 16 GB systems when compute pipelines are submitted eagerly — keeping the default at 60 s while still honoringXCL_MEMORY_WAIT_SECSmight be safer.@DavidM1911 on GitHub · 2026-11-24 18:52 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@Raghav314 on GitHub · 2026-11-24 22:26 UTC · original
Test report for the new head
293584e, together with #1273 (be8d052), onmain689f2db: no regression, and no change at the world-load stop, which on this machine is not a pipeline wait.Setup: RTX 4090 24 GB (driver 617.14, 32-lane waves), 16 threads, 32 GB RAM, Windows 11, release. Local merge
c43951b=main689f2db+ this PR + #1273, no conflicts. Retail title, 180 s each,XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PRESS_A_AT=20, network off, warm DXIL cache from earlier runs.main689f2dbWhere both stop: at 70–77 s the title's queues wait on four
Wait64BitValueXaddresses (0x704180110,…120,…138,…158), each loggedwait-before-signal, prod=qNone; a GPU wait timeout with the title's fences pending follows, and submits drop to ~0. After that only pipeline builds continue. So on this card the stop is the #1452 wait (here as a stall, not a device removal), and a faster or earlier pipeline doesn't move it; this PR can't be judged on the world load until that is fixed.main689f2db:main+ this PR + #1273 (c43951b, a local merge, so not this PR's head commit):Not tested: this PR without #1273, the test suite on this merge, a cold DXIL cache, whether the longer driver builds after the stop (32 s vs 13 s) come from more builds running at once, AMD.
AI use: Claude Code (Claude Opus 5.5) ran both builds and runs, read the logs and wrote this report for @Raghav314.
@Rednaxeh on GitHub · 2026-11-25 10:38 UTC · original
RX 7800 XT (RDNA3), 32 GB RAM: no gain from eager compute builds on this machine. The title creates and binds its big compute programs one at a time, and the background workers cannot build them anyway: the 3 GB commit headroom of #1774 is never free here during world loading, so every worker parks in
big_compile_turnand the title's own thread ends up compiling at each bind, as onmain.Head
293584emerged locally ontomain568e7db(clean,6993fb2), release. Ryzen 7 7800X3D, 32 GB RAM (commit limit 43.6 GB with the system-managed page file), driver 32.0.32029.2010, Windows 11 26300. The newer retail title of #505, offline.Smoke, defaults (HLSL path), A at ~13 s
300 s runs,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_HUGE_PSO_CONCURRENCY=3 XCL_PSO_TRACE=1 XCL_ACTIVITY=1, thread dump at 200 smain, same switches: 1532); presents stop at 92 s in both. The chain of 20 compute programs of 270–330 KB that the AMD driver builds in 12–13 s each still runs one after the other on one title thread (huge, ungated here): the title creates each one right before it binds it, so submitting it to the workers at creation changes nothing. At 200 s, 18 workers were parked inbig_compile_turn(3 holding a slot and sleeping in the commit-headroom loop, 15 waiting for a slot) and one title thread was inamdxc64.dll.95cc13288a27a96e(ActivateRays, 3.35 MB of plain direct DXIL) enters the driver on a title thread at 78.8 s and has not returned at 300 s, the process at 54.5 GB of commit. Onmainthe same compile starts at 113 s; with this PR's eager build it starts earlier.XCL_PSO_WAIT_MS=2000on top: after 120 s not one driver compile runs for the remaining 180 s. The 3 slot holders sit inbig_compile_turn'scommit_freeloop (28.8 GB committed by the process, under 3 GB of commit free on this machine), nothing iswantedany more since the binds give up after 2 s, 2594 dispatches and 256 draws skipped, black window; commit flat at 28.8 GB.So the premise holds (the workers are idle while the title compiles), but on a 32 GB machine the gate keeps them idle by design, and only a bind that waits gets a compile started.
mainlogs nothing when the headroom holds a build back; that would be worth a line.Not tested
AI use: Claude Code (Claude Fable 5.1) read the logs and wrote this; the runs were mine.
@DavidM1911 on GitHub · 2026-11-26 05:27 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.