D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once #814
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/820"
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?
Imported from ivall/xcl. Originally posted by gccody on 2026-11-24T05:59:33Z.
XCL_BIG_COMPILES=N(1 – 16) lets the driver build N big compute pipelines at once, instead of always one. The default stays 1, so nothing changes unless it is set.Background driver compiles of compute programs with ≥ 256 KiB of DXIL (
BIG_DRIVER_COMPILE) go throughBIG_COMPILES, a single slot that keeps the commit of a Windows machine with a small page file in bounds. Under Wine + vkd3d-proton on an RTX 3080, each of these builds takes 25 – 120 s (dxil-spirv, then the NVIDIA compiler), and the retail title's world load queued its backlog of them behind that one slot. The… msincompute PSO with the translated console CSlines includes the time queued for the slot, becausestartedis taken beforeacquire.What is in it
crates/xcl/src/hle/d3d12x/real.rs:Slots::mostis a function.BIG_COMPILEStakesbig_compiles():XCL_BIG_COMPILES, clamped to 1 – 16, read once, and logged when above 1.wait_for_commit()still runs before each build, so a machine short of commit still waits per build.Tested
x86_64-pc-windows-gnu.cargo test --workspacebinaries run under Wine (--test-threads=4). The same failures on this branch and onmaine50836b, so none of them is this change:main: 657 / 6 / 21; the extra failure there istitle_textures::gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes).gpu_more_atomics_sub_dword_scratch_valu,placed_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submitted,d32s8_targets_take_their_own_size_of_video_memory,xma2_source_voice_decodes_and_manages_lifetime.e2etest_title_runs_and_game_folder_is_untouched,pls_quota(Wine hasCopyFile2in kernel32, as #175 notes), andpredication_e2eset_predication_buffer_state_and_kickoff.GPU Loc Sigwatchdog (#505).XCL_BIG_COMPILES=6, at 234 s: 17 486 dispatches, 6 708 skipped; the 502 KB program built in 25 s. Process RSS stayed under 16 GB on the 61 GB machine.Regression run
scripts/linux/smoke.shfrom #257 under Wine (GE-Proton 11-14), 60 s at the title's first screen,XCL_BIG_COMPILESunset.title:is the SHA-256 prefix of the lower-cased folder name, as #704'ssmoke_title.ps1makes it.peak commitis 0 because Wine reports no process commit.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T06:06:46Z.
Test run of
0488eceb1f4c6a503b5a1559531aba156dad1202on AMD RDNA4. I merged it onto currentmainbeaa245locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 713 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 672 passed, 0 failed, 21 ignoredSKIPPED; all tests pass with the variable unset (default 1).Review:
XCL_BIG_COMPILESis read once into aOnceLockand clamped to 1–16, and the default stays 1, so nothing changes unless it is set. Raising it trades commit headroom for compile throughput on machines with a small page file, which the description says. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by ethandepstein-del on 2026-11-24T06:18:09Z.
Clean-room build, audit, and native hardware test run on NVIDIA RTX 5080 (Windows 11 Pro 25H2
26200.9974, driver617.42/32.0.16.1742,rustc 1.100.0, DXC Windows SDK10.0.26100.0).0488eceb1f4c6a503b5a1559531aba156dad1202cargo build --workspace): clean (only the pre-existingfetch_updatedeprecation warning).cargo test --workspace -- --test-threads=4):704 passed; 0 failed; 41 ignored(SKIPPED: only the 2 hardwareno wave64tests).XCL_BIG_COMPILESis parsed once viaOnceLock, clamped to1..=16, and defaults to1preserving existing behavior.(Clean-room hardware check only; no retail title or
smoke.ps1run. Assisted-by: Antigravity / Claude Sonnet 5.5 + Gemini 4 Neon)Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T07:09:25Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@beaa245:the buffer-mirror bookkeeping in real.rs is green here and the workspace keeps its verdict (737 passed on
mainon this box). Tree restored afterwards; hardware adapter, no Wine, no game data.AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-24T07:34:43Z.
Read of
0488ece(not built or run by me), one point about the commit guard whenXCL_BIG_COMPILESis above 1.wait_for_commit(real.rs:3339) waits until 3 GiB of page file are free, and its comment says each big compile takes about 1.5 GB. It is called once per build right afteracquire(:3401-3404), and with one slot that is a real guard: the check and the compile never overlap with another compile. With N slots, N workers can each take a slot, each see the same 3 GiB free, and each start a ~1.5 GB compile, so the free commit can fall about(N-1) x 1.5 GBbelow the 3 GiB the guard was written to keep. The PR text says the guard "still runs before each build", which holds, but each check is made without counting the builds that passed it a moment before and have not allocated yet. On the small-page-file machines the single slot protects,XCL_BIG_COMPILES=4or more can therefore run the title out of commit while the guard reports plenty.The DXC pool already counts this:
dxc::wait_for_memory(gpu/recomp/dxc.rs:415-433) needsreserve + WORKINGGiB, whereWORKINGis the number of compiles that passed and are running. Doing the same here (needing3 GiB + running x 1.5 GiB, and counting a build as running from the moment it passes the check until its driver call returns) would keep the default at its present behaviour and make larger values safe by the same rule. The default of 1 is unchanged either way, so this only matters for people who raise it.AI use: read with Claude Code, Claude Sonnet 5.5, against the PR head and
main; the point is mine.Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:09:39Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
0488eceonto main1ec4c98, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 708 passed, 7 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows - zero flakes in this lane.XCL_BIG_COMPILEStests green (708 passed, zero flakes).Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Alm0stSurely on 2026-11-24T11:59:15Z.
On Linux with an RTX 5080 (NVIDIA 620.73.04, Proton Experimental 11), increasing the background compile limit moved a reproducible loading checkpoint. I tested
0488eceon47efa2ewith fresh caches, the same 25 shader-set history entries, and the default unbounded PSO wait.I counted successful waits on distinct events in the first batch of 128. With one compile slot, four waits completed. With four slots, 31 waits completed in each of two runs. For one 526,180-byte compute pipeline, time waiting for a compile slot dropped from 32.98 seconds to under 1 ms. In the repeat, the compute dispatch skip counter stayed at zero through the crash.
A follow-up held the limit at four and expanded the history to 41 entries. In one run, 48 waits completed with zero compute dispatches skipped. The 49th remained pending. The furthest visible screen in these tests was still the loading artwork, followed by the guest null write at module offset
+0x23cf683. The repeatable improvement here is in loading progress; the 48-wait result has one observation so far.AI-assisted testing and reporting with OpenAI Codex.
Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T12:44:48Z.
I tested both settings on an RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Intel Core 7 240H, Bazzite 44 and Proton Experimental
11.0-20261112. XCL main47efa2ehad this PR, #640/#782/#793/#1123/#889 and a local nonlocal texture-pool experiment from #175. Both sessions used the same prefix and shader cache, temporary NVMe swap andXCL_PSO_WAIT_MS=5000.The one-slot run recorded 2,444 sampled presents and zero DirectStorage failures through 80,736 executions. The two-slot run confirmed
XCL_BIG_COMPILES=2in the log and recorded 2,596 sampled presents with 2 failures through 81,082 executions. Both ended at the same title watchdog-associated exception after 14 consecutive samples with zero presents. These are sequential runs with a warming cache. Playable world entry remains unverified.OpenAI Codex with GPT-6.2-Sol high assisted with the tests and report.
Imported from ivall/xcl. Originally posted by einfachama on 2026-11-24T18:09:12Z.
Test report for #820 at
0488eceon Windows, merged locally ontomain930e8b4, on my retail title's world load. WithXCL_BIG_COMPILES=3the title stops at the same place and time as without it: the watchdog at+0x23cf683, ~60 s after its world load starts. On this machine the slot count is not what holds the title back: most long waits are a bind building a still-queued pipeline itself, and the rest are single big builds that take 30 s or more in the driver whatever the slot count.Merge onto current
mainmainnow has25c6f7e, which replacedSlots::acquireandwait_for_commitwithbig_compile_turn. In it, a big build no bind waits for still takes a slot and waits for 3 GB of free commit, but a build a bind waits for skips both. So #820 conflicts in the slot code. I resolved it minimally:acquire, which has no caller left;main'sbig_compile_turnand itswantedpath, with its slot check reading(slots.most)();most: fn() -> usizeandbig_compiles()unchanged;big_compile_testsslots frommost: 1tomost: || 1.main,XCL_BIG_COMPILESsets how many big builds go ahead at once. Builds a bind waits for were never limited by the slot there.mainthe… msofcompute PSO with the translated console CSno longer includes the time spent in the slot queue (25c6f7e), unlike one50836bwhere the description was written.cargo test -p xcl --lib big_compile: 2 passed, 0 failed.cargo test -p xcl --lib pso_async: 7 passed, 0 failed. The whole suite was not run on this merge.Setup
main930e8b4+ #899f3b7dd6+ one local log line, not part of any PR. The line logs, at the start of each wait at a bind for a pipeline not built yet, what it waits for: the bind's own build, or which thread holds it, and the DXIL size once known. B adds #820.XCL_NETWORK=0,XCL_ACTIVITY=1,XCL_RUN_SECONDS=420,XCL_THREAD_DUMP_AT=100,130, A pressed at 26 s and 30 s; the world load starts by itself.XCL_BIG_COMPILES=3(the run logsup to 3 big compute pipelines built by the driver at once). Before every run the same cold snapshot of the shader caches was restored:Results
+0x23cf683+0x23cf683(exit0xc0000005, write at address 0) after 28–30 s without a present. No device removal, noE_OUTOFMEMORY.+0x23cf683: 57.7 s and 61.1 s after the load start (the cold one 62.6 s).Not tested
XCL_BIG_COMPILES=3with warm driver blobs (the warm runs above are without #820).mainafter #680 (memory windows from the descriptor heap, merged after these runs, opt-in withXCL_HEAP_WINDOWS=1): with it on, the translated DXIL changes, so the sizes and driver times here are for930e8b4and the switch form.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:48:27Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:12:12Z.
Triage (#1607) – head
0488eceMain already makes the number of concurrent big driver compiles configurable. In d3d12x/real.rs,
Slots::most()takesbig_compiles_at_once(), which readsXCL_HUGE_PSO_CONCURRENCY(1-64), adds a separate wanted count, and scales with the free commit when neither is set (commit724b9e2, #1524, and later changes).XCL_BIG_COMPILESwould duplicate that switch, and theSlotsstruct it changes no longer exists in this form.Recommendation: close (superseded by main commit
724b9e2/ #1524).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:39:50Z.
Closing as superseded: this change is already on
main(724b9e27). main BIG_COMPILES Slots count comes from big_compiles_at_once (XCL_HUGE_PSO_CONCURRENCY / XCL_HUGE_PSO_WANTED_CONCURRENCY or free commit, 1..64); PR's separate XCL_BIG_COMPILES knob (1-16) is the same capability under another nameTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed