Skip to content

D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once - #820

Open
gccody wants to merge 1 commit into
xcl-dev:mainfrom
gccody:d3d12x-big-compiles
Open

gccody wants to merge 1 commit into
xcl-dev:mainfrom
gccody:d3d12x-big-compiles

Conversation

@gccody

@gccody gccody commented Nov 24, 2026

Copy link
Copy Markdown

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 through BIG_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 … ms in compute PSO with the translated console CS lines includes the time queued for the slot, because started is taken before acquire.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs:
    • Slots::most is a function. BIG_COMPILES takes big_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

Regression run
scripts/linux/smoke.sh from #257 under Wine (GE-Proton 11-14), 60 s at the title's first screen, XCL_BIG_COMPILES unset. title: is the SHA-256 prefix of the lower-cased folder name, as #704's smoke_title.ps1 makes it. peak commit is 0 because Wine reports no process commit.

main:

xcl-smoke v1
commit: d208e14b765f469f4b56301b78afa8dac5378339
gpu: NVIDIA GeForce RTX 3080 10GB
title: 3d0ac693
seconds: 60
exit: 0x0
frames shown: 1127 (PresentX 1127)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: 0488eceb1f4c6a503b5a1559531aba156dad1202
gpu: NVIDIA GeForce RTX 3080 10GB
title: 3d0ac693
seconds: 60
exit: 0x0
frames shown: 1131 (PresentX 1131)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Windows. The default is unchanged there. With N > 1, each big build still waits for 3 GB of free commit first.
  • Values other than 1 and 6.

AI use

  • Claude Code (Claude Opus 5.5): the change, the runs, the measurements and this text, on the machine of the person submitting it.

🤖 Generated with Claude Code

…ver builds at once

Background driver compiles of compute programs of 256 KiB or more of DXIL go through one slot,
which keeps the commit of a Windows machine with a small page file in bounds. Under Wine +
vkd3d-proton on an RTX 3080 those builds take 25 - 120 s each (dxil-spirv, then the driver), and a
retail title's world load queued its backlog behind that single slot: at 234 s, 24 382 of 25 471
dispatches were skipped while their pipelines were still building. XCL_BIG_COMPILES (1 - 16,
default 1, unchanged) lets a machine with the memory for it build several at once; with 6, 6 708 of
17 486 were skipped at the same point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 0488eceb1f4c6a503b5a1559531aba156dad1202 on AMD RDNA4. I merged it onto current main beaa245 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 713 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 672 passed, 0 failed, 21 ignored
  • 0 SKIPPED; all tests pass with the variable unset (default 1).

Review: XCL_BIG_COMPILES is read once into a OnceLock and 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 onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@mastrr9

mastrr9 commented Nov 24, 2026

Copy link
Copy Markdown

Clean-room build, audit, and native hardware test run on NVIDIA RTX 5080 (Windows 11 Pro 25H2 26200.9974, driver 617.42 / 32.0.16.1742, rustc 1.100.0, DXC Windows SDK 10.0.26100.0).

  • Commit tested: 0488eceb1f4c6a503b5a1559531aba156dad1202
  • Build (cargo build --workspace): clean (only the pre-existing fetch_update deprecation warning).
  • Tests (cargo test --workspace -- --test-threads=4): 704 passed; 0 failed; 41 ignored (SKIPPED: only the 2 hardware no wave64 tests).
  • Audit: Clean — XCL_BIG_COMPILES is parsed once via OnceLock, clamped to 1..=16, and defaults to 1 preserving existing behavior.

(Clean-room hardware check only; no retail title or smoke.ps1 run. Assisted-by: Antigravity / Claude Sonnet 5.5 + Gemini 4 Neon)

RyanFrancoSCStudent referenced this pull request in RyanFrancoSCStudent/xcl Nov 24, 2026
Backport ivall/xcl PR #820 by gccody (0488eceb1f4c6a503b5a1559531aba156dad1202). Default remains one build; XCL_BIG_COMPILES can raise it. This does not resolve the world-loading watchdog. No Windows tests performed here.

Assisted-by: ChatGPT (GPT-6.2)
@dcastell1

Copy link
Copy Markdown

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:

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
exit 0; 0 failed

the buffer-mirror bookkeeping in real.rs is green here and the workspace keeps its verdict (737 passed on main on 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.

@iggyvilla

Copy link
Copy Markdown
Contributor

Read of 0488ece (not built or run by me), one point about the commit guard when XCL_BIG_COMPILES is 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 after acquire (: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 GB below 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=4 or 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) needs reserve + WORKING GiB, where WORKING is the number of compiles that passed and are running. Doing the same here (needing 3 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.

@SlopTart

Copy link
Copy Markdown

Linux / AMD RDNA3 datapoint.

Merged state: head 0488ece onto main 1ec4c98, 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_COMPILES tests 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.

@Alm0stSurely

Copy link
Copy Markdown

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 0488ece on 47efa2e with 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.

@Filip722

Copy link
Copy Markdown

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 main 47efa2e had 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 and XCL_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=2 in 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.

@einfachama

Copy link
Copy Markdown
Contributor

Test report for #820 at 0488ece on Windows, merged locally onto main 930e8b4, on my retail title's world load. With XCL_BIG_COMPILES=3 the 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 main

  • main now has 25c6f7e, which replaced Slots::acquire and wait_for_commit with big_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 D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once #820 conflicts in the slot code. I resolved it minimally:
  • So on current main, XCL_BIG_COMPILES sets how many big builds go ahead at once. Builds a bind waits for were never limited by the slot there.
  • On current main the … ms of compute PSO with the translated console CS no longer includes the time spent in the slot queue (25c6f7e), unlike on e50836b where 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

  • NVIDIA GeForce RTX 4060 8 GB (driver 621.24, 32-lane waves only), Ryzen 7 5800X, 32 GB RAM, commit limit 63.9 GB, Windows 11 Pro 26300, Rust 1.100.0, release builds.
  • Both builds are main 930e8b4 + D3D12.X: log how long a bind waits for a pipeline still being built #899 f3b7dd6 + 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 D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once #820.
  • My retail title, 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.
  • Order A B B A A B, B with XCL_BIG_COMPILES=3 (the run logs up to 3 big compute pipelines built by the driver at once). Before every run the same cold snapshot of the shader caches was restored:
    • XCL's DXIL, translated and driver-blob caches and the list of pipelines an earlier run used (444 shader sets);
    • the NVIDIA driver's shader cache and the D3D12 shader cache.

Results

run world load start +0x23cf683 after the load start longest wait open at the stop longest wait that returned (#899) peak commit lowest free commit
A 1 126.4 s 186.7 s 60.3 s 24.3 s, the bind's own build 5.2 s 29.7 GB 22.1 GB
B 1 68.1 s 131.7 s 63.6 s 30.4 s, a preload worker's build of 928 928 B DXIL 9.3 s 29.7 GB 22.3 GB
A 2 68.1 s 125.7 s 57.6 s 23.4 s, own build 6.0 s 29.1 GB 23.0 GB
A 3 66.1 s 125.7 s 59.7 s 22.3 s, own build 6.8 s 29.8 GB 21.9 GB
B 3 68.2 s 126.7 s 58.6 s 22.5 s, own build 6.9 s 29.9 GB 22.0 GB
B 4 68.1 s 128.7 s 60.7 s 23.9 s, own build 6.4 s 29.7 GB 23.0 GB
  • B run 2 is left out: the title stayed on its menus for the whole 420 s and never started its world load (exit 0, 16.7 GB peak). B 4 replaces it (same cold snapshot, run after the others), so B has 3 loading runs.
  • A 1's load started 60 s late; relative to the load start it is like the others. A fourth A run with the same snapshot: 59.6 s, ending in a 30.4 s wait on the same 928 928 B build.
  • Every loading run ended at +0x23cf683 (exit 0xc0000005, write at address 0) after 28–30 s without a present. No device removal, no E_OUTOFMEMORY.
  • Available physical memory was logged only from B 4 on: it went down to 2.5 GB there, and to 1.5–3.1 GB in the A runs below (32 GB of RAM).
  • What changed with 3 slots:
    • The earlier-run list's six big programs of 366–591 KB DXIL had no driver blob in the snapshot. With 3 slots they were done by 41–46 s instead of 72–77 s.
    • But then the three preload workers took the next big ones together: 709, 768, 804 and 928 KB. Each took longer side by side, e.g. 804 KB in 75.8 s against 55.1 s alone, and 768 KB in 77 s.
    • Big-program driver time per run: 109–172 s against 69–146 s.
    • Peak commit (29.7–29.9 GB against 29.1–29.8 GB) and lowest free commit (22.0–23.0 GB against 21.9–23.0 GB) are the same within the spread.
  • What holds the title back, the same with and without:
    • From the last present to the stop, two of the title's threads each wait ~29–30 s at their binds, one wait after another.
    • Of the compute waits from 94 s on, 110–117 per run are the bind building the pipeline itself, and 0–1 are held by a worker.
    • All of them are pipelines from shader sets an earlier run used, still queued for the preload workers. Those workers are busy with the big programs.
    • The run ends either with one long own build (22–24 s) or with a single 30.4 s wait for a preload worker's 928 KB build (B 1 and the fourth A run). Beside it, a graphics bind waits 17–22 s for a worker in every run in this table.
    • By 99.4 s, the B runs had 86–88 compute waits and the A runs 88–91, so 3 slots did not get the preload to those pipelines before the title needed them.
  • Warm, for comparison (A only, no D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once #820): after one more cold A run, two A runs with the caches each previous run had left, no restore in between.
    • Both still stopped at +0x23cf683: 57.7 s and 61.1 s after the load start (the cold one 62.6 s).
    • The warm caches did remove the earlier-run list's compute builds from the stall. By the stall's start, the binds had waited 113 and 100 times for 0.5 s and 0.7 s in all, against 117 times for 14.4 s cold. 18 of 20 and 20 of 21 big programs came from driver blobs.
    • The 30 s were filled by a few long builds that no earlier run had finished:
      • warm 1: a 510 KB program compiled on a title thread for 18.2 s, then another of the thread's own builds still in the driver at the stop; beside them, a chain of graphics binds waiting for workers, 29.6 s in all;
      • warm 2: a graphics bind waiting 29.3 s for a worker, and an own build of a pipeline no earlier run had used, open 22.5 s at the stop.
    • A run that ends at the watchdog keeps driver blobs only of the builds it finished (178 → 190 → 192 → 203 here), so the program in flight at the stop is compiled again the next time.

Not tested

AI use

  • Claude Code (Claude Opus 5.5) resolved the merge conflict, added the local wait log, ran the builds, tests and runs, counted the results from the logs and thread dumps, and wrote this report; I checked it before posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.