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

Closed
bstillbstill wants to merge 1 commit from upstream-pr/1278 into main
bstillbstill commented 2026-11-24 14:10:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bstillbstill on 2026-11-24T14:10:23Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:6583689985 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1278). Originally posted by [bstillbstill](https://github.com/bstillbstill) on 2026-11-24T14:10:23Z. --- 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)
DavidM1911 commented 2026-11-24 15:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:11:26Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7133979583 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1278#issuecomment-7133979583). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:11:26Z. --- Heads-up: conflicts with current `main` in `crates/xcl/src/hle/d3d12x/real.rs` — needs a rebase before merge.
upstream-sync closed this pull request 2026-11-26 01:04:41 +00:00
Prime1997 commented 2026-11-26 01:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T01:02:04Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7179361136 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1278#issuecomment-7179361136). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T01:02:04Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1268
No description provided.