D3D12.X: start big compute pipelines building when they are created #2364

Closed
github-bot wants to merge 1 commit from gh-pr/2364/head into gh-pr/2364/base
Owner

@⁠b3IKK on GitHub · 2026-11-25 16:42 UTC · original
b3IKK:d3d12x/preload-big-compute-at-create → main · +45 −5 · 2 files · 1 commits · closed without merging

A retail load creates its compute pipelines at ~5 s and first binds them at ~91 s; a lazy one is built at that first bind, on the title's thread. The first wave's big programs (0.25–1.4 MB of DXIL, 50–105 s each on this machine) therefore hold the title for the rest of a 600 s run: frames stop at 96 s, and a 3600 s run still presents nothing after 96 s while finding 69 more cold programs.

Measured on 06c9f55 with temporary creation/bind logging (not part of this PR), one 300 s warm run of the retail 1.0.2.1 title:

  • 2,734 compute PSOs created, all before 10 s; 558 bound by 300 s;
  • the bulk's first bind is at 91 s (later waves at 141, 262 and 275 s);
  • 247 have a first shader container >= 64 KiB (max 105 KiB; none >= 128 KiB) — the expensive set;
  • a PSO created at 4–9 s and bound at 91 s has an 85 s head start in which nothing was building it.

This starts those 247 on the existing low-priority preload workers (XCL_PSO_PRELOAD=0 turns it off) when the PSO is created, instead of at the first bind. A bind that reaches one the workers have not started still takes the job itself, as before, and the shader key is kept, so the pipeline is still recorded in used-pipelines.txt for the next run. Smaller compute pipelines stay lazy; they compile in milliseconds.

What is in it

  • crates/xcl/src/hle/d3d12x/pso_async.rs: submit_ahead, which queues a lazy pipeline on the preload workers now; submit_as gains the ahead flag; test an_ahead_pipeline_is_built_without_a_bind (a worker builds it with no bind, and the later bind records the shader key).
  • crates/xcl/src/hle/d3d12x/real.rs: in go_background, a compute PSO whose first shader container is >= 64 KiB goes to submit_ahead; everything else stays submit_lazy.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1266 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib -- pso_async: 11 passed, 0 failed
  • the new test with submit_ahead made lazy: 0 passed, 1 failed — a preload worker picks it up without a bind: Timeout

Regression run

main (426a5a7, clean tree, no local changes):

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15158 MB

PR (f7ce93d, clean tree, no local changes):

xcl-smoke v1
commit: f7ce93da9ca4e3164b3b2d8b27efb4a5fb176c90
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16615 MB

(The main block is 426a5a7, an ancestor of the current main, from the same machine and data folder.)

Results of the 300 s retail runs (same warm cache):

control 1 (06c9f55) ahead, FIFO control 2 (warm re-run) ahead, priority
cold compute compiles 15 10 6 6
builds finished before 91 s (cold of them) 96 (1) 70 (2) 127 (1) 30 (2)
total driver time 432.6 s 430.9 s 404.0 s 478.0 s
last interval with a present 96 s 98 s 96–98 s 104 s

The FIFO version queued the new big programs behind the earlier-used builds; those builds are cache hits (in the first control, 96 of 97 pre-91 builds had a driver blob and only 1 was cold), so it changed nothing. Giving the new programs their own higher-priority queue did put two cold builds before 91 s, but the re-run control with the same warm cache has the same 6 cold programs and presents to the same point; the priority version only adds 74 s of driver time and a 6 s longer presentation tail. The wall is the 6 cold programs themselves (the first at 110 s, 1.1–1.4 MB of DXIL), not where their builds are submitted.

The mechanism is correct (the test proves a worker builds a pipeline with no bind), but the change does not move the world-load wall, so this is closed rather than merged as a neutral change. The warm-cache data now shows only 6 cold programs left in a 300 s run (from 54/24/9/8/7 earlier), so the practical lever is finishing those offline or with longer warm runs, not the submission point.
Not tested

  • whether this alone makes the world present within 600 s (measured above: it does not)
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: measured the creation-to-bind gap and the shader sizes on this machine, wrote the change and test, confirmed the test fails without it, and ran the suite and the scripts/smoke.ps1 pair.
**@⁠b3IKK** on GitHub · 2026-11-25 16:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2364) `b3IKK:d3d12x/preload-big-compute-at-create` → `main` · +45 −5 · 2 files · 1 commits · closed without merging A retail load creates its compute pipelines at ~5 s and first binds them at ~91 s; a lazy one is built at that first bind, on the title's thread. The first wave's big programs (0.25–1.4 MB of DXIL, 50–105 s each on this machine) therefore hold the title for the rest of a 600 s run: frames stop at 96 s, and a 3600 s run still presents nothing after 96 s while finding 69 more cold programs. Measured on `06c9f55` with temporary creation/bind logging (not part of this PR), one 300 s warm run of the retail 1.0.2.1 title: - **2,734** compute PSOs created, all before 10 s; 558 bound by 300 s; - the bulk's first bind is at **91 s** (later waves at 141, 262 and 275 s); - **247** have a first shader container >= 64 KiB (max 105 KiB; none >= 128 KiB) — the expensive set; - a PSO created at 4–9 s and bound at 91 s has an **85 s head start** in which nothing was building it. This starts those 247 on the existing low-priority preload workers (`XCL_PSO_PRELOAD=0` turns it off) when the PSO is created, instead of at the first bind. A bind that reaches one the workers have not started still takes the job itself, as before, and the shader key is kept, so the pipeline is still recorded in `used-pipelines.txt` for the next run. Smaller compute pipelines stay lazy; they compile in milliseconds. **What is in it** - `crates/xcl/src/hle/d3d12x/pso_async.rs`: `submit_ahead`, which queues a lazy pipeline on the preload workers now; `submit_as` gains the `ahead` flag; test `an_ahead_pipeline_is_built_without_a_bind` (a worker builds it with no bind, and the later bind records the shader key). - `crates/xcl/src/hle/d3d12x/real.rs`: in `go_background`, a compute PSO whose first shader container is >= 64 KiB goes to `submit_ahead`; everything else stays `submit_lazy`. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): **1266 passed, 0 failed, 46 ignored** (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib -- pso_async`: 11 passed, 0 failed - the new test with `submit_ahead` made lazy: 0 passed, 1 failed — `a preload worker picks it up without a bind: Timeout` **Regression run** main (`426a5a7`, clean tree, no local changes): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15158 MB ``` PR (`f7ce93d`, clean tree, no local changes): ``` xcl-smoke v1 commit: f7ce93da9ca4e3164b3b2d8b27efb4a5fb176c90 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16615 MB ``` (The main block is `426a5a7`, an ancestor of the current `main`, from the same machine and data folder.) **Results of the 300 s retail runs** (same warm cache): | | control 1 (`06c9f55`) | ahead, FIFO | control 2 (warm re-run) | ahead, priority | |---|---:|---:|---:|---:| | cold compute compiles | 15 | 10 | 6 | 6 | | builds finished before 91 s (cold of them) | 96 (1) | 70 (2) | 127 (1) | 30 (2) | | total driver time | 432.6 s | 430.9 s | 404.0 s | 478.0 s | | last interval with a present | 96 s | 98 s | 96–98 s | 104 s | The FIFO version queued the new big programs behind the earlier-used builds; those builds are cache hits (in the first control, 96 of 97 pre-91 builds had a driver blob and only 1 was cold), so it changed nothing. Giving the new programs their own higher-priority queue did put two cold builds before 91 s, but the re-run control with the same warm cache has the **same 6 cold programs** and presents to the same point; the priority version only adds 74 s of driver time and a 6 s longer presentation tail. The wall is the 6 cold programs themselves (the first at 110 s, 1.1–1.4 MB of DXIL), not where their builds are submitted. The mechanism is correct (the test proves a worker builds a pipeline with no bind), but the change does not move the world-load wall, so this is closed rather than merged as a neutral change. The warm-cache data now shows only **6** cold programs left in a 300 s run (from 54/24/9/8/7 earlier), so the practical lever is finishing those offline or with longer warm runs, not the submission point. **Not tested** - whether this alone makes the world present within 600 s (measured above: it does not) - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: measured the creation-to-bind gap and the shader sizes on this machine, wrote the change and test, confirmed the test fails without it, and ran the suite and the `scripts/smoke.ps1` pair.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:01 +00:00
github-bot closed this pull request 2026-11-26 05:29:01 +00:00
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 16:48 UTC · original

Closing this rather than merging a neutral change. The 300 s retail comparison on this machine (same warm cache, feature build f7ce93d vs 06c9f55):

control this branch
compute driver compiles started 206 213
finished before the 91 s wave 96 71
total driver time 432.6 s 430.9 s
last interval with a present 96 s 98 s

The ahead builds ran, but the low-priority preload workers are already saturated by the earlier-used pipelines, so queuing the new big ones at creation does not add pre-91 completions; the title still stops at ~96 s. The mechanism itself is tested (an_ahead_pipeline_is_built_without_a_bind), and the creation-to-bind measurement (2,734 compute PSOs created by 10 s, 247 of them >= 64 KiB, first bind at 91 s) is in #1380. The remaining levers are driver-compile capacity (commit headroom) or precompiling the set offline (#2338), not the submission point.

AI use: OpenCode, Claude Fable 5.2 measured the gap, wrote and tested the change, ran both 300 s retail runs and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 16:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2364#issuecomment-7168557979) Closing this rather than merging a neutral change. The 300 s retail comparison on this machine (same warm cache, feature build `f7ce93d` vs `06c9f55`): | | control | this branch | |---|---:|---:| | compute driver compiles started | 206 | 213 | | finished before the 91 s wave | 96 | 71 | | total driver time | 432.6 s | 430.9 s | | last interval with a present | 96 s | 98 s | The ahead builds ran, but the low-priority preload workers are already saturated by the earlier-used pipelines, so queuing the new big ones at creation does not add pre-91 completions; the title still stops at ~96 s. The mechanism itself is tested (`an_ahead_pipeline_is_built_without_a_bind`), and the creation-to-bind measurement (2,734 compute PSOs created by 10 s, 247 of them >= 64 KiB, first bind at 91 s) is in #1380. The remaining levers are driver-compile capacity (commit headroom) or precompiling the set offline (#2338), not the submission point. AI use: OpenCode, Claude Fable 5.2 measured the gap, wrote and tested the change, ran both 300 s retail runs and wrote this.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 17:06 UTC · original

Closing with the controlled comparison. The FIFO version's apparent gain was cache warmth: after the warm re-run on 06c9f55, the control has the same 6 cold programs as the priority build, presents to the same point (96–98 s vs 104 s), and uses 74 s less driver time (404.0 s vs 478.0 s). The priority queue does put two cold builds before 91 s, but the cold program that stalls the title starts at 110 s (1.1–1.4 MB of DXIL), after the 85 s creation-to-bind window.

The useful outcome is the warm-cache count: the cold set after the 96 s stop has gone 54 → 24 → 9 → 8 → 7 → 6 over the runs, and those 6 are the whole remaining wall. Finishing them offline (the #2338 precompile path) or in a longer warm run is the lever, not the submission point.

AI use: OpenCode, Claude Fable 5.2 ran the control and both feature versions on this machine and wrote this.

**@⁠b3IKK** on GitHub · 2026-11-25 17:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2364#issuecomment-7169018207) Closing with the controlled comparison. The FIFO version's apparent gain was cache warmth: after the warm re-run on `06c9f55`, the control has the **same 6 cold programs** as the priority build, presents to the same point (96–98 s vs 104 s), and uses **74 s less driver time** (404.0 s vs 478.0 s). The priority queue does put two cold builds before 91 s, but the cold program that stalls the title starts at 110 s (1.1–1.4 MB of DXIL), after the 85 s creation-to-bind window. The useful outcome is the warm-cache count: the cold set after the 96 s stop has gone 54 → 24 → 9 → 8 → 7 → **6** over the runs, and those 6 are the whole remaining wall. Finishing them offline (the #2338 precompile path) or in a longer warm run is the lever, not the submission point. AI use: OpenCode, Claude Fable 5.2 ran the control and both feature versions on this machine and wrote this.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 19:06 UTC · original

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).
suite: 143/4 = the three known baseline failures on this lane (fuzz_validate_and_gpu_2 seed 1003, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed) plus the known order-dependent gpu_geometry_wave32_prefix_count_over_a_mask (passes 2/2 solo here). The new split-ahead pipeline test an_ahead_pipeline_is_built_without_a_bind passes targeted. Note for the split-chain watch: this PR touches the area that produced the d3d12core.dll + 0x1AB118 crashes on #2338/#2344/#2349; no crash reproduces at this head on this lane.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 19:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2364#issuecomment-7171819655) **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). suite: 143/4 = the three known baseline failures on this lane (`fuzz_validate_and_gpu_2` seed 1003, `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_depth_buffer_created_for_unordered_access_is_placed`) plus the known order-dependent `gpu_geometry_wave32_prefix_count_over_a_mask` (passes 2/2 solo here). The new split-ahead pipeline test `an_ahead_pipeline_is_built_without_a_bind` passes targeted. Note for the split-chain watch: this PR touches the area that produced the `d3d12core.dll + 0x1AB118` crashes on #2338/#2344/#2349; no crash reproduces at this head on this lane. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.