D3D12.X: compute programs of 4 MB DXIL or more build in their own queue #1278

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

@⁠bstillbstill on GitHub · 2026-11-24 14:10 UTC · original
bstillbstill:d3d12x/giant-compile-lane → main · +40 −2 · 1 files · 1 commits · closed without merging

A compute program of 4 MB of DXIL or more no longer holds BIG_COMPILES, the one slot for big background driver compiles. It waits in a queue of its own (also one at a time), so the 0.3 – 1 MB programs a title binds keep being built beside it. Part of #505.

The newer retail title (1.0.2.1) has three screen-probe compute programs whose console code is unrolled (88 863 instructions for the biggest): records 22 616 – 22 618 of shaders.rpf, indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes_9083c094_Wrapped, …ActivateProbesTarget_534f271f… and …ActivateRays_d60186e6…. Translated they are 29 052, 28 940 and 13 774 KB of DXIL (3 – 6 % less with #680's heap windows; ActivateProbes 22 815 KB without the wave64 split). The NVIDIA driver alone (one thread, no title running) had not built ActivateRays after 14 minutes, at 4.6 GB and growing. A preload starts it 4.4 – 6.5 s into every run of the title here; in BIG_COMPILES it then holds the only slot to the end of the run, and the title's binds of other big programs run out of time behind it.

What is in it

  • D3D12.X: compute programs of 4 MB DXIL or more build in their own queue – crates/xcl/src/hle/d3d12x/real.rs: GIANT_DRIVER_COMPILE (4 MB), GIANT_COMPILES (one at a time), compile_slots(len) picks the queue; test a_giant_driver_compile_does_not_hold_the_big_compile_slot.

Tested

  • NVIDIA GeForce RTX 3090 Ti (driver 32.0.16.2101, 32-lane waves), Intel Core i9-13900K, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.9.2609.5; debug for the tests, release for the title runs.

  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on eb03e7f: 742 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

  • The new test fails when compile_slots sends every compile to BIG_COMPILES, and passes with the change.

  • Title runs, newer retail title 1.0.2.1, 300 s each, the same scripted A presses, the two settings in turn, three runs each. Local test build: main 6bac4b4 + #533 + #433 + local diagnostic logging + this change behind a local switch (XCL_GIANT_LANE=0 turns it off). In every run the only driver compile of 2 MB or more was ActivateRays, from a preload.

    big compiles finished after 60 s (not from a blob) last compute pipeline finished last frame shown
    with the change 892 KB at 99 s; 1 001 KB at 146 s; none 99 / 67 / 146 s 136 / 144 / 149 s
    without none in all three 67 / 67 / 65 s 128 / 123 / 167 s

    The title shows only subtitles over a black screen in its first cutscene in all of these runs (as reported above on #505).

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 3090 Ti
title: My1stGame
seconds: 60
exit: 0x0
frames shown: 1649 (PresentX 1649)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16569 MB

This PR:

xcl-smoke v1
commit: eb03e7f3b55d28907def47b1e91627a07fa9806b
gpu: NVIDIA GeForce RTX 3090 Ti
title: My1stGame
seconds: 60
exit: 0x0
frames shown: 1651 (PresentX 1651)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17427 MB

No input in either run (intro and menus). The preload of ActivateRays starts about 4.5 s in, so the new queue is used in both 60 s of this PR's run. Made with smoke.ps1 plus a local fix that reads the log of a run that does not exit by itself (an earlier main run hung in end_title after its 60 s); these runs exited by themselves, so main's script gives the same blocks.

Not tested

  • How long the title runs with it: 5 of the 6 title runs above ended when the window was closed at 130 – 174 s, so they show the queue at work, not the end of the run.
  • AMD; Linux / Wine.
  • A machine short of commit: a giant and a big compile can now run at the same time (each grows in the driver; wait_for_commit still waits for 3 GB before each).
  • With #820 (XCL_BIG_COMPILES) or #1007 (which changes Slots and BIG_COMPILES too): a conflict in real.rs is likely.
  • HANDOFF.md (the note on background compute pipelines) says they are built "2 at a time"; on main it is one, and with this change a giant can build beside that one.

AI use

  • Claude Code (Claude Opus 5.5): found and measured the programs, wrote the change, the test and this description, ran the tests and the title runs on the hardware above.

🤖 Generated with Claude Code

**@⁠bstillbstill** on GitHub · 2026-11-24 14:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1278) `bstillbstill:d3d12x/giant-compile-lane` → `main` · +40 −2 · 1 files · 1 commits · closed without merging A compute program of 4 MB of DXIL or more no longer holds `BIG_COMPILES`, the one slot for big background driver compiles. It waits in a queue of its own (also one at a time), so the 0.3 – 1 MB programs a title binds keep being built beside it. Part of #505. The newer retail title (1.0.2.1) has three screen-probe compute programs whose console code is unrolled (88 863 instructions for the biggest): records 22 616 – 22 618 of `shaders.rpf`, `indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes_9083c094_Wrapped`, `…ActivateProbesTarget_534f271f…` and `…ActivateRays_d60186e6…`. Translated they are 29 052, 28 940 and 13 774 KB of DXIL (3 – 6 % less with #680's heap windows; ActivateProbes 22 815 KB without the wave64 split). The NVIDIA driver alone (one thread, no title running) had not built ActivateRays after 14 minutes, at 4.6 GB and growing. A preload starts it 4.4 – 6.5 s into every run of the title here; in `BIG_COMPILES` it then holds the only slot to the end of the run, and the title's binds of other big programs run out of time behind it. **What is in it** - `D3D12.X: compute programs of 4 MB DXIL or more build in their own queue` – `crates/xcl/src/hle/d3d12x/real.rs`: `GIANT_DRIVER_COMPILE` (4 MB), `GIANT_COMPILES` (one at a time), `compile_slots(len)` picks the queue; test `a_giant_driver_compile_does_not_hold_the_big_compile_slot`. **Tested** - NVIDIA GeForce RTX 3090 Ti (driver 32.0.16.2101, 32-lane waves), Intel Core i9-13900K, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.9.2609.5; debug for the tests, release for the title runs. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `eb03e7f`: 742 passed, 0 failed, 41 ignored. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). - The new test fails when `compile_slots` sends every compile to `BIG_COMPILES`, and passes with the change. - Title runs, newer retail title 1.0.2.1, 300 s each, the same scripted A presses, the two settings in turn, three runs each. Local test build: `main` `6bac4b4` + #533 + #433 + local diagnostic logging + this change behind a local switch (`XCL_GIANT_LANE=0` turns it off). In every run the only driver compile of 2 MB or more was ActivateRays, from a preload. | | big compiles finished after 60 s (not from a blob) | last compute pipeline finished | last frame shown | |---|---|---|---| | with the change | 892 KB at 99 s; 1 001 KB at 146 s; none | 99 / 67 / 146 s | 136 / 144 / 149 s | | without | none in all three | 67 / 67 / 65 s | 128 / 123 / 167 s | The title shows only subtitles over a black screen in its first cutscene in all of these runs (as reported above on #505). **Regression run** `main`: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 3090 Ti title: My1stGame seconds: 60 exit: 0x0 frames shown: 1649 (PresentX 1649) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16569 MB ``` This PR: ``` xcl-smoke v1 commit: eb03e7f3b55d28907def47b1e91627a07fa9806b gpu: NVIDIA GeForce RTX 3090 Ti title: My1stGame seconds: 60 exit: 0x0 frames shown: 1651 (PresentX 1651) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17427 MB ``` No input in either run (intro and menus). The preload of ActivateRays starts about 4.5 s in, so the new queue is used in both 60 s of this PR's run. Made with `smoke.ps1` plus a local fix that reads the log of a run that does not exit by itself (an earlier main run hung in `end_title` after its 60 s); these runs exited by themselves, so `main`'s script gives the same blocks. **Not tested** - How long the title runs with it: 5 of the 6 title runs above ended when the window was closed at 130 – 174 s, so they show the queue at work, not the end of the run. - AMD; Linux / Wine. - A machine short of commit: a giant and a big compile can now run at the same time (each grows in the driver; `wait_for_commit` still waits for 3 GB before each). - With #820 (`XCL_BIG_COMPILES`) or #1007 (which changes `Slots` and `BIG_COMPILES` too): a conflict in `real.rs` is likely. - `HANDOFF.md` (the note on background compute pipelines) says they are built "2 at a time"; on `main` it is one, and with this change a giant can build beside that one. **AI use** - Claude Code (Claude Opus 5.5): found and measured the programs, wrote the change, the test and this description, ran the tests and the title runs on the hardware above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A retail title binds three screen-probe compute programs whose console
code is unrolled (88 863 instructions for the biggest); translated they
are 13 - 29 MB of DXIL. The NVIDIA driver alone had not built the
smallest of them (13 774 KB) after 14 minutes on an RTX 3090 Ti. A
preload starts it about 4.5 s into a run and, as a big compile, it holds
BIG_COMPILES (one slot) to the end of the run: in three runs no other
compute pipeline of 256 KB or more was built after 67 s, and the
title's binds of 0.3 - 1 MB programs ran out of time behind it.

Programs from GIANT_DRIVER_COMPILE (4 MB) on now wait in GIANT_COMPILES,
one at a time, beside BIG_COMPILES. In three runs of a local test build
with the same change, big compiles finished after 60 s in two (892 KB
at 99 s, 1 001 KB at 146 s), against none in three runs without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:49:13 +00:00
github-bot closed this pull request 2026-11-26 04:49:13 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 14:11 UTC · original

Heads-up: conflicts with current main in crates/xcl/src/hle/d3d12x/real.rs — needs a rebase before merge.

**@⁠DavidM1911** on GitHub · 2026-11-24 14:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1278#issuecomment-7133979583) Heads-up: conflicts with current `main` in `crates/xcl/src/hle/d3d12x/real.rs` — needs a rebase before merge.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 01:02 UTC · original

Closing because main already has this change, from 724b9e27 (later refined by 051d2c8f and ae00ec73). real.rs on main defines GIANT_DRIVER_COMPILE (4 MiB), a GIANT_COMPILES slot with most: 1, and compile_slots(), which sends 4 MiB-plus pipelines to that lane instead of BIG_COMPILES. That is the same separate queue for giant compute compiles that this PR adds.

Compared at head eb03e7f3 against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

**@⁠Prime1997** on GitHub · 2026-11-26 01:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1278#issuecomment-7179361136) Closing because main already has this change, from 724b9e27 (later refined by 051d2c8f and ae00ec73). `real.rs` on main defines `GIANT_DRIVER_COMPILE` (4 MiB), a `GIANT_COMPILES` slot with `most: 1`, and `compile_slots()`, which sends 4 MiB-plus pipelines to that lane instead of `BIG_COMPILES`. That is the same separate queue for giant compute compiles that this PR adds. Compared at head eb03e7f3 against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing.

Pull request closed

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