Shaders: --precompile driver compiles follow cores and free RAM (+44% RT pipelines on 16 GB RAM) #2994

Closed
RodrigoTorreao wants to merge 1 commit from upstream-pr/2994 into main
RodrigoTorreao commented 2026-11-27 09:41:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RodrigoTorreao on 2026-11-27T09:41:05Z.


Part of #2088. The offline pipeline pass (xcl shaders --precompile --pipelines, and the same code in xcl run's shader preparation) ran four driver compiles at once on every machine, and nothing in it looked at physical RAM. On a 16 GB machine with ray-tracing compute programs of ~1 MB DXIL, that left a 20-thread CPU at ~44 % while free RAM fell to 54 MB and Windows read up to 21,700 pages a second. With XCL_PIPELINE_THREADS unset, the number of compiles at once now follows the cores and the free physical RAM. With RAM to spare, timings match main. On the measured RX 6750 XT / 16 GB machine, 44 % more RT pipelines were built in the same time, and the RAM never ran out.

What is in it

  • crates/xcl/src/shaders.rs, one commit:
    • Automatic driver-compile limit. With XCL_PIPELINE_THREADS unset, up to cores − 2 compiles run at once (at least 1, at most 32). One more starts only while free physical RAM keeps XCL_PIPELINE_RESERVE_MB (default 2048) plus its estimate plus the full estimate of the compiles already running. The estimate is 64 MiB + 1 KiB per DXIL byte: twelve ~300 KB compiles held ~5 GB together, and one ~1 MB RT program held ~3.5 GB with the whole process. A waiting compile looks again every 250 ms, because RAM also frees without a compile ending.
    • Translation turns. A translation starts while free RAM keeps the same reserve plus 128 MiB for it and for each one running, or when none is running.
    • XCL_PIPELINE_THREADS=N keeps today's behaviour: a fixed N, with no RAM check.
    • Unit test driver_compile_estimate_grows_with_the_dxil.
  • I first also gated the DXC pool on physical RAM. With RAM to spare it cost 14 % (574 s → 657 s for the same 3000 records), so it is not part of this PR.

Tested

  • AMD Radeon RX 6750 XT 12 GB (RDNA2), driver 32.0.21045.29003; Intel i5-14600KF; 16 GB RAM; Windows 11 26200; Rust 1.100; release builds for the measurements and the smoke runs, debug for the suite. Rebased onto main 623d02e (the measurements below were made on 8b957be; shaders.rs is the same on both).
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
    • this PR (82c9c69 on 623d02e): 1458 passed, 1 failed, 47 ignored;
    • main 623d02e on the same machine: 1457 passed, 1 failed, 47 ignored.
    • The one failure is the same on both: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1. The extra pass is the new unit test.
    • SKIPPED on this adapter (both trees): the f16_programs_on_the_gpu and f32_programs_on_the_gpu per-lane forms, and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Cold A/B of xcl shaders --precompile. Each side had its own empty XCL_DXIL_CACHE and an exe name the AMD driver had never seen (its shader cache is per application). One run per side.
Pass main this PR
--limit 3000 (translation + DXC) 574 s, CPU 92 %, free RAM min 6.4 GB 543 s, CPU 94 %, free RAM min 7.7 GB
--only cs --pipelines, XCL_RT_GATE=0, 8 minutes 225 pipelines, CPU 44 %, free RAM min 54 MB, pages-in max 21.7k/s 325 pipelines (+44 %), CPU 62 %, free RAM min 466 MB, pages-in max 17.2k/s

The 8-minute pass ran on the earlier version that also had the DXC gate. The driver-compile limit, which is what changes that pass, is the same.

  • Before porting it to main, the same change ran on amd-dev f84a949: a full --precompile of the pack (26,503 records, 0 errors) and several title runs.

Regression run
main 623d02e:

xcl-smoke v1
commit: 623d02e465a17497a757a4ce867f482b0a6c8f3b
gpu: AMD Radeon RX 6750 XT
title: 2a4aef2e
seconds: 60
exit: 0x0
frames shown: 1595 (PresentX 1595)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14010 MB

This PR, 82c9c69:

xcl-smoke v1
commit: 82c9c69432b50217cafedec8ad530cac8b76ab2a
gpu: AMD Radeon RX 6750 XT
title: 2a4aef2e
seconds: 60
exit: 0x0
frames shown: 1434 (PresentX 1434)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13977 MB

Both runs: XCL_PREPARE=0, a separate empty XCL_DXIL_CACHE each, no input. The PR shows 90 % of main's frames at the same peak commit. The menu runs at 30 fps on both; the difference is cold in-game compiles during the first seconds. This PR does not touch that path, so it is likely run-to-run noise.

Not tested

  • NVIDIA, Intel and RDNA3/RDNA4 GPUs.
  • Machines with 32 GB or more. There the reserve should never bind, and the change comes down to cores − 2 instead of 4 compiles at once.
  • More than one run per side of the cold A/B.
  • The RAM estimate is calibrated on one AMD driver; other drivers may hold more or less per DXIL byte.

Help wanted: numbers from 16 GB machines and other GPUs. With a fresh XCL_DXIL_CACHE folder per side, run xcl shaders <pack> --precompile --only cs --pipelines with XCL_RT_GATE=0 for a fixed time, on main and on this branch. Post the pipelines made, CPU and the minimum free RAM.

AI use

  • Claude Code with Claude Opus 5.5 wrote the change, the measurement scripts and this description, and read the logs. I ran every test and measurement above on the hardware named. No game data, dumps or binaries are included; only hashes and aggregate numbers.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5524455150 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994). Originally posted by [RodrigoTorreao](https://github.com/RodrigoTorreao) on 2026-11-27T09:41:05Z. --- Part of #2088. The offline pipeline pass (`xcl shaders --precompile --pipelines`, and the same code in `xcl run`'s shader preparation) ran four driver compiles at once on every machine, and nothing in it looked at physical RAM. On a 16 GB machine with ray-tracing compute programs of ~1 MB DXIL, that left a 20-thread CPU at ~44 % while free RAM fell to 54 MB and Windows read up to 21,700 pages a second. With `XCL_PIPELINE_THREADS` unset, the number of compiles at once now follows the cores and the free physical RAM. With RAM to spare, timings match `main`. On the measured RX 6750 XT / 16 GB machine, 44 % more RT pipelines were built in the same time, and the RAM never ran out. **What is in it** - `crates/xcl/src/shaders.rs`, one commit: - **Automatic driver-compile limit.** With `XCL_PIPELINE_THREADS` unset, up to cores − 2 compiles run at once (at least 1, at most 32). One more starts only while free physical RAM keeps `XCL_PIPELINE_RESERVE_MB` (default 2048) plus its estimate plus the full estimate of the compiles already running. The estimate is 64 MiB + 1 KiB per DXIL byte: twelve ~300 KB compiles held ~5 GB together, and one ~1 MB RT program held ~3.5 GB with the whole process. A waiting compile looks again every 250 ms, because RAM also frees without a compile ending. - **Translation turns.** A translation starts while free RAM keeps the same reserve plus 128 MiB for it and for each one running, or when none is running. - **`XCL_PIPELINE_THREADS=N` keeps today's behaviour:** a fixed N, with no RAM check. - **Unit test** `driver_compile_estimate_grows_with_the_dxil`. - I first also gated the DXC pool on physical RAM. With RAM to spare it cost 14 % (574 s → 657 s for the same 3000 records), so it is not part of this PR. **Tested** - AMD Radeon RX 6750 XT 12 GB (RDNA2), driver 32.0.21045.29003; Intel i5-14600KF; 16 GB RAM; Windows 11 26200; Rust 1.100; release builds for the measurements and the smoke runs, debug for the suite. Rebased onto `main` 623d02e (the measurements below were made on 8b957be; `shaders.rs` is the same on both). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: - this PR (82c9c69 on 623d02e): **1458 passed, 1 failed, 47 ignored**; - `main` 623d02e on the same machine: 1457 passed, 1 failed, 47 ignored. - The one failure is the same on both: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`. The extra pass is the new unit test. - `SKIPPED` on this adapter (both trees): the `f16_programs_on_the_gpu` and `f32_programs_on_the_gpu` per-lane forms, and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - **Cold A/B of `xcl shaders --precompile`.** Each side had its own empty `XCL_DXIL_CACHE` and an exe name the AMD driver had never seen (its shader cache is per application). One run per side. | Pass | `main` | this PR | |---|---|---| | `--limit 3000` (translation + DXC) | 574 s, CPU 92 %, free RAM min 6.4 GB | **543 s**, CPU 94 %, free RAM min 7.7 GB | | `--only cs --pipelines`, `XCL_RT_GATE=0`, 8 minutes | 225 pipelines, CPU 44 %, free RAM min **54 MB**, pages-in max 21.7k/s | **325 pipelines (+44 %)**, CPU 62 %, free RAM min **466 MB**, pages-in max 17.2k/s | The 8-minute pass ran on the earlier version that also had the DXC gate. The driver-compile limit, which is what changes that pass, is the same. - Before porting it to `main`, the same change ran on `amd-dev` f84a949: a full `--precompile` of the pack (26,503 records, 0 errors) and several title runs. **Regression run** `main` 623d02e: ``` xcl-smoke v1 commit: 623d02e465a17497a757a4ce867f482b0a6c8f3b gpu: AMD Radeon RX 6750 XT title: 2a4aef2e seconds: 60 exit: 0x0 frames shown: 1595 (PresentX 1595) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14010 MB ``` This PR, 82c9c69: ``` xcl-smoke v1 commit: 82c9c69432b50217cafedec8ad530cac8b76ab2a gpu: AMD Radeon RX 6750 XT title: 2a4aef2e seconds: 60 exit: 0x0 frames shown: 1434 (PresentX 1434) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13977 MB ``` Both runs: `XCL_PREPARE=0`, a separate empty `XCL_DXIL_CACHE` each, no input. The PR shows 90 % of `main`'s frames at the same peak commit. The menu runs at 30 fps on both; the difference is cold in-game compiles during the first seconds. This PR does not touch that path, so it is likely run-to-run noise. **Not tested** - NVIDIA, Intel and RDNA3/RDNA4 GPUs. - Machines with 32 GB or more. There the reserve should never bind, and the change comes down to cores − 2 instead of 4 compiles at once. - More than one run per side of the cold A/B. - The RAM estimate is calibrated on one AMD driver; other drivers may hold more or less per DXIL byte. **Help wanted:** numbers from 16 GB machines and other GPUs. With a fresh `XCL_DXIL_CACHE` folder per side, run `xcl shaders <pack> --precompile --only cs --pipelines` with `XCL_RT_GATE=0` for a fixed time, on `main` and on this branch. Post the pipelines made, CPU and the minimum free RAM. **AI use** - Claude Code with Claude Opus 5.5 wrote the change, the measurement scripts and this description, and read the logs. I ran every test and measurement above on the hardware named. No game data, dumps or binaries are included; only hashes and aggregate numbers. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ettehn commented 2026-11-27 09:56:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T09:56:05Z.


Independent Windows/NVIDIA check of exact base 623d02e4 and head 82c9c694 on RTX 5070 Ti Laptop (12 GB, driver 621.24), Ryzen 9 8945HX (32 logical threads), 32 GB RAM, Windows 11 build 26200, Rust 1.97.1 MSVC and DXC 1.8.2502.11.

I ran xcl shaders <synthetic compute corpus> --precompile --only cs --pipelines --windows 1 --split 1 with XCL_DXC_THREADS=30 XCL_RT_GATE=0 and a fresh XCL cache per process. The corpus contains 62 variants of the repository's guarded arithmetic fixture. NVIDIA's own cache was retained. CPU is the machine-wide average and available RAM was sampled every 100 ms.

Run Wall time CPU Available physical RAM, start to minimum
Base A, default 4 driver slots 7.57 s 35.3% 21,519 → 20,809 MiB
Head A, auto 3.00 s 47.4% 21,504 → 20,840 MiB
Head B, auto 2.24 s 56.8% 21,502 → 20,940 MiB
Base B, default 2.24 s 60.2% 21,486 → 20,928 MiB
Head, XCL_PIPELINE_RESERVE_MB=65536 19.30 s 7.5% 21,522 → 21,347 MiB
Head, XCL_PIPELINE_THREADS=4 2.24 s 56.0% 21,503 → 20,954 MiB

All six runs exited 0, with 62 pipelines made, 0 refused, 0 translation errors, 0 skips and 0 XCL driver-cache loads. The 62 driver-cache filenames matched across all six. The head logged up to 30 driver slots in auto mode. The deliberately unattainable reserve exercised the combined translation/driver throttle and still completed the corpus. The baseline repeat matched the fastest head run, so the timings are inconclusive for a default-mode speedup. This covers synthetic offline compute. Large ray-tracing shaders and title startup were outside the test.

On the exact head, cargo test --release --locked --offline -p xcl --lib driver_compile_estimate_grows_with_the_dxil -- --test-threads=1 and cargo test --release --locked --offline -p xcl --test gpu_compute_e2e offline_compute_pipeline_is_reused_by_a_second_process -- --test-threads=1 each passed 1/0/0 with no skip. The latter exercised building, reusing and repairing a synthetic compute PSO's driver blob across processes.

AI use: OpenAI Codex (GPT-6) assisted with the benchmark and verification.

<!-- greyfinch-sync:ivall/xcl:comment:7215272562 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7215272562). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-27T09:56:05Z. --- Independent Windows/NVIDIA check of exact base 623d02e4 and head 82c9c694 on RTX 5070 Ti Laptop (12 GB, driver 621.24), Ryzen 9 8945HX (32 logical threads), 32 GB RAM, Windows 11 build 26200, Rust 1.97.1 MSVC and DXC 1.8.2502.11. I ran `xcl shaders <synthetic compute corpus> --precompile --only cs --pipelines --windows 1 --split 1` with `XCL_DXC_THREADS=30 XCL_RT_GATE=0` and a fresh XCL cache per process. The corpus contains 62 variants of the repository's guarded arithmetic fixture. NVIDIA's own cache was retained. CPU is the machine-wide average and available RAM was sampled every 100 ms. | Run | Wall time | CPU | Available physical RAM, start to minimum | | --- | ---: | ---: | ---: | | Base A, default 4 driver slots | 7.57 s | 35.3% | 21,519 → 20,809 MiB | | Head A, auto | 3.00 s | 47.4% | 21,504 → 20,840 MiB | | Head B, auto | 2.24 s | 56.8% | 21,502 → 20,940 MiB | | Base B, default | 2.24 s | 60.2% | 21,486 → 20,928 MiB | | Head, `XCL_PIPELINE_RESERVE_MB=65536` | 19.30 s | 7.5% | 21,522 → 21,347 MiB | | Head, `XCL_PIPELINE_THREADS=4` | 2.24 s | 56.0% | 21,503 → 20,954 MiB | All six runs exited 0, with 62 pipelines made, 0 refused, 0 translation errors, 0 skips and 0 XCL driver-cache loads. The 62 driver-cache filenames matched across all six. The head logged up to 30 driver slots in auto mode. The deliberately unattainable reserve exercised the combined translation/driver throttle and still completed the corpus. The baseline repeat matched the fastest head run, so the timings are inconclusive for a default-mode speedup. This covers synthetic offline compute. Large ray-tracing shaders and title startup were outside the test. On the exact head, `cargo test --release --locked --offline -p xcl --lib driver_compile_estimate_grows_with_the_dxil -- --test-threads=1` and `cargo test --release --locked --offline -p xcl --test gpu_compute_e2e offline_compute_pipeline_is_reused_by_a_second_process -- --test-threads=1` each passed 1/0/0 with no skip. The latter exercised building, reusing and repairing a synthetic compute PSO's driver blob across processes. AI use: OpenAI Codex (GPT-6) assisted with the benchmark and verification.
Decodere commented 2026-11-27 10:24:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T10:24:41Z.


Independent desktop NVIDIA verification of PR #2994 at head 82c9c69432b50217cafedec8ad530cac8b76ab2a (1 commit; exact parent & merge-base: 623d02e465a17497a757a4ce867f482b0a6c8f3b on main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (82c9c694)

Command Result
cargo test --release -p xcl --lib -- shaders::tests::driver_compile_estimate_grows_with_the_dxil --exact --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1357 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib -- shaders:: --test-threads=1 --nocapture (3 consecutive runs) 11 passed; 0 failed; 0 ignored; 1347 filtered out × 3 (0.41s, 0.40s, 0.38s — 9 executed including on-GPU RTX 4060 split_compute_program_prebuilds_and_caches_chain_pieces, stale_blob_cannot_bypass_the_offline_pipeline_cap, and driver_compile_estimate_grows_with_the_dxil; 2 expected host/env skips: pso_measurement_compiles_an_exact_synthetic_record (SKIPPED: Developer Mode off / cannot disable driver cache) and retail_pack_sample (XCL_SAMPLE_RPF unset))
cargo build --release -p xcl Clean build (1m 35s, exit 0, 0 new warnings in shaders.rs)

Paired quiet 60 s retail smoke (title: 29640639, XCL_PREPARE=0 XCL_NETWORK=0)

Exact parent & merge-base (623d02e465a17497a757a4ce867f482b0a6c8f3b, XCL_PREPARE=0 XCL_NETWORK=0, cached baseline on the same machine):

xcl-smoke v1
commit: 623d02e465a17497a757a4ce867f482b0a6c8f3b
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14010 MB

PR #2994 (82c9c69432b50217cafedec8ad530cac8b76ab2a, XCL_PREPARE=0 XCL_NETWORK=0):

xcl-smoke v1
commit: 82c9c69432b50217cafedec8ad530cac8b76ab2a
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1613 (PresentX 1613)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14020 MB

Limits of coverage

  • Directly verified the new estimate/thread-count unit test (driver_compile_estimate_grows_with_the_dxil 3/3) and the shaders:: module suite (11/11 × 3, 9 executed including on-GPU RTX 4060 Pipelines::compile paths in pipeline_cap_tests, 2 expected host/env skips).
  • Did not run a cold multi-thousand-record offline xcl shaders --precompile --pipelines throughput/paging benchmark on a 16 GB RAM host (this machine has 32 GB RAM and the PR's +44% RT pipeline / low-RAM paging numbers were not re-measured).
  • Paired 60 s retail smokes ran with XCL_PREPARE=0 (XCL_NETWORK=0), bypassing startup prepare_for_launch shader precompilation, to confirm runtime non-regression.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7215852424 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7215852424). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T10:24:41Z. --- Independent desktop NVIDIA verification of **PR #2994** at head `82c9c69432b50217cafedec8ad530cac8b76ab2a` (`1` commit; exact parent & merge-base: `623d02e465a17497a757a4ce867f482b0a6c8f3b` on `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`82c9c694`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- shaders::tests::driver_compile_estimate_grows_with_the_dxil --exact --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1357 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib -- shaders:: --test-threads=1 --nocapture` (3 consecutive runs) | `11 passed; 0 failed; 0 ignored; 1347 filtered out` × 3 (`0.41s`, `0.40s`, `0.38s` — `9` executed including on-GPU RTX 4060 `split_compute_program_prebuilds_and_caches_chain_pieces`, `stale_blob_cannot_bypass_the_offline_pipeline_cap`, and `driver_compile_estimate_grows_with_the_dxil`; `2` expected host/env skips: `pso_measurement_compiles_an_exact_synthetic_record` (`SKIPPED`: Developer Mode off / cannot disable driver cache) and `retail_pack_sample` (`XCL_SAMPLE_RPF` unset)) | | `cargo build --release -p xcl` | Clean build (`1m 35s`, exit `0`, `0` new warnings in `shaders.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`, `XCL_PREPARE=0 XCL_NETWORK=0`) Exact parent & merge-base (`623d02e465a17497a757a4ce867f482b0a6c8f3b`, `XCL_PREPARE=0 XCL_NETWORK=0`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 623d02e465a17497a757a4ce867f482b0a6c8f3b gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1587) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14010 MB ``` PR #2994 (`82c9c69432b50217cafedec8ad530cac8b76ab2a`, `XCL_PREPARE=0 XCL_NETWORK=0`): ``` xcl-smoke v1 commit: 82c9c69432b50217cafedec8ad530cac8b76ab2a gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1613 (PresentX 1613) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14020 MB ``` ### Limits of coverage - Directly verified the new estimate/thread-count unit test (`driver_compile_estimate_grows_with_the_dxil` `3/3`) and the `shaders::` module suite (`11/11` × 3, `9` executed including on-GPU RTX 4060 `Pipelines::compile` paths in `pipeline_cap_tests`, `2` expected host/env skips). - Did not run a cold multi-thousand-record offline `xcl shaders --precompile --pipelines` throughput/paging benchmark on a 16 GB RAM host (this machine has 32 GB RAM and the PR's `+44%` RT pipeline / low-RAM paging numbers were not re-measured). - Paired 60 s retail smokes ran with `XCL_PREPARE=0` (`XCL_NETWORK=0`), bypassing startup `prepare_for_launch` shader precompilation, to confirm runtime non-regression. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
mokkamokacaffe commented 2026-11-27 14:18:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mokkamokacaffe on 2026-11-27T14:18:56Z.


#2994 — bounded offline compute-pipeline A/B on RTX 4080 SUPER

Result: Both revisions compiled all 128 shaders and built all 128 GPU pipelines in every run. The timing comparison changed direction when the order was reversed. These runs do not establish a repeatable speedup or slowdown on this machine.

Tested

  • Windows 11 Pro 24H2, RTX 4080 SUPER 16 GiB, NVIDIA 617.14, Core i9-14900KF, 64 GiB RAM, DXC/DXIL 1.9.2609.5.
  • Exact parent 623d02e465a17497a757a4ce867f482b0a6c8f3b and PR head 82c9c69432b50217cafedec8ad530cac8b76ab2a. Both used clean worktrees and cargo build --release --locked -p xcl.
  • All four runs read the same 128 distinct compute records from one private local pack. Selection used seed 2994 and a 256 KiB maximum uncompressed record size.
  • Command: xcl shaders <private-sample> --precompile --pipelines --only cs --limit 128 --windows 1 --split 1. XCL_PIPELINE_THREADS and XCL_PIPELINE_RESERVE_MB were unset so each revision used its defaults.
  • Each process started with a fresh XCL cache and data directory. The system NVIDIA driver cache was preserved across runs.
Order Revision Wall time GPU pipelines made Min. available system RAM System pages read in
1 Parent 160.39 s 128 29.88 GiB 65,550
2 PR 156.72 s 128 28.59 GiB 61,690
3 PR 157.45 s 128 32.07 GiB 14,764
4 Parent 128.76 s 128 33.77 GiB 11,698

All four processes exited 0. Each reported 0 already-cached shaders, 0 translation errors, 0 skipped records, 0 refused pipelines, and 0 pipelines loaded from XCL’s driver-blob cache.

The PR took 3.67 s less than its paired parent in the forward order and 28.69 s more in the reverse order. The two PR runs were within 0.73 s of each other; the two parent runs differed by 31.63 s. System-wide page reads also fell substantially over the sequence. That counter includes activity outside XCL, so it cannot attribute the timing change to the patch or to paging by XCL.

Not tested

Low-memory behavior, title startup, time to first playable frame, or the original 16 GB machine’s ray-tracing workload. Available physical RAM stayed above 28 GiB throughout the sampled measurements. The title, shader records, paths, caches, and raw logs stayed local.

AI use

OpenAI Codex (GPT-6) prepared the bounded sample, ran the four benchmarks, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7220626691 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7220626691). Originally posted by [mokkamokacaffe](https://github.com/mokkamokacaffe) on 2026-11-27T14:18:56Z. --- ### #2994 — bounded offline compute-pipeline A/B on RTX 4080 SUPER **Result:** Both revisions compiled all 128 shaders and built all 128 GPU pipelines in every run. The timing comparison changed direction when the order was reversed. These runs do not establish a repeatable speedup or slowdown on this machine. **Tested** - Windows 11 Pro 24H2, RTX 4080 SUPER 16 GiB, NVIDIA 617.14, Core i9-14900KF, 64 GiB RAM, DXC/DXIL 1.9.2609.5. - Exact parent `623d02e465a17497a757a4ce867f482b0a6c8f3b` and PR head `82c9c69432b50217cafedec8ad530cac8b76ab2a`. Both used clean worktrees and `cargo build --release --locked -p xcl`. - All four runs read the same 128 distinct compute records from one private local pack. Selection used seed `2994` and a 256 KiB maximum uncompressed record size. - Command: `xcl shaders <private-sample> --precompile --pipelines --only cs --limit 128 --windows 1 --split 1`. `XCL_PIPELINE_THREADS` and `XCL_PIPELINE_RESERVE_MB` were unset so each revision used its defaults. - Each process started with a fresh XCL cache and data directory. The system NVIDIA driver cache was preserved across runs. | Order | Revision | Wall time | GPU pipelines made | Min. available system RAM | System pages read in | |---:|---|---:|---:|---:|---:| | 1 | Parent | 160.39 s | 128 | 29.88 GiB | 65,550 | | 2 | PR | 156.72 s | 128 | 28.59 GiB | 61,690 | | 3 | PR | 157.45 s | 128 | 32.07 GiB | 14,764 | | 4 | Parent | 128.76 s | 128 | 33.77 GiB | 11,698 | All four processes exited `0`. Each reported **0 already-cached shaders, 0 translation errors, 0 skipped records, 0 refused pipelines, and 0 pipelines loaded from XCL’s driver-blob cache**. The PR took **3.67 s less** than its paired parent in the forward order and **28.69 s more** in the reverse order. The two PR runs were within 0.73 s of each other; the two parent runs differed by 31.63 s. System-wide page reads also fell substantially over the sequence. That counter includes activity outside XCL, so it cannot attribute the timing change to the patch or to paging by XCL. **Not tested** Low-memory behavior, title startup, time to first playable frame, or the original 16 GB machine’s ray-tracing workload. Available physical RAM stayed above 28 GiB throughout the sampled measurements. The title, shader records, paths, caches, and raw logs stayed local. **AI use** OpenAI Codex (GPT-6) prepared the bounded sample, ran the four benchmarks, and drafted this report.
pickles976 commented 2026-11-27 14:41:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-27T14:41:19Z.


Focused Wine/NVIDIA verification of exact head 82c9c69432b50217cafedec8ad530cac8b76ab2a:

  • Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, 16 GiB host RAM, Rust 1.98.1, x86_64-pc-windows-msvc, release tests, DXVK_CONFIG='dxgi.hideNvidiaGpu = False'.
  • Diagnostic vkd3d-proton 3.2.0 build 2576c0b4adfae4a+ (local console-vtable assertion relaxations; not stock-vkd3d certification).
  • Fresh intended-worktree provenance: Compiling xcl v0.1.0 (.../xcl-pr2994/crates/xcl).
  • cargo test --locked --target x86_64-pc-windows-msvc --release -p xcl --lib 'shaders::' -- --nocapture --test-threads=1: 11 passed, 0 failed, 0 ignored in 1.24 s. The physical NVIDIA adapter opened for the GPU-backed paths. driver_compile_estimate_grows_with_the_dxil passed.
  • Two passing tests explicitly took their designed early-return paths: pso_measurement_compiles_an_exact_synthetic_record could not disable the driver cache because Wine returns E_NOTIMPL for the Windows Developer Mode control; retail_pack_sample had no XCL_SAMPLE_RPF configured. The other 9 tests exercised normally.

This adds focused Wine/RTX 4060 correctness coverage on a 16 GiB host. I did not run the cold multi-record parent/head throughput benchmark, so this result does not independently establish reduced paging, loading stutter, or a speedup.

<!-- greyfinch-sync:ivall/xcl:comment:7221098407 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7221098407). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T14:41:19Z. --- Focused Wine/NVIDIA verification of exact head `82c9c69432b50217cafedec8ad530cac8b76ab2a`: - Linux 6.17, Wine 11.0, RTX 4060 Laptop GPU / NVIDIA 590.48.1, 16 GiB host RAM, Rust 1.98.1, `x86_64-pc-windows-msvc`, release tests, `DXVK_CONFIG='dxgi.hideNvidiaGpu = False'`. - Diagnostic vkd3d-proton 3.2.0 build `2576c0b4adfae4a+` (local console-vtable assertion relaxations; not stock-vkd3d certification). - Fresh intended-worktree provenance: `Compiling xcl v0.1.0 (.../xcl-pr2994/crates/xcl)`. - `cargo test --locked --target x86_64-pc-windows-msvc --release -p xcl --lib 'shaders::' -- --nocapture --test-threads=1`: **11 passed, 0 failed, 0 ignored** in 1.24 s. The physical NVIDIA adapter opened for the GPU-backed paths. `driver_compile_estimate_grows_with_the_dxil` passed. - Two passing tests explicitly took their designed early-return paths: `pso_measurement_compiles_an_exact_synthetic_record` could not disable the driver cache because Wine returns `E_NOTIMPL` for the Windows Developer Mode control; `retail_pack_sample` had no `XCL_SAMPLE_RPF` configured. The other 9 tests exercised normally. This adds focused Wine/RTX 4060 correctness coverage on a 16 GiB host. I did **not** run the cold multi-record parent/head throughput benchmark, so this result does not independently establish reduced paging, loading stutter, or a speedup.
pickles976 commented 2026-11-27 15:25:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-27T15:25:28Z.


Matched offscreen follow-through on this Wine 11 / Linux 6.17 / i7-13620H / 16 GiB / RTX 4060 Laptop 8 GiB machine, NVIDIA 590.48.1. Exact production parent 623d02e465a17497a757a4ce867f482b0a6c8f3b vs head 82c9c69432b50217cafedec8ad530cac8b76ab2a; separately freshly built release executables. Diagnostic-relaxed vkd3d 2576c0b4adfae4a+, not stock compatibility certification.

The same first 128 compute records, selected with shaders --precompile --pipelines --only cs --limit 22285 --windows 1 --split 1. The limit counts all pack records: earlier smaller limits selected zero CS and are not benchmark results. Each measured leg used a new XCL DXIL cache and a new vkd3d cache directory, common executable filename, NVIDIA vendor unmasked, pipeline thread/reserve overrides unset, same 9 GiB/512 MiB scope and global guards. Driver-global/OS caches were not cleared. Order parent/head/head/parent.

Leg CLI work seconds Peak scope MiB Minimum available system RAM MiB
parent 1 88.9 2573.0 9575.3
head 1 92.7 2411.0 9708.6
head 2 90.4 2446.7 9677.7
parent 2 96.8 2471.2 9643.8

Every leg compiled 128, made 128 native PSOs, loaded 0 from the driver cache, refused 0, and exited 0. Head announces at most 14 driver compiles; shader compilation uses 15 threads. GPU peak 318 MiB throughout. The work-time ranges overlap: no robust local throughput improvement established. Head peak scope usage was lower in these two samples, but neither bounded corpus approached the scope cap. No loading frame-time/stutter or title-progress claim, and no evidence here justifying an added cgroup admission patch.

An earlier broad parent-only discovery pass reached the 9 GiB scope cap and timed out at 300 s after 225 native creations. It was not a matched completed benchmark and is not attributed to this PR. Do not extrapolate this 128-program result to that corpus.

Evidence under .compat-runtime/logs/: verify-xcl2994-parent128-20261127T151722Z, verify-xcl2994-head128-20261127T151911Z, verify-xcl2994-head128reverse-20261127T152101Z, verify-xcl2994-parent128reverse-20261127T152232Z, each with command/console/resources/result. No game assets attached. Next useful owner measurement is actual loading frame-time/compile-admission correlation on a title-safe stack, rather than inferring stutter from offline throughput.

<!-- greyfinch-sync:ivall/xcl:comment:7222039937 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7222039937). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T15:25:28Z. --- Matched offscreen follow-through on this Wine 11 / Linux 6.17 / i7-13620H / 16 GiB / RTX 4060 Laptop 8 GiB machine, NVIDIA 590.48.1. Exact production parent `623d02e465a17497a757a4ce867f482b0a6c8f3b` vs head `82c9c69432b50217cafedec8ad530cac8b76ab2a`; separately freshly built release executables. Diagnostic-relaxed vkd3d `2576c0b4adfae4a+`, not stock compatibility certification. The same first 128 compute records, selected with `shaders --precompile --pipelines --only cs --limit 22285 --windows 1 --split 1`. The limit counts all pack records: earlier smaller limits selected zero CS and are not benchmark results. Each measured leg used a new XCL DXIL cache and a new vkd3d cache directory, common executable filename, NVIDIA vendor unmasked, pipeline thread/reserve overrides unset, same 9 GiB/512 MiB scope and global guards. Driver-global/OS caches were not cleared. Order parent/head/head/parent. | Leg | CLI work seconds | Peak scope MiB | Minimum available system RAM MiB | |---|---:|---:|---:| | parent 1 | 88.9 | 2573.0 | 9575.3 | | head 1 | 92.7 | 2411.0 | 9708.6 | | head 2 | 90.4 | 2446.7 | 9677.7 | | parent 2 | 96.8 | 2471.2 | 9643.8 | Every leg compiled 128, made 128 native PSOs, loaded 0 from the driver cache, refused 0, and exited 0. Head announces at most 14 driver compiles; shader compilation uses 15 threads. GPU peak 318 MiB throughout. The work-time ranges overlap: no robust local throughput improvement established. Head peak scope usage was lower in these two samples, but neither bounded corpus approached the scope cap. No loading frame-time/stutter or title-progress claim, and no evidence here justifying an added cgroup admission patch. An earlier broad parent-only discovery pass reached the 9 GiB scope cap and timed out at 300 s after 225 native creations. It was not a matched completed benchmark and is not attributed to this PR. Do not extrapolate this 128-program result to that corpus. Evidence under `.compat-runtime/logs/`: `verify-xcl2994-parent128-20261127T151722Z`, `verify-xcl2994-head128-20261127T151911Z`, `verify-xcl2994-head128reverse-20261127T152101Z`, `verify-xcl2994-parent128reverse-20261127T152232Z`, each with command/console/resources/result. No game assets attached. Next useful owner measurement is actual loading frame-time/compile-admission correlation on a title-safe stack, rather than inferring stutter from offline throughput.
KOLESNiii commented 2026-11-27 16:35:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-27T16:35:50Z.


Cold A/B of --precompile --only cs --pipelines on an 8 GB Turing card with 32 GB RAM and a 6-core CPU, at exact parent 623d02e4 and head 82c9c694. Head: 300 pipelines in 8 minutes; parent: 225. One run per side.

Tested

  • NVIDIA GeForce RTX 2070 SUPER 8 GB (Turing, 32-lane waves), driver 621.40; AMD Ryzen 5 3600XT (6 cores / 12 threads); 32 GB RAM; Windows 11 Home build 26300; rustc 1.100.0 MSVC; DXC 1.9.2609.5; cargo build --release --locked -p xcl in two clean worktrees, each with its own target directory.
  • Command on both sides: xcl shaders <retail game>\shaders.rpf --precompile --only cs --pipelines (all 26,503 records of the pack, no --limit). The run was stopped after 480 s. XCL_RT_GATE=0 was set as in your description, but neither commit reads it. XCL_PIPELINE_THREADS and XCL_PIPELINE_RESERVE_MB were unset.
  • Each side got a new empty XCL_DXIL_CACHE (so DXIL, translations and driver blobs were all cold) and an exe name the NVIDIA driver had never seen. The global driver cache was not cleared. Order: parent, then head, 20 s apart, alone on the machine (run through our local exclusive queue). CPU is the machine-wide average over 1 s samples; available RAM is the minimum of those samples.
parent 623d02e4 head 82c9c694
driver compiles at once 4 (fixed) "up to 10 at once while 2048 MiB of physical RAM stays free"
pipelines made in 480 s (progress lines come every 25) 225 (225–249), 0 refused 300 (300–324), 0 refused
time to 100 / 200 pipelines 104 s / 356 s 54 s / 180 s
CPU, mean 68 % 99 %
available RAM, minimum 13,365 MB 12,113 MB
process private bytes, peak 9.5 GB 11.4 GB
  • With 32 GB the RAM reserve never bound: about 12 GB stayed free, as you expected for such machines. So the difference here is cores − 2 = 10 compiles at once against 4.
  • Pipelines in the same time: +20 % to +44 % (+33 % at the progress lines), with no refusals on either side.

Not tested

  • More than one run per side, or the reverse order: the 4080 SUPER report above saw the order matter on short samples.
  • A 16 GB machine, and the full pass to the end.
  • The GPU suite and smoke runs on these commits.

AI use: Claude Code (Claude Opus 5.5) built both sides, wrote the measuring script, ran it on the hardware above and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7223445831 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7223445831). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-27T16:35:50Z. --- Cold A/B of `--precompile --only cs --pipelines` on an 8 GB Turing card with 32 GB RAM and a 6-core CPU, at exact parent `623d02e4` and head `82c9c694`. **Head: 300 pipelines in 8 minutes; parent: 225.** One run per side. **Tested** - NVIDIA GeForce RTX 2070 SUPER 8 GB (Turing, 32-lane waves), driver 621.40; AMD Ryzen 5 3600XT (6 cores / 12 threads); 32 GB RAM; Windows 11 Home build 26300; rustc 1.100.0 MSVC; DXC 1.9.2609.5; `cargo build --release --locked -p xcl` in two clean worktrees, each with its own target directory. - Command on both sides: `xcl shaders <retail game>\shaders.rpf --precompile --only cs --pipelines` (all 26,503 records of the pack, no `--limit`). The run was stopped after 480 s. `XCL_RT_GATE=0` was set as in your description, but neither commit reads it. `XCL_PIPELINE_THREADS` and `XCL_PIPELINE_RESERVE_MB` were unset. - Each side got a new empty `XCL_DXIL_CACHE` (so DXIL, translations and driver blobs were all cold) and an exe name the NVIDIA driver had never seen. The global driver cache was not cleared. Order: parent, then head, 20 s apart, alone on the machine (run through our local exclusive queue). CPU is the machine-wide average over 1 s samples; available RAM is the minimum of those samples. | | parent `623d02e4` | head `82c9c694` | |---|---|---| | driver compiles at once | 4 (fixed) | "up to 10 at once while 2048 MiB of physical RAM stays free" | | pipelines made in 480 s (progress lines come every 25) | **225** (225–249), 0 refused | **300** (300–324), 0 refused | | time to 100 / 200 pipelines | 104 s / 356 s | 54 s / 180 s | | CPU, mean | 68 % | 99 % | | available RAM, minimum | 13,365 MB | 12,113 MB | | process private bytes, peak | 9.5 GB | 11.4 GB | - With 32 GB the RAM reserve never bound: about 12 GB stayed free, as you expected for such machines. So the difference here is cores − 2 = 10 compiles at once against 4. - Pipelines in the same time: +20 % to +44 % (+33 % at the progress lines), with no refusals on either side. **Not tested** - More than one run per side, or the reverse order: the 4080 SUPER report above saw the order matter on short samples. - A 16 GB machine, and the full pass to the end. - The GPU suite and smoke runs on these commits. AI use: Claude Code (Claude Opus 5.5) built both sides, wrote the measuring script, ran it on the hardware above and wrote this report.
RodrigoTorreao commented 2026-11-28 00:04:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RodrigoTorreao on 2026-11-28T00:04:07Z.


Closing: main now covers this. Since d8dae08d (#3043, offline DXIL is released after each pipeline build), main also sets the driver-compile count to min(cores, total RAM in GB / 2). On a 16 GB machine that is 8.

I rebased this PR onto 2c717a04 and kept main's count, so only the free-RAM admission was left. Then I re-ran the cold A/B on the RX 6750 XT with 16 GB RAM, 8 min per phase:

main 2c717a04 PR rebased (6e86ac04, not pushed)
translation + DXC, first 3000 records 533 s 532 s
RT phase (XCL_RT_GATE=0): free RAM min / avg 3.6 / 5.5 GB 3.9 / 5.6 GB
RT phase progress 22,800 / 26,503 22,800 / 26,503
smoke frames (60 s) 1088 1106
full suite 1465 passed, 1 failed 1466 passed, 1 failed (same failure)

Free RAM never fell under 3.6 GB on either side, so the admission almost never acts. Before, it fell to 54 MB. The +44 % this PR measured on 623d02e does not hold on today's main.

Thanks to @mokkamokacaffe, @pickles976 and @KOLESNiii for the reports.

AI-assisted (Claude Code with Claude Opus 5.5); run by me on the hardware above.

<!-- greyfinch-sync:ivall/xcl:comment:7230621265 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2994#issuecomment-7230621265). Originally posted by [RodrigoTorreao](https://github.com/RodrigoTorreao) on 2026-11-28T00:04:07Z. --- **Closing: `main` now covers this.** Since `d8dae08d` (#3043, offline DXIL is released after each pipeline build), `main` also sets the driver-compile count to min(cores, total RAM in GB / 2). On a 16 GB machine that is 8. I rebased this PR onto `2c717a04` and kept `main`'s count, so only the free-RAM admission was left. Then I re-ran the cold A/B on the RX 6750 XT with 16 GB RAM, 8 min per phase: | | main 2c717a04 | PR rebased (6e86ac04, not pushed) | |---|---|---| | translation + DXC, first 3000 records | 533 s | 532 s | | RT phase (`XCL_RT_GATE=0`): free RAM min / avg | 3.6 / 5.5 GB | 3.9 / 5.6 GB | | RT phase progress | 22,800 / 26,503 | 22,800 / 26,503 | | smoke frames (60 s) | 1088 | 1106 | | full suite | 1465 passed, 1 failed | 1466 passed, 1 failed (same failure) | Free RAM never fell under 3.6 GB on either side, so the admission almost never acts. Before, it fell to 54 MB. The +44 % this PR measured on `623d02e` does not hold on today's `main`. Thanks to @mokkamokacaffe, @pickles976 and @KOLESNiii for the reports. AI-assisted (Claude Code with Claude Opus 5.5); run by me on the hardware above.

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!2994
No description provided.