Shaders: startup preparation builds a split program's whole, not its chain #3442

Merged
KOLESNiii merged 1 commit from upstream-pr/3442 into main 2026-11-30 03:36:47 +00:00
KOLESNiii commented 2026-11-29 17:34:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T17:34:48Z.


Startup preparation compiled every split compute program's whole DXIL twice, and its pieces, although the runtime only uses the first of those builds.

Why

Where a cold full preparation's compute driver work goes (retail game, RTX 2070 SUPER). All 2,730 compute translations of the title's direct-DXIL cache, banded by the size of the whole program's DXIL. Driver time is weighted as size^1.6, the exponent fitted to 1,340 cold compiles on this card (size^1.5 to size^1.7). On main, startup preparation builds every split program three ways: whole (ABI root), every piece, and the whole again under the chain root.

whole DXIL programs split pieces unsplit whole split: whole pieces split: whole again (chain root)
< 256 KiB 1,797 107 227 2.1 % 0.2 % 0.2 % 0.2 %
256–512 KiB 185 11 60 1.8 % 0.1 % 0.1 % 0.1 %
512 KiB – 1 MiB 467 427 5,185 1.4 % 21.9 % 6.9 % 21.9 %
≥ 1 MiB 281 262 3,790 2.4 % 17.7 % 5.0 % 17.7 %
all 2,730 807 9,262 7.7 % 40.1 % 12.2 % 40.1 %
  • The ≥ 512 KiB programs are 27 % of the programs (748) and about 95 % of the compute driver work. 689 of them (92 %) are split. Only 118 of the 1,982 smaller programs (6 %) are split.
  • The pieces and the second whole build make up about 52 % of the work (51–53 % for size^1.5 to size^1.7), nearly all of it in the 689 large split programs. These are the parts the runtime does not use once the whole program's blob loads.
  • This is a model weighting, not a timed run. Graphics programs are not included; on this title they were 100 s of a 209-minute full preparation.

Script and data: bands.py over the translated cache, with the per-band results for size^1.5, ^1.6 and ^1.7; more context in https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7262349510.

The mandatory path (Pipelines::prepare_compiled_compute: xcl run's startup preparation and its workers, also the PSO corpus and milestones) built, for every program that direct translation split into a dispatch chain:

  1. the whole DXIL under the ABI root (.pso),
  2. every piece under the chain root(s) (.chain.pso),
  3. the whole DXIL again under each chain root (.chain.pso).

Since ec80c071 the runtime first loads the ABI whole blob (CachedWhole in translated_compute_pso_once). When that blob loads, it builds no chain, so 2. and 3. were never used. A chain's own whole is still built lazily by the runtime if a chain ever needs it. In a cold full preparation of a retail game, size-weighted, the chain-root wholes are ~40 % of the compute driver work and the pieces ~12 %: ~52 % in all (see Why below).

Now the whole is built first, and the chain only when the runtime would not find the whole (chain_needed): when the whole was refused or over XCL_PIPELINE_MAX_KB, or its driver blob is not on disk. In that case the pieces are built as before, and the record counts as prepared once they are. The chain-root whole is not tried then, because it is the same DXIL under another root and would fail the same way. The non-mandatory --pipelines path (make_selected) is unchanged.

What is in it

  • crates/xcl/src/shaders.rs:
    • prepare_compiled_compute builds the whole first;
    • chain_needed makes the decision; whole_blob_path gives the blob path the runtime loads;
    • tests: a_split_programs_chain_is_prepared_only_without_its_whole (the decision); startup_preparation_builds_a_split_programs_whole_and_no_chain (GPU). With the whole kept, preparation writes exactly the whole .pso, for direct and indirect prewarm alike. With the whole over the cap, it writes exactly the pieces' .chain.pso.
  • crates/xcl/tests/gpu_compute_e2e.rs: a_preparation_worker_also_builds_a_split_programs_whole_form (#2794) asserted the old behaviour, the worker's piece blobs besides the whole. It is replaced by @andrewDoing's a_preparation_worker_keeps_a_split_programs_abi_whole, which:
    • shows the program splits into ≥ 2 pieces;
    • checks the worker writes exactly that program's ABI whole .pso;
    • checks a warm worker run makes no fresh pipeline;
    • then, in a fresh process, has the runtime load that blob, choose the ABI root and dispatch it, with all 32 output lanes and the guard values correct. So the steady state (CachedWhole) is tested from a prepared blob.
  • README.md: one sentence on what startup preparation builds for split programs.

Tested

  • NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, Windows 11 Home build 26300, rustc 1.100.1, debug.

  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 on 30122062 (debug): 2739 passed, 0 failed, 49 ignored (41 test binaries).

  • SKIPPED on this adapter (28), the same kinds as on the earlier head: no wave64 (most of them), f16/f32 per-lane forms refused, no heap windows (opt-in XCL_HEAP_WINDOWS=1), no GPU_UPLOAD heaps.

  • cargo test -p xcl --test gpu_compute_e2e -- --test-threads=1 on 30122062: 9 passed, 0 failed, 0 ignored; 1 SKIPPED (heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows). @andrewDoing's a_preparation_worker_keeps_a_split_programs_abi_whole passed.

  • cargo test -p xcl --lib shaders::pipeline_cap_tests:: -- --test-threads=1: 7 passed, 0 failed, 0 ignored, no SKIPPED.

  • The new GPU test fails without the fix (main's prepare_compiled_compute body put back). It finds the whole .pso, two piece .chain.pso files and the chain-root whole .chain.pso, where it expects only the whole .pso.

  • Cold mandatory preparation (xcl shaders <pack> --precompile --only cs --pipelines --records <6 records> with XCL_PRECOMPILE_PARENT set, the path xcl run's preparation workers take) of 6 records of a retail game, each side into a new, empty XCL_DXIL_CACHE, release builds. Records: 5 split programs (each a ~1.39 MB whole and 18 pieces) and 1 unsplit program as a control.

    driver blobs written blob bytes wall time (driver shader cache on, warm for these programs)
    main 0fe06eb0 101: 6 .pso, 95 .chain.pso 33.1 MB 127.6 s
    this head f1574257 6: 6 .pso, 0 .chain.pso 11.2 MB 60.2 s

    On main, each split program got the whole, 18 pieces and the whole again (5 × 19 = 95 .chain.pso). Here each record gets one .pso. The wall times are not cold times: the NVIDIA driver's own shader cache was on and already held these programs from an earlier full preparation (6 wholes in 60 s is well under 6 × ~34 s cold). The claim rests on the counts (101 → 6 driver builds, 33.1 → 11.2 MB of blobs) and on the cold cost of an avoided whole below.

  • What one avoided chain-root whole costs, measured on main with the driver's shader caches turned off (xcl shaders --measure-pso 2e1d03fbed9d95eb --repeat 1, ShaderCacheControl, one compile at a time): 33.9 s for a 1,387,508-byte whole. Under 12-way preparation, the pieces plus the chain-root whole finished a median of 428 s after the ABI whole, for programs of ≥ 1 MiB.

Regression run

main (0fe06eb0):

xcl-smoke v1
commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1263 (PresentX 1263)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15283 MB

this PR's head (30122062):

xcl-smoke v1
commit: 301220626a767a85cee4ae10684961200f7fc313
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1528 (PresentX 1528)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 17831 MB

Both: scripts/smoke.ps1 -Seconds 60, XCL_PREPARE=0, XCL_PRESS_AT=25:A, release builds, run through the local exclusive queue. With preparation off, these runs check that nothing else breaks; they do not run the changed preparation path.

Note: #3219 (test-only) asserts the old set of files that preparation writes. Whichever of the two merges second needs its test updated.

Not tested

  • Startup preparation itself in the smoke runs (XCL_PREPARE=0), and a warm xcl run after a full preparation, which would show compute split: 0 programs split for the prepared records. A full preparation takes hours here.
  • AMD and Intel GPUs.
  • When a runtime rejects the whole blob (driver update, root signature mismatch), the pieces are now built cold in the background at runtime, as in a run without preparation.
  • Two preparation workers with the same whole DXIL: the one without the claim builds it without keeping the blob, so it also builds the chain. That is extra work, not a missing pipeline, and it is rare.

AI use

  • Claude Code, Claude Opus 5.5: the code, the unit and GPU tests in shaders.rs, and this description. The investigation that found the double build was Claude Code, Claude Opus 5.5 as well.
  • a_preparation_worker_keeps_a_split_programs_abi_whole: written by @andrewDoing with OpenAI Codex (GPT-6.2 Sol). Taken in unchanged and co-authored in the commit.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5553290279 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T17:34:48Z. --- Startup preparation compiled every split compute program's whole DXIL twice, and its pieces, although the runtime only uses the first of those builds. **Why** **Where a cold full preparation's compute driver work goes (retail game, RTX 2070 SUPER).** All 2,730 compute translations of the title's direct-DXIL cache, banded by the size of the whole program's DXIL. Driver time is weighted as size^1.6, the exponent fitted to 1,340 cold compiles on this card (size^1.5 to size^1.7). On `main`, startup preparation builds every split program three ways: whole (ABI root), every piece, and the whole again under the chain root. | whole DXIL | programs | split | pieces | unsplit whole | split: whole | pieces | split: whole again (chain root) | |---|---|---|---|---|---|---|---| | < 256 KiB | 1,797 | 107 | 227 | 2.1 % | 0.2 % | 0.2 % | 0.2 % | | 256–512 KiB | 185 | 11 | 60 | 1.8 % | 0.1 % | 0.1 % | 0.1 % | | 512 KiB – 1 MiB | 467 | 427 | 5,185 | 1.4 % | 21.9 % | 6.9 % | 21.9 % | | ≥ 1 MiB | 281 | 262 | 3,790 | 2.4 % | 17.7 % | 5.0 % | 17.7 % | | **all** | **2,730** | **807** | **9,262** | **7.7 %** | **40.1 %** | **12.2 %** | **40.1 %** | - The ≥ 512 KiB programs are 27 % of the programs (748) and about 95 % of the compute driver work. 689 of them (92 %) are split. Only 118 of the 1,982 smaller programs (6 %) are split. - The pieces and the second whole build make up about 52 % of the work (51–53 % for size^1.5 to size^1.7), nearly all of it in the 689 large split programs. These are the parts the runtime does not use once the whole program's blob loads. - This is a model weighting, not a timed run. Graphics programs are not included; on this title they were 100 s of a 209-minute full preparation. Script and data: `bands.py` over the translated cache, with the per-band results for size^1.5, ^1.6 and ^1.7; more context in https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7262349510. The mandatory path (`Pipelines::prepare_compiled_compute`: `xcl run`'s startup preparation and its workers, also the PSO corpus and milestones) built, for every program that direct translation split into a dispatch chain: 1. the whole DXIL under the ABI root (`.pso`), 2. every piece under the chain root(s) (`.chain.pso`), 3. the whole DXIL **again** under each chain root (`.chain.pso`). Since ec80c071 the runtime first loads the ABI whole blob (`CachedWhole` in `translated_compute_pso_once`). When that blob loads, it builds no chain, so 2. and 3. were never used. A chain's own whole is still built lazily by the runtime if a chain ever needs it. In a cold full preparation of a retail game, size-weighted, the chain-root wholes are ~40 % of the compute driver work and the pieces ~12 %: ~52 % in all (see **Why** below). Now the whole is built first, and the chain only when the runtime would not find the whole (`chain_needed`): when the whole was refused or over `XCL_PIPELINE_MAX_KB`, or its driver blob is not on disk. In that case the pieces are built as before, and the record counts as prepared once they are. The chain-root whole is not tried then, because it is the same DXIL under another root and would fail the same way. The non-mandatory `--pipelines` path (`make_selected`) is unchanged. **What is in it** - `crates/xcl/src/shaders.rs`: - `prepare_compiled_compute` builds the whole first; - `chain_needed` makes the decision; `whole_blob_path` gives the blob path the runtime loads; - tests: `a_split_programs_chain_is_prepared_only_without_its_whole` (the decision); `startup_preparation_builds_a_split_programs_whole_and_no_chain` (GPU). With the whole kept, preparation writes exactly the whole `.pso`, for direct and indirect prewarm alike. With the whole over the cap, it writes exactly the pieces' `.chain.pso`. - `crates/xcl/tests/gpu_compute_e2e.rs`: `a_preparation_worker_also_builds_a_split_programs_whole_form` (#2794) asserted the old behaviour, the worker's piece blobs besides the whole. It is replaced by @andrewDoing's `a_preparation_worker_keeps_a_split_programs_abi_whole`, which: - shows the program splits into ≥ 2 pieces; - checks the worker writes exactly that program's ABI whole `.pso`; - checks a warm worker run makes no fresh pipeline; - then, in a fresh process, has the runtime load that blob, choose the ABI root and dispatch it, with all 32 output lanes and the guard values correct. So the steady state (`CachedWhole`) is tested from a prepared blob. - `README.md`: one sentence on what startup preparation builds for split programs. **Tested** - NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, Windows 11 Home build 26300, rustc 1.100.1, debug. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4` on 30122062 (debug): 2739 passed, 0 failed, 49 ignored (41 test binaries). - `SKIPPED` on this adapter (28), the same kinds as on the earlier head: no wave64 (most of them), f16/f32 per-lane forms refused, no heap windows (opt-in `XCL_HEAP_WINDOWS=1`), no GPU_UPLOAD heaps. - `cargo test -p xcl --test gpu_compute_e2e -- --test-threads=1` on 30122062: 9 passed, 0 failed, 0 ignored; 1 SKIPPED (`heap_window_out_of_memory_falls_back_to_the_switch_form`: no heap windows). @andrewDoing's `a_preparation_worker_keeps_a_split_programs_abi_whole` passed. - `cargo test -p xcl --lib shaders::pipeline_cap_tests:: -- --test-threads=1`: 7 passed, 0 failed, 0 ignored, no SKIPPED. - The new GPU test fails without the fix (main's `prepare_compiled_compute` body put back). It finds the whole `.pso`, two piece `.chain.pso` files and the chain-root whole `.chain.pso`, where it expects only the whole `.pso`. - Cold mandatory preparation (`xcl shaders <pack> --precompile --only cs --pipelines --records <6 records>` with `XCL_PRECOMPILE_PARENT` set, the path `xcl run`'s preparation workers take) of 6 records of a retail game, each side into a new, empty `XCL_DXIL_CACHE`, release builds. Records: 5 split programs (each a ~1.39 MB whole and 18 pieces) and 1 unsplit program as a control. | | driver blobs written | blob bytes | wall time (driver shader cache on, warm for these programs) | |---|---|---|---| | main 0fe06eb0 | 101: 6 `.pso`, 95 `.chain.pso` | 33.1 MB | 127.6 s | | this head f1574257 | 6: 6 `.pso`, 0 `.chain.pso` | 11.2 MB | 60.2 s | On main, each split program got the whole, 18 pieces and the whole again (5 × 19 = 95 `.chain.pso`). Here each record gets one `.pso`. The wall times are not cold times: the NVIDIA driver's own shader cache was on and already held these programs from an earlier full preparation (6 wholes in 60 s is well under 6 × ~34 s cold). The claim rests on the counts (101 → 6 driver builds, 33.1 → 11.2 MB of blobs) and on the cold cost of an avoided whole below. - What one avoided chain-root whole costs, measured on main with the driver's shader caches turned off (`xcl shaders --measure-pso 2e1d03fbed9d95eb --repeat 1`, `ShaderCacheControl`, one compile at a time): 33.9 s for a 1,387,508-byte whole. Under 12-way preparation, the pieces plus the chain-root whole finished a median of 428 s after the ABI whole, for programs of ≥ 1 MiB. **Regression run** main (0fe06eb0): ``` xcl-smoke v1 commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1263 (PresentX 1263) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15283 MB ``` this PR's head (30122062): ``` xcl-smoke v1 commit: 301220626a767a85cee4ae10684961200f7fc313 gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1528 (PresentX 1528) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 17831 MB ``` Both: `scripts/smoke.ps1 -Seconds 60`, `XCL_PREPARE=0`, `XCL_PRESS_AT=25:A`, release builds, run through the local exclusive queue. With preparation off, these runs check that nothing else breaks; they do not run the changed preparation path. **Note:** #3219 (test-only) asserts the old set of files that preparation writes. Whichever of the two merges second needs its test updated. **Not tested** - Startup preparation itself in the smoke runs (`XCL_PREPARE=0`), and a warm `xcl run` after a full preparation, which would show `compute split: 0 programs split` for the prepared records. A full preparation takes hours here. - AMD and Intel GPUs. - When a runtime rejects the whole blob (driver update, root signature mismatch), the pieces are now built cold in the background at runtime, as in a run without preparation. - Two preparation workers with the same whole DXIL: the one without the claim builds it without keeping the blob, so it also builds the chain. That is extra work, not a missing pipeline, and it is rare. **AI use** - Claude Code, Claude Opus 5.5: the code, the unit and GPU tests in `shaders.rs`, and this description. The investigation that found the double build was Claude Code, Claude Opus 5.5 as well. - `a_preparation_worker_keeps_a_split_programs_abi_whole`: written by @andrewDoing with OpenAI Codex (GPT-6.2 Sol). Taken in unchanged and co-authored in the commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
KOLESNiii commented 2026-11-29 17:36:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T17:36:54Z.


Test results wanted. This PR should cut the driver work of a cold shader preparation. Each split compute program now gets one driver compile, not 2 + its pieces. I can only measure it on one NVIDIA card here, and the NVIDIA driver's own shader cache makes a "cold" run less cold than it looks. Runs on other GPUs, especially AMD and Intel, would help most.

What to run (on your own game dump; the same title, settings and machine for both sides):

  1. Build main and this PR's head (cargo build --release -p xcl), and note both commits.
  2. For each side, start the game once with a new, empty XCL_DXIL_CACHE folder, so preparation is cold for XCL. Use a new folder per side; there is no need to delete your existing cache:
    $env:XCL_DXIL_CACHE = 'D:\xcl-cache-test\main'   # ...\pr for the other side
    $env:XCL_ACTIVITY = '1'
    .\target\release\xcl.exe run '<game folder>'
    
    Let preparation finish, then play a minute or so.
  3. Start the game a second time with the same cache folder (the warm run).

What to report for each side:

  • the commit, GPU and driver version, CPU and RAM;
  • from xcl.log of the cold run: the Shader preparation: compute pipelines done in N s line;
  • the number of files in <XCL_DXIL_CACHE>\driver by kind: *.pso that are not *chain.pso, *.chain.pso, *.indirect-chain.pso. This counts them in PowerShell:
    $d = Get-ChildItem "$env:XCL_DXIL_CACHE\driver" -File
    "pso $(@($d | ? { $_.Name -like '*.pso' -and $_.Name -notlike '*chain.pso' }).Count)  chain $(@($d | ? Name -like '*.chain.pso').Count)  indirect $(@($d | ? Name -like '*.indirect-chain.pso').Count)  bytes $(($d | Measure-Object Length -Sum).Sum)"
    
  • from xcl.log of the warm run: the last compute split: N programs split, ... line, if there is one;
  • anything that broke: a device removal, a crash, or a missing or wrong-looking effect.

Expected: the PR's side writes fewer .chain.pso files and finishes preparation sooner, and the warm runs look the same on both sides. A cold preparation can take a long time; if you stop one early, say when.

Please post one comment and edit it if you rerun (see CONTRIBUTING, "Reviews and test reports").

Written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7259828831 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7259828831). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T17:36:54Z. --- **Test results wanted.** This PR should cut the driver work of a cold shader preparation. Each split compute program now gets one driver compile, not 2 + its pieces. I can only measure it on one NVIDIA card here, and the NVIDIA driver's own shader cache makes a "cold" run less cold than it looks. Runs on other GPUs, especially AMD and Intel, would help most. **What to run** (on your own game dump; the same title, settings and machine for both sides): 1. Build `main` and this PR's head (`cargo build --release -p xcl`), and note both commits. 2. For each side, start the game once with a **new, empty** `XCL_DXIL_CACHE` folder, so preparation is cold for XCL. Use a new folder per side; there is no need to delete your existing cache: ```powershell $env:XCL_DXIL_CACHE = 'D:\xcl-cache-test\main' # ...\pr for the other side $env:XCL_ACTIVITY = '1' .\target\release\xcl.exe run '<game folder>' ``` Let preparation finish, then play a minute or so. 3. Start the game a second time with the same cache folder (the warm run). **What to report** for each side: - the commit, GPU and driver version, CPU and RAM; - from `xcl.log` of the cold run: the `Shader preparation: compute pipelines done in N s` line; - the number of files in `<XCL_DXIL_CACHE>\driver` by kind: `*.pso` that are not `*chain.pso`, `*.chain.pso`, `*.indirect-chain.pso`. This counts them in PowerShell: ```powershell $d = Get-ChildItem "$env:XCL_DXIL_CACHE\driver" -File "pso $(@($d | ? { $_.Name -like '*.pso' -and $_.Name -notlike '*chain.pso' }).Count) chain $(@($d | ? Name -like '*.chain.pso').Count) indirect $(@($d | ? Name -like '*.indirect-chain.pso').Count) bytes $(($d | Measure-Object Length -Sum).Sum)" ``` - from `xcl.log` of the warm run: the last `compute split: N programs split, ...` line, if there is one; - anything that broke: a device removal, a crash, or a missing or wrong-looking effect. Expected: the PR's side writes fewer `.chain.pso` files and finishes preparation sooner, and the warm runs look the same on both sides. A cold preparation can take a long time; if you stop one early, say when. Please post one comment and edit it if you rerun (see CONTRIBUTING, "Reviews and test reports"). _Written with Claude Code (Claude Opus 5.5)._
andrewDoing commented 2026-11-29 17:47:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T17:47:54Z.


The stock integration test a_preparation_worker_also_builds_a_split_programs_whole_form fails on f1574257 because it still requires chain files. The worker succeeded and left one ABI .pso, with one fresh GPU pipeline creation and zero refusals. The exact-key assertions in #3219 also fail when applied on top, since they expect the old startup artifact set.

I put a one-file test update on our fork. It checks the exact single ABI .pso from a genuinely split DXIL program, runs the startup worker again with zero fresh GPU pipeline creations, then opens the cache in another runtime process. The runtime selects the ABI root and dispatches correctly, including all 32 expected output lanes and the untouched guard values. The worker uses the runtime’s memory-window count. An earlier one-window probe could not hit the four-window runtime key. Integration-test commit

On RTX 5070 (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, Rust 1.100.0 MSVC and DXC 1.8.2502.11, the complete gpu_compute_e2e target reported 9 passed, zero failed, and one explicit skip for opt-in heap windows. The three focused worker and offline-cache tests passed with zero skips. The revised worker test failed as intended on main 0fe06eb0, where the same synthetic fixture made and saved seven fresh pipelines. The run covers native GPU cache behavior on this fixture. Retail preparation time and gameplay remain unmeasured.

Codex with GPT-6.2 Sol implemented the integration test update and ran the checks.

<!-- greyfinch-sync:ivall/xcl:comment:7259972622 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7259972622). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-29T17:47:54Z. --- The stock integration test `a_preparation_worker_also_builds_a_split_programs_whole_form` fails on `f1574257` because it still requires chain files. The worker succeeded and left one ABI `.pso`, with one fresh GPU pipeline creation and zero refusals. The exact-key assertions in #3219 also fail when applied on top, since they expect the old startup artifact set. I put a one-file test update on our fork. It checks the exact single ABI `.pso` from a genuinely split DXIL program, runs the startup worker again with zero fresh GPU pipeline creations, then opens the cache in another runtime process. The runtime selects the ABI root and dispatches correctly, including all 32 expected output lanes and the untouched guard values. The worker uses the runtime’s memory-window count. An earlier one-window probe could not hit the four-window runtime key. [Integration-test commit](https://github.com/andrewDoing/xcl/commit/96f817920cc047fc2722fedf19bebf853e823579) On RTX 5070 (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, Rust 1.100.0 MSVC and DXC 1.8.2502.11, the complete `gpu_compute_e2e` target reported 9 passed, zero failed, and one explicit skip for opt-in heap windows. The three focused worker and offline-cache tests passed with zero skips. The revised worker test failed as intended on main `0fe06eb0`, where the same synthetic fixture made and saved seven fresh pipelines. The run covers native GPU cache behavior on this fixture. Retail preparation time and gameplay remain unmeasured. Codex with GPT-6.2 Sol implemented the integration test update and ran the checks.
KOLESNiii commented 2026-11-29 20:55:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T20:55:05Z.


Thanks @andrewDoing, that's a better test than mine.

  • The failure you saw on f1574257 was fixed in 178241b7, which only changed that test's counts to expect the whole and no pieces. On 178241b7 (RTX 2070 SUPER, driver 621.40): cargo test --workspace --no-fail-fast -- --test-threads=4 gave 2739 passed, 0 failed, 49 ignored, with 28 SKIPPED (22 no wave64).
  • Your a_preparation_worker_keeps_a_split_programs_abi_whole replaces it, unchanged, at 30122062. It's squashed into the PR's one commit with you as co-author, and the description credits your Codex (GPT-6.2 Sol) use. The runtime dispatch from the prepared blob is the evidence this PR was missing for "steady state unchanged".
  • The gpu_compute_e2e target, the whole suite and the smoke run on 30122062 are queued here. I'll update the description with those counts when they're done.
  • #3219: as you found, its exact-key assertions expect the old set of files that preparation writes. Whichever of the two merges second needs its test updated.

AI use: Claude Code (Claude Opus 5.5) drafted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7262459445 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7262459445). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T20:55:05Z. --- Thanks @andrewDoing, that's a better test than mine. - The failure you saw on f1574257 was fixed in 178241b7, which only changed that test's counts to expect the whole and no pieces. On 178241b7 (RTX 2070 SUPER, driver 621.40): `cargo test --workspace --no-fail-fast -- --test-threads=4` gave 2739 passed, 0 failed, 49 ignored, with 28 SKIPPED (22 no wave64). - Your `a_preparation_worker_keeps_a_split_programs_abi_whole` replaces it, unchanged, at 30122062. It's squashed into the PR's one commit with you as co-author, and the description credits your Codex (GPT-6.2 Sol) use. The runtime dispatch from the prepared blob is the evidence this PR was missing for "steady state unchanged". - The `gpu_compute_e2e` target, the whole suite and the smoke run on 30122062 are queued here. I'll update the description with those counts when they're done. - #3219: as you found, its exact-key assertions expect the old set of files that preparation writes. Whichever of the two merges second needs its test updated. _AI use: Claude Code (Claude Opus 5.5) drafted this reply._
dudenudem commented 2026-11-29 21:25:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dudenudem on 2026-11-29T21:25:57Z.


Test report: split-program preparation A/B on Linux/Wine + vkd3d-proton (AMD) — extra data point, not a merge check

Setup. Our tree is a Linux/Wine stack (main 0fe06eb0 + your cache work 1bd9cee1 + a port of #3455), so the driver is vkd3d-proton 3.1.0 on RADV, not amdxc64. A = our main e9e608fc (pre-port); B = ff221653, the clean cherry-pick of 178241b7 (author preserved) plus one test of ours. AMD Radeon RX 7900 XTX (RADV NAVI31, Mesa 26.3.1), Vulkan 1.4.363, Wine GE-Proton11-14, rustc 1.96.1, DXC 1.9.0.1. Six records (5 split + 1 unsplit control), XCL_SPLIT_WAVE64=1, one pipeline thread, WARP, a fresh XCL_DXIL_CACHE and a fresh vkd3d pipeline cache per side, --precompile --only cs --pipelines --records.

side rc wall .pso .chain.pso .indirect-chain.pso bytes
A e9e608fc 5 (vkd3d page fault) 25.0 s 6 5 (partial) 0 1232
B ff221653 0 24.9 s 6 0 0 672

B matches your claim: one ABI .pso per record when the whole fits, no chain-root whole, no pieces. A is cut short by the driver: on this stack, building the split-protocol piece DXIL faults vkd3d-proton at 0x110, so its 5 partial .chain.pso are not the full set it would write on a working driver. That also means B avoids a driver crash A hits here — a side effect worth knowing, though it says nothing about Windows drivers.

What we could not complete on this driver: the over-cap branch (pieces instead of the whole; the decision test covers the policy), and the runtime fallback execution. Your "not tested" item — a runtime that rejects the whole blob — we took seriously: we extended recorded_split_selects_cached_whole_or_pieces (hle/d3d12x/real.rs) so a miss/stale selection runs the registered chain plan and asserts its memory result equals the whole program's. It compiles and is skipped with a reason unless XCL_SAMPLE_RUNTIME_COMPUTE is set; running it needs a driver where the split-protocol piece DXIL builds. Simple DXC pieces with the chain root signature do build on WARP (split_compute_program_prebuilds_and_caches_chain_pieces), so the failure is specific to that piece DXIL, not the root signature.

How our tree differs from main (mostly orthogonal to this PR): it is the curated Linux stack with a ported HLE layer; translator deltas (watertight BVH, a barrier proof that lowers proven-uniform CS barriers, CLAMP/OMOD/DX9 multiply, #3455 cherry-picked as 9791e7db); a bounded preparation with persisted refusal hashes and HLSL routing for records that fault the driver; and your cache architecture (#3445-#3450) merged, so both sides share the receipt-v2 identity model. Preparation completion differences on this machine should be read against that, not against this PR.

Not tested here: the Windows suite (per the queue's rule a Wine run is an extra data point, not a merge check), NVIDIA/Intel, a full retail preparation, and the GPU over-cap path.

AI use: omp harness with nanogpt/deepseek/deepseek-v4.1-flash-1017; subagents ran the builds and the A/B on the machine above. No game data is included.

<!-- greyfinch-sync:ivall/xcl:comment:7262870588 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7262870588). Originally posted by [dudenudem](https://github.com/dudenudem) on 2026-11-29T21:25:57Z. --- Test report: split-program preparation A/B on Linux/Wine + vkd3d-proton (AMD) — extra data point, not a merge check **Setup.** Our tree is a Linux/Wine stack (main `0fe06eb0` + your cache work `1bd9cee1` + a port of #3455), so the driver is vkd3d-proton 3.1.0 on RADV, not amdxc64. A = our main `e9e608fc` (pre-port); B = `ff221653`, the clean cherry-pick of `178241b7` (author preserved) plus one test of ours. AMD Radeon RX 7900 XTX (RADV NAVI31, Mesa 26.3.1), Vulkan 1.4.363, Wine GE-Proton11-14, rustc 1.96.1, DXC 1.9.0.1. Six records (5 split + 1 unsplit control), `XCL_SPLIT_WAVE64=1`, one pipeline thread, WARP, a fresh `XCL_DXIL_CACHE` and a fresh vkd3d pipeline cache per side, `--precompile --only cs --pipelines --records`. | side | rc | wall | `.pso` | `.chain.pso` | `.indirect-chain.pso` | bytes | |---|---|---|---|---|---|---| | A `e9e608fc` | 5 (vkd3d page fault) | 25.0 s | 6 | 5 (partial) | 0 | 1232 | | B `ff221653` | 0 | 24.9 s | 6 | 0 | 0 | 672 | B matches your claim: one ABI `.pso` per record when the whole fits, no chain-root whole, no pieces. A is cut short by the driver: on this stack, building the split-protocol piece DXIL faults vkd3d-proton at `0x110`, so its 5 partial `.chain.pso` are not the full set it would write on a working driver. That also means B avoids a driver crash A hits here — a side effect worth knowing, though it says nothing about Windows drivers. **What we could not complete on this driver:** the over-cap branch (pieces instead of the whole; the decision test covers the policy), and the runtime fallback execution. Your "not tested" item — a runtime that rejects the whole blob — we took seriously: we extended `recorded_split_selects_cached_whole_or_pieces` (`hle/d3d12x/real.rs`) so a miss/stale selection runs the registered chain plan and asserts its memory result equals the whole program's. It compiles and is skipped with a reason unless `XCL_SAMPLE_RUNTIME_COMPUTE` is set; running it needs a driver where the split-protocol piece DXIL builds. Simple DXC pieces with the chain root signature do build on WARP (`split_compute_program_prebuilds_and_caches_chain_pieces`), so the failure is specific to that piece DXIL, not the root signature. **How our tree differs from main** (mostly orthogonal to this PR): it is the curated Linux stack with a ported HLE layer; translator deltas (watertight BVH, a barrier proof that lowers proven-uniform CS barriers, CLAMP/OMOD/DX9 multiply, #3455 cherry-picked as `9791e7db`); a bounded preparation with persisted refusal hashes and HLSL routing for records that fault the driver; and your cache architecture (#3445-#3450) merged, so both sides share the receipt-v2 identity model. Preparation completion differences on this machine should be read against that, not against this PR. **Not tested here:** the Windows suite (per the queue's rule a Wine run is an extra data point, not a merge check), NVIDIA/Intel, a full retail preparation, and the GPU over-cap path. AI use: omp harness with nanogpt/deepseek/deepseek-v4.1-flash-1017; subagents ran the builds and the A/B on the machine above. No game data is included.
KOLESNiii commented 2026-11-29 21:42:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T21:42:52Z.


Test report: full startup shader preparation, cold cache, with #3442 + the #3263 stack + the #3269 stack together

One run of a build that combines these three PRs. It shows what they do together; it does not say how much each one contributes.

Build: a96b183c, local merge of 4465c886 (main 3b6a91ed + #3318 #3321 #3323 #3325 #3328 #3330 #3332 #3336 #3364 #3377 + #3241 + #3242) with:

cargo build --release -p xcl. Also set: XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1 (stands in for #2428, which does not merge onto this set).

This PR in the build: 4511c6e5 (cherry-picked; the head is now 30122062, which differs).

Run: retail game, XCL_PREPARE_ALL=1 (all 26,503 records), XCL_RUN_SECONDS=180 (ends 180 s after the title starts), XCL_ACTIVITY=1. Cold XCL cache: XCL_DXIL_CACHE pointed at a new, empty folder, so no translation, DXC output or driver blob was reused.

Compared with: the same retail game and settings on 4465c886 alone (the base above, without the three PRs and without the heap switches), run earlier today with a warm cache: it started with 48,305 translations, 44,556 DXIL files and 13,051 driver blobs, and reused about half of its driver blobs.

base 4465c886, warm cache + #3442 + #3263 stack + #3269 stack, cold cache
translation + DXC (26,503 records) 1,353 s 1,619 s
driver compute pipelines 10,868 s 3,413 s
graphics pipelines 374 in ~80 s 391 in 100 s
title first presents 12,326 s (3 h 25 min) 5,141 s (1 h 26 min)
driver blobs made 12,304 new (25,355 in cache) 3,277
failed / fallback pipelines, crash 0 / 0 / none 0 / 0 / none
frames in the 180 s of play 5,104 3,818
  • Preparation finished 2.4× sooner even though the base was given the warm cache. Nearly all of the saving is in the driver's compute pipelines (3.2× shorter), the long tail where the very large compute programs are compiled.
  • The run made far fewer distinct driver pipelines (3,277 blobs against 25,355), which fits shorter, more compact programs reaching the driver.
  • Frames in play were 25 % lower (3,818 against 5,104). One 180 s run per side, with different builds, the heap switches on and the game possibly at a different point, so this is not a measured regression, but it needs a matched check (smoke on main and on this PR's head) before anyone reads the preparation result as free.

Graph. Progress of every full preparation run on this PC. This build is the solid blue line, the base the dashed pink one; in the lower panel blue reaches 100 % at ~1.4 h, pink at ~3.4 h. Data and script: CSVs + plot.py.

Shader preparation progress over time

Not tested / limits

  • Each PR on its own; the share of #3442 against the two stacks is unknown.
  • The commits tested are not all current heads: #3263's head is the one tested; #3442 (now 30122062) and #3269 (now e01151a2, with #3268 now 64f666c0) have changed since, so this report is for the commits listed above.
  • NVIDIA's own shader cache was left on for the cold run (the base run had it on too).
  • One run per side; RTX 2070 SUPER only (wave32). Not tested on AMD.

Hardware: NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, 32 GB, Windows 11 Home build 26300, rustc 1.100.1.

Tool and model: Claude Code (Claude Opus 5.5): two sessions on this machine ran the queued runs; this one extracted the numbers from their logs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7263092023 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7263092023). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-29T21:42:52Z. --- **Test report: full startup shader preparation, cold cache, with #3442 + the #3263 stack + the #3269 stack together** One run of a build that combines these three PRs. It shows what they do **together**; it does not say how much each one contributes. **Build:** `a96b183c`, local merge of 4465c886 (main 3b6a91ed + #3318 #3321 #3323 #3325 #3328 #3330 #3332 #3336 #3364 #3377 + #3241 + #3242) with: - #3442 as `4511c6e5`; - #3263 stack (#3250 `e13ccd7f`, #3261 `16f2f5c1`, #3263 `e618b742`); - #3269 stack (#3266 `a343eafc`, #3268 `527a8b26`, #3269 `4a8217a7`). `cargo build --release -p xcl`. Also set: `XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1` (stands in for #2428, which does not merge onto this set). **This PR in the build:** `4511c6e5` (cherry-picked; the head is now `30122062`, which differs). **Run:** retail game, `XCL_PREPARE_ALL=1` (all 26,503 records), `XCL_RUN_SECONDS=180` (ends 180 s after the title starts), `XCL_ACTIVITY=1`. **Cold XCL cache:** `XCL_DXIL_CACHE` pointed at a new, empty folder, so no translation, DXC output or driver blob was reused. **Compared with:** the same retail game and settings on 4465c886 alone (the base above, without the three PRs and without the heap switches), run earlier today with a **warm** cache: it started with 48,305 translations, 44,556 DXIL files and 13,051 driver blobs, and reused about half of its driver blobs. | | base 4465c886, warm cache | + #3442 + #3263 stack + #3269 stack, **cold** cache | |---|---|---| | translation + DXC (26,503 records) | 1,353 s | 1,619 s | | driver compute pipelines | 10,868 s | **3,413 s** | | graphics pipelines | 374 in ~80 s | 391 in 100 s | | title first presents | 12,326 s (3 h 25 min) | **5,141 s (1 h 26 min)** | | driver blobs made | 12,304 new (25,355 in cache) | 3,277 | | failed / fallback pipelines, crash | 0 / 0 / none | 0 / 0 / none | | frames in the 180 s of play | 5,104 | 3,818 | - Preparation finished **2.4× sooner even though the base was given the warm cache.** Nearly all of the saving is in the driver's compute pipelines (3.2× shorter), the long tail where the very large compute programs are compiled. - The run made far fewer distinct driver pipelines (3,277 blobs against 25,355), which fits shorter, more compact programs reaching the driver. - **Frames in play were 25 % lower** (3,818 against 5,104). One 180 s run per side, with different builds, the heap switches on and the game possibly at a different point, so this is not a measured regression, but it needs a matched check (smoke on main and on this PR's head) before anyone reads the preparation result as free. **Graph.** Progress of every full preparation run on this PC. This build is the solid blue line, the base the dashed pink one; in the lower panel blue reaches 100 % at ~1.4 h, pink at ~3.4 h. Data and script: [CSVs + `plot.py`](https://github.com/KOLESNiii/xcl/tree/bcf5a8f293b6468fa8973e20d4833f0ecb85c342). ![Shader preparation progress over time](https://raw.githubusercontent.com/KOLESNiii/xcl/bcf5a8f293b6468fa8973e20d4833f0ecb85c342/progress.png) **Not tested / limits** - Each PR on its own; the share of #3442 against the two stacks is unknown. - The commits tested are not all current heads: #3263's head is the one tested; #3442 (now `30122062`) and #3269 (now `e01151a2`, with #3268 now `64f666c0`) have changed since, so this report is for the commits listed above. - NVIDIA's own shader cache was left on for the cold run (the base run had it on too). - One run per side; RTX 2070 SUPER only (wave32). Not tested on AMD. **Hardware:** NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40), AMD Ryzen 5 3600XT, 32 GB, Windows 11 Home build 26300, rustc 1.100.1. **Tool and model:** Claude Code (Claude Opus 5.5): two sessions on this machine ran the queued runs; this one extracted the numbers from their logs and wrote this report.
johnbf8x commented 2026-11-29 22:23:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by johnbf8x on 2026-11-29T22:23:46Z.


merge-check
base: 1bd9cee1e5
head: 301220626a
merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; the merged tree was tested uncommitted)
build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok (the PR merged and main alike)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both (0x80004005, "sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission"), so no lib total. The lib in parts on both: hle::d3d12x::list_x alone on 1 thread 113 passed, 0 failed; the rest on 4 threads ends at the same place after 1696 ok on main and PR alike. The PR's own tests run directly: cargo test -p xcl --lib shaders::pipeline_cap_tests:: -- --test-threads=1 -> 7 passed, 0 failed, 0 ignored; cargo test -p xcl --test gpu_compute_e2e a_preparation_worker_keeps_a_split_programs_abi_whole -- --exact -> 1 passed. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer); failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), and the lib abort; all fail on base too
review: none blocking, after reading the whole diff (shaders.rs, gpu_compute_e2e.rs, README.md). chain_needed() is only consulted on the mandatory path (prepare_compiled_compute); make_selected (--pipelines without a parent) is unchanged. A whole that was refused or over XCL_PIPELINE_MAX_KB still gets its pieces, as before, and the chain-root whole is no longer retried in that case. Not covered here: an indirect dispatch (ExecuteIndirect) of a split program from a prepared whole blob in a title (the new e2e test dispatches it directly), AMD/wave64, a full cold startup preparation
performance: mandatory preparation (xcl shaders shaders.rpf --precompile --only cs --pipelines --records, XCL_PRECOMPILE_PARENT set, a new empty XCL_DXIL_CACHE per run) of the 31 programs that 33 of 60 pipeline keys from earlier runs matched: main 130 driver builds (31 .pso + 99 .chain.pso, 33.8 MB) in 3 runs; PR 31 builds (31 .pso, 0 .chain.pso, 12.1 MB) in 2 runs; 0 refused, 0 failed writes on both. Times (not cold: the NVIDIA driver's shader cache warmed run by run): main 130.8, 103.3, 71.3 s; PR 51.3, 17.3 s, each below the main run before it. Smoke (60 s, XCL_PREPARE=0, so the changed path does not run): PR 937 frames against main 809 (116 %), peak commit 15410 against 14713 MB (105 %), 0 device removals and 0 crashes on both
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5

Regression run

Both from scripts/smoke.ps1 -Seconds 60, each from its own copy of one warm DXIL cache and its own data root, with
XCL_LAZY_PSO=1, XCL_LAZY_COMPUTE=1, XCL_HEAP_WINDOWS=1 and XCL_PRESS_AT=25:A. The PR's block names main's commit with
"(uncommitted changes)": it is the PR test-merged onto main, not the PR's head commit, so it cannot stand in for the
author's own block.

main (1bd9cee1):

xcl-smoke v1
commit: 1bd9cee1e5b0f828a462a22334f9f503cec76536
gpu: NVIDIA GeForce RTX 3070 Ti
title: a2fe3fc0
seconds: 60
exit: 0x0
frames shown: 809 (PresentX 809)
presents per 2 s (last 3): 20 20 18
device removals: 0
crashes: 0
peak commit: 14713 MB

PR #3442 merged onto 1bd9cee1:

xcl-smoke v1
commit: 1bd9cee1e5b0f828a462a22334f9f503cec76536 (uncommitted changes)
gpu: NVIDIA GeForce RTX 3070 Ti
title: a2fe3fc0
seconds: 60
exit: 0x0
frames shown: 937 (PresentX 937)
presents per 2 s (last 3): 25 27 27
device removals: 0
crashes: 0
peak commit: 15410 MB

Found on the way (not this PR)

  • scripts/smoke.ps1 on main: it sets XCL_NETWORK, XCL_RUN_SECONDS and XCL_ACTIVITY (lines 60-62) after
    $psi.EnvironmentVariables['XCL_PREPARE'] (line 57). That first read copies the environment into the
    ProcessStartInfo, so XCL gets none of the three. Here the title never ended itself (one run went 928 s until its
    window was closed) and logged no activity (2 s) lines. The two runs above set the three variables before calling
    smoke.ps1. Seen on Windows PowerShell 5.1.
  • The lib tests end their own process (stop_for_unresolved_wait, "the title is stopped") on main 1bd9cee1 on this
    PC, so cargo test --workspace gives no lib total here.
<!-- greyfinch-sync:ivall/xcl:comment:7263639417 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7263639417). Originally posted by [johnbf8x](https://github.com/johnbf8x) on 2026-11-29T22:23:46Z. --- merge-check base: 1bd9cee1e5b0f828a462a22334f9f503cec76536 head: 301220626a767a85cee4ae10684961200f7fc313 merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; the merged tree was tested uncommitted) build: cargo build --workspace -> ok; cargo build --release -p xcl -> ok (the PR merged and main alike) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both (0x80004005, "sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission"), so no lib total. The lib in parts on both: hle::d3d12x::list_x alone on 1 thread 113 passed, 0 failed; the rest on 4 threads ends at the same place after 1696 ok on main and PR alike. The PR's own tests run directly: cargo test -p xcl --lib shaders::pipeline_cap_tests:: -- --test-threads=1 -> 7 passed, 0 failed, 0 ignored; cargo test -p xcl --test gpu_compute_e2e a_preparation_worker_keeps_a_split_programs_abi_whole -- --exact -> 1 passed. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer); failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), and the lib abort; all fail on base too review: none blocking, after reading the whole diff (shaders.rs, gpu_compute_e2e.rs, README.md). chain_needed() is only consulted on the mandatory path (prepare_compiled_compute); make_selected (--pipelines without a parent) is unchanged. A whole that was refused or over XCL_PIPELINE_MAX_KB still gets its pieces, as before, and the chain-root whole is no longer retried in that case. Not covered here: an indirect dispatch (ExecuteIndirect) of a split program from a prepared whole blob in a title (the new e2e test dispatches it directly), AMD/wave64, a full cold startup preparation performance: mandatory preparation (xcl shaders shaders.rpf --precompile --only cs --pipelines --records, XCL_PRECOMPILE_PARENT set, a new empty XCL_DXIL_CACHE per run) of the 31 programs that 33 of 60 pipeline keys from earlier runs matched: main 130 driver builds (31 .pso + 99 .chain.pso, 33.8 MB) in 3 runs; PR 31 builds (31 .pso, 0 .chain.pso, 12.1 MB) in 2 runs; 0 refused, 0 failed writes on both. Times (not cold: the NVIDIA driver's shader cache warmed run by run): main 130.8, 103.3, 71.3 s; PR 51.3, 17.3 s, each below the main run before it. Smoke (60 s, XCL_PREPARE=0, so the changed path does not run): PR 937 frames against main 809 (116 %), peak commit 15410 against 14713 MB (105 %), 0 device removals and 0 crashes on both verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5 ## Regression run Both from scripts/smoke.ps1 -Seconds 60, each from its own copy of one warm DXIL cache and its own data root, with XCL_LAZY_PSO=1, XCL_LAZY_COMPUTE=1, XCL_HEAP_WINDOWS=1 and XCL_PRESS_AT=25:A. The PR's block names main's commit with "(uncommitted changes)": it is the PR test-merged onto main, not the PR's head commit, so it cannot stand in for the author's own block. main (1bd9cee1): ``` xcl-smoke v1 commit: 1bd9cee1e5b0f828a462a22334f9f503cec76536 gpu: NVIDIA GeForce RTX 3070 Ti title: a2fe3fc0 seconds: 60 exit: 0x0 frames shown: 809 (PresentX 809) presents per 2 s (last 3): 20 20 18 device removals: 0 crashes: 0 peak commit: 14713 MB ``` PR #3442 merged onto 1bd9cee1: ``` xcl-smoke v1 commit: 1bd9cee1e5b0f828a462a22334f9f503cec76536 (uncommitted changes) gpu: NVIDIA GeForce RTX 3070 Ti title: a2fe3fc0 seconds: 60 exit: 0x0 frames shown: 937 (PresentX 937) presents per 2 s (last 3): 25 27 27 device removals: 0 crashes: 0 peak commit: 15410 MB ``` ## Found on the way (not this PR) - `scripts/smoke.ps1` on main: it sets `XCL_NETWORK`, `XCL_RUN_SECONDS` and `XCL_ACTIVITY` (lines 60-62) after `$psi.EnvironmentVariables['XCL_PREPARE']` (line 57). That first read copies the environment into the ProcessStartInfo, so XCL gets none of the three. Here the title never ended itself (one run went 928 s until its window was closed) and logged no `activity (2 s)` lines. The two runs above set the three variables before calling smoke.ps1. Seen on Windows PowerShell 5.1. - The lib tests end their own process (`stop_for_unresolved_wait`, "the title is stopped") on main 1bd9cee1 on this PC, so `cargo test --workspace` gives no lib total here.
PrMeiliv commented 2026-11-29 23:16:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PrMeiliv on 2026-11-29T23:16:31Z.


Test report: cold mandatory compute preparation, used-only set of a retail game, A/B on the same main (not a merge-check)

Setup

  • NVIDIA GeForce RTX 4080 16 GB (wave32; driver version not recorded), AMD Ryzen 7 9800X3D (8 cores / 16 threads), 32 GB RAM, Windows
  • A: main 0fe06eb0 + #2590 (xcl nvprofile CLI command only, unrelated to this path)
  • B: the same + this PR at 148031ea. Its code is identical to the current head 30122062 (git diff 148031ea 30122062 is empty; only the commit message changed)

Command, per side, the path xcl run's preparation workers take:
xcl shaders <game>\shaders.rpf --precompile --only cs --pipelines --used-only

  • environment: XCL_PRECOMPILE_PARENT set, XCL_DEVICE_TYPE=anaconda, XCL_PIPELINE_THREADS=8 (the log says 8 driver compiles at once)
  • cold: each side got a new, empty XCL_DXIL_CACHE holding only the same copied used-* lists (selection: 1277 of 2496 keys matched shader-package records, 281 split programs earlier runs dispatched indirectly get direct and indirect pieces/whole, 1149 shaders compiled, 0 already cached)
  • %LOCALAPPDATA%\NVIDIA\DXCache was emptied before each side (A: 17 files in use could not be deleted; B: not checked)
  • B ran first, A about an hour later

Results

A: main 0fe06eb0 B: + this PR
wall time (DXC translation + driver pipelines) 3434 s 988 s −71 %
pipelines made on the GPU 9630 1144 −88 %
driver blobs written 9502, of them 4451 *.chain.pso 1135, 0 *.chain.pso −88 %
blob bytes 2459 MB 604 MB −75 %
pipelines loaded from the driver cache 128 9
refused / record errors / cache writes failed 0 / 0 / 0 0 / 0 / 0
exit code 0 0
peak private bytes 8.6 GB 8.2 GB

My script counted *.chain.pso only; the remaining 5051 blobs on A are the wholes plus *.indirect-chain.pso, which I did not count separately (the folders were deleted after counting).

The gain is larger on current main than on an older base. A first run against main 7a649b0e (before the merges up to 0fe06eb0, which add the indirect pieces and wholes to this path) gave 2296 s and 5581 blobs (4446 *.chain.pso) for the base, against B's 988 s (−57 %). That pair differs by more than this PR, so the table above is the clean comparison.

Not tested

  • xcl run itself (the Shader preparation: compute pipelines done in N s line) and the warm run's compute split: line. I ran the worker command on its own.
  • Gameplay on B after a full preparation.
  • Graphics pipelines, AMD and Intel GPUs.
  • Wall time includes the same cold DXC translation on both sides (about 45 s alone), so the time difference is slightly understated.

AI use: Claude Code (Claude Opus 5.5) wrote the A/B scripts, read the logs and wrote this report. The runs were done on the PC above. Posted at the user's request.

<!-- greyfinch-sync:ivall/xcl:comment:7264334955 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7264334955). Originally posted by [PrMeiliv](https://github.com/PrMeiliv) on 2026-11-29T23:16:31Z. --- **Test report: cold mandatory compute preparation, used-only set of a retail game, A/B on the same main (not a merge-check)** **Setup** - NVIDIA GeForce RTX 4080 16 GB (wave32; driver version not recorded), AMD Ryzen 7 9800X3D (8 cores / 16 threads), 32 GB RAM, Windows - A: main `0fe06eb0` + #2590 (`xcl nvprofile` CLI command only, unrelated to this path) - B: the same + this PR at `148031ea`. Its code is identical to the current head `30122062` (`git diff 148031ea 30122062` is empty; only the commit message changed) **Command**, per side, the path `xcl run`'s preparation workers take: `xcl shaders <game>\shaders.rpf --precompile --only cs --pipelines --used-only` - environment: `XCL_PRECOMPILE_PARENT` set, `XCL_DEVICE_TYPE=anaconda`, `XCL_PIPELINE_THREADS=8` (the log says `8 driver compiles at once`) - cold: each side got a new, empty `XCL_DXIL_CACHE` holding only the same copied `used-*` lists (`selection: 1277 of 2496 keys matched shader-package records`, `281 split programs earlier runs dispatched indirectly get direct and indirect pieces/whole`, 1149 shaders compiled, 0 already cached) - `%LOCALAPPDATA%\NVIDIA\DXCache` was emptied before each side (A: 17 files in use could not be deleted; B: not checked) - B ran first, A about an hour later **Results** | | A: main `0fe06eb0` | B: + this PR | | |---|---|---|---| | wall time (DXC translation + driver pipelines) | 3434 s | **988 s** | **−71 %** | | pipelines made on the GPU | 9630 | 1144 | −88 % | | driver blobs written | 9502, of them 4451 `*.chain.pso` | 1135, 0 `*.chain.pso` | −88 % | | blob bytes | 2459 MB | 604 MB | −75 % | | pipelines loaded from the driver cache | 128 | 9 | | | refused / record errors / cache writes failed | 0 / 0 / 0 | 0 / 0 / 0 | | | exit code | 0 | 0 | | | peak private bytes | 8.6 GB | 8.2 GB | | My script counted `*.chain.pso` only; the remaining 5051 blobs on A are the wholes plus `*.indirect-chain.pso`, which I did not count separately (the folders were deleted after counting). **The gain is larger on current main than on an older base.** A first run against main `7a649b0e` (before the merges up to `0fe06eb0`, which add the indirect pieces and wholes to this path) gave 2296 s and 5581 blobs (4446 `*.chain.pso`) for the base, against B's 988 s (−57 %). That pair differs by more than this PR, so the table above is the clean comparison. **Not tested** - `xcl run` itself (the `Shader preparation: compute pipelines done in N s` line) and the warm run's `compute split:` line. I ran the worker command on its own. - Gameplay on B after a full preparation. - Graphics pipelines, AMD and Intel GPUs. - Wall time includes the same cold DXC translation on both sides (about 45 s alone), so the time difference is slightly understated. **AI use:** Claude Code (Claude Opus 5.5) wrote the A/B scripts, read the logs and wrote this report. The runs were done on the PC above. Posted at the user's request.
ArtuArtaza commented 2026-11-29 23:20:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ArtuArtaza on 2026-11-29T23:20:01Z.


Test report: cold mandatory compute preparation A/B on AMD (RX 6700 XT, RDNA2, Windows), a 40-record sample of a retail game (not a merge-check)

Short version: no change at default settings, about half the compute driver time with XCL_PSO_DISK_CACHE=1. This is the preparation workers' path on a sample, not the full xcl run protocol of the "Test results wanted" comment.

Setup

  • AMD Radeon RX 6700 XT 12 GB, driver 32.0.21045.29003 (Adrenalin 26.11.2), Ryzen 5 5600X, 48 GB, Windows 11. Release builds from source.
  • Two pairs. On this PR's parent: A = 0fe06eb0, B = 30122062 (this PR's head). On current main: A = b38197ae, B = b38197ae with this PR's commit cherry-picked (no conflicts).
  • The mandatory path, as in the description: xcl shaders shaders.rpf --precompile --only cs --pipelines --records <file> with XCL_PRECOMPILE_PARENT, XCL_PIPELINE_THREADS=1, XCL_DXC_THREADS=2, XCL_DEVICE_TYPE=lockhart. One process, one driver compile at a time.
  • Cold on both sides: a new, empty XCL_DXIL_CACHE for every run, and every run used its own copy of the exe under another file name, because AMD's driver shader cache (%LOCALAPPDATA%\AMD\DxcCache) is per exe name. Each of the eight runs below is confirmed cold by the new cache files the driver created for it. (One attempt is not in the table: AMD's key does not tell apart names of the same length that differ only near the end, so two renamed exes reused older caches and finished in seconds. The run tag is now at the start of the name.)
  • Translation ran in a pass of its own first (3.7 – 6.6 s), so the times below are the pipelines pass only.
  • Sample: 40 compute records of the retail game, taken in proportion from the size bands of the description, at evenly spaced sizes inside each band. My translated cache has 2,754 compute programs, 807 split, 9,251 pieces. The sample is 28 unsplit and 12 split programs (136 pieces), 13.2 MiB of whole DXIL. Two small strata got no record: 256 – 512 KiB split (11 programs) and ≥ 1 MiB unsplit (16).

Result (one run each)

base side setting pipelines made driver blobs kept pipelines pass
0fe06eb0 A default 188 none (persistence disabled 188) 847.8 s
0fe06eb0 B default 188 none (persistence disabled 188) 837.4 s
0fe06eb0 A XCL_PSO_DISK_CACHE=1 188 40 .pso, 148 .chain.pso 888.5 s
0fe06eb0 B XCL_PSO_DISK_CACHE=1 40 40 .pso 424.1 s
b38197ae A default 188 none (persistence disabled 188) 811.0 s
b38197ae B default 188 none (persistence disabled 188) 864.8 s
b38197ae A XCL_PSO_DISK_CACHE=1 188 40 .pso, 148 .chain.pso 1039.8 s
b38197ae B XCL_PSO_DISK_CACHE=1 40 40 .pso 499.9 s
  • At default settings the PR changes nothing on AMD: both sides make 188 = 40 wholes + 136 pieces + 12 chain-root wholes. The driver-blob disk cache is off by default for vendor 0x1002 (driver_cache::enabled), so whole_blob_path gives None, on_disk is false and chain_needed is always true.
  • With XCL_PSO_DISK_CACHE=1 it does what the description says: 40 pipelines instead of 188 (−79 %), and 52 % less time on both bases (424 s against 889 s, 500 s against 1040 s).
  • Noise: the six 188-pipeline runs span 811 – 1040 s. The machine was slower during the last two runs (each about 17 % slower than the same run on the older base), so the two disk-cache runs of a base are the ones to compare with each other. The differences at default settings (−1 % and +7 %) are inside that noise.
  • The blobs AMD gives back are 954 bytes each, references into the driver's own cache, as the comment at driver_cache::note_vendor says. A second process with the same exe name took all 40 of B's blobs from disk (pipelines loaded from the driver cache 40, no fresh creation) once the verified list was set aside, so the driver does accept them across processes.

Not tested

  • A title run on what B prepared: whether the runtime's CachedWhole takes these blobs in a game on AMD.
  • Parallel preparation workers, a full preparation, NVIDIA and Intel.

A question from reading the code (not measured): at default settings on AMD the runtime has no blob on disk, so CachedWhole misses and the runtime builds the chain. If that is right, on AMD the pieces are the part of preparation the runtime uses and the two whole builds are the part it does not. Would it make sense for preparation to follow the same rule there, or to say in the README that the PR needs XCL_PSO_DISK_CACHE=1 on AMD?

AI use: Claude Code (Claude Fable 5.2) built both sides, ran the measurement, wrote this report and posted it from my account at my request.

<!-- greyfinch-sync:ivall/xcl:comment:7264379713 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3442#issuecomment-7264379713). Originally posted by [ArtuArtaza](https://github.com/ArtuArtaza) on 2026-11-29T23:20:01Z. --- **Test report: cold mandatory compute preparation A/B on AMD (RX 6700 XT, RDNA2, Windows), a 40-record sample of a retail game (not a merge-check)** Short version: no change at default settings, about half the compute driver time with `XCL_PSO_DISK_CACHE=1`. This is the preparation workers' path on a sample, not the full `xcl run` protocol of the "Test results wanted" comment. **Setup** - AMD Radeon RX 6700 XT 12 GB, driver 32.0.21045.29003 (Adrenalin 26.11.2), Ryzen 5 5600X, 48 GB, Windows 11. Release builds from source. - Two pairs. On this PR's parent: A = 0fe06eb0, B = 30122062 (this PR's head). On current main: A = b38197ae, B = b38197ae with this PR's commit cherry-picked (no conflicts). - The mandatory path, as in the description: `xcl shaders shaders.rpf --precompile --only cs --pipelines --records <file>` with `XCL_PRECOMPILE_PARENT`, `XCL_PIPELINE_THREADS=1`, `XCL_DXC_THREADS=2`, `XCL_DEVICE_TYPE=lockhart`. One process, one driver compile at a time. - Cold on both sides: a new, empty `XCL_DXIL_CACHE` for every run, and every run used its own copy of the exe under another file name, because AMD's driver shader cache (`%LOCALAPPDATA%\AMD\DxcCache`) is per exe name. Each of the eight runs below is confirmed cold by the new cache files the driver created for it. (One attempt is not in the table: AMD's key does not tell apart names of the same length that differ only near the end, so two renamed exes reused older caches and finished in seconds. The run tag is now at the start of the name.) - Translation ran in a pass of its own first (3.7 – 6.6 s), so the times below are the pipelines pass only. - Sample: 40 compute records of the retail game, taken in proportion from the size bands of the description, at evenly spaced sizes inside each band. My translated cache has 2,754 compute programs, 807 split, 9,251 pieces. The sample is 28 unsplit and 12 split programs (136 pieces), 13.2 MiB of whole DXIL. Two small strata got no record: 256 – 512 KiB split (11 programs) and ≥ 1 MiB unsplit (16). **Result** (one run each) | base | side | setting | pipelines made | driver blobs kept | pipelines pass | |---|---|---|---|---|---| | 0fe06eb0 | A | default | 188 | none (`persistence disabled 188`) | 847.8 s | | 0fe06eb0 | B | default | 188 | none (`persistence disabled 188`) | 837.4 s | | 0fe06eb0 | A | `XCL_PSO_DISK_CACHE=1` | 188 | 40 `.pso`, 148 `.chain.pso` | 888.5 s | | 0fe06eb0 | B | `XCL_PSO_DISK_CACHE=1` | 40 | 40 `.pso` | 424.1 s | | b38197ae | A | default | 188 | none (`persistence disabled 188`) | 811.0 s | | b38197ae | B | default | 188 | none (`persistence disabled 188`) | 864.8 s | | b38197ae | A | `XCL_PSO_DISK_CACHE=1` | 188 | 40 `.pso`, 148 `.chain.pso` | 1039.8 s | | b38197ae | B | `XCL_PSO_DISK_CACHE=1` | 40 | 40 `.pso` | 499.9 s | - At default settings the PR changes nothing on AMD: both sides make 188 = 40 wholes + 136 pieces + 12 chain-root wholes. The driver-blob disk cache is off by default for vendor 0x1002 (`driver_cache::enabled`), so `whole_blob_path` gives `None`, `on_disk` is false and `chain_needed` is always true. - With `XCL_PSO_DISK_CACHE=1` it does what the description says: 40 pipelines instead of 188 (−79 %), and 52 % less time on both bases (424 s against 889 s, 500 s against 1040 s). - Noise: the six 188-pipeline runs span 811 – 1040 s. The machine was slower during the last two runs (each about 17 % slower than the same run on the older base), so the two disk-cache runs of a base are the ones to compare with each other. The differences at default settings (−1 % and +7 %) are inside that noise. - The blobs AMD gives back are 954 bytes each, references into the driver's own cache, as the comment at `driver_cache::note_vendor` says. A second process with the same exe name took all 40 of B's blobs from disk (`pipelines loaded from the driver cache 40`, no fresh creation) once the verified list was set aside, so the driver does accept them across processes. **Not tested** - A title run on what B prepared: whether the runtime's `CachedWhole` takes these blobs in a game on AMD. - Parallel preparation workers, a full preparation, NVIDIA and Intel. **A question from reading the code** (not measured): at default settings on AMD the runtime has no blob on disk, so `CachedWhole` misses and the runtime builds the chain. If that is right, on AMD the pieces are the part of preparation the runtime uses and the two whole builds are the part it does not. Would it make sense for preparation to follow the same rule there, or to say in the README that the PR needs `XCL_PSO_DISK_CACHE=1` on AMD? **AI use**: Claude Code (Claude Fable 5.2) built both sides, ran the measurement, wrote this report and posted it from my account at my request.
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!3442
No description provided.