Skip to content

Shaders: --precompile --pipelines also builds a split program's whole form - #2551

Closed
DTsordas wants to merge 1 commit into
xcl-dev:mainfrom
DTsordas:precompile-chain-whole
Closed

DTsordas wants to merge 1 commit into
xcl-dev:mainfrom
DTsordas:precompile-chain-whole

Conversation

@DTsordas

Copy link
Copy Markdown

xcl shaders --precompile --pipelines now also builds a split compute program's whole form under the dispatch-chain root signature (.chain.pso), next to its pieces. Part of #1833, follows #2338.

A split program keeps its whole form for what its pieces cannot run (an ExecuteIndirect, a dispatch without scratch). The runtime builds it in Chain::whole with chained = true, on the title's thread, the first time it is needed. #2338 prebuilds only the pieces, so every whole form was still compiled cold there.

On a retail title (RX 9060 XT, XCL_DIRECT_DXIL=1, all compute pipelines precompiled except the whole forms), the title's submit thread built 3–6 of them at its world start, 0.8–1.15 MB of DXIL each, 41–55 s each, and presented nothing meanwhile. With the whole forms precompiled, those binds loaded the blob in 3–4 ms and no compute pipeline was built cold after the world start. #2404 avoids the whole form for an ExecuteIndirect on the GPU side; this covers the whole form wherever the runtime still builds it, and works with or without #2404.

What is in it

  • crates/xcl/src/shaders.rs: after the pieces, make_with_cache_path builds c.dxil with chained = true (the cap and the cached-blob reuse apply as for a piece). The unit test now expects the whole form's .chain.pso too, checks that the runtime's chain root signature accepts it, and reuses all three blobs on the second pass.
  • crates/xcl/tests/gpu_compute_e2e.rs: offline_split_compute_pipeline_is_reused_by_a_second_process counts the whole form's blob with the pieces' (5 pieces + 1 whole form).

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 5 5600X, 64 GB, Windows 11 build 26300, Rust 1.100.0, debug for the suite, release for the runs.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 at 3567b2e: 1421 passed, 2 failed, 46 ignored. The two failures, gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and _3 (seed 1599), fail the same way on main e1d84b7 on this card; they are not touched here.
  • SKIPPED on this adapter: no D3D12 debug layer / d3d12SDKLayers.dll (3), f16_programs_on_the_gpu and f32_programs_on_the_gpu per-lane forms (6), no heap windows (1).
  • Retail title, before and after: cold compute builds on the title's thread after the world start went from 3–6 per run (41–55 s each; 3 runs) to 0 (5 runs of 6 minutes; 10–19 graphics pipelines are still built cold there). These runs were made on an earlier tree with the same change (main 06c9f55 + an equivalent commit, plus local diagnostics and a local switch that leaves compute programs of 1.2 MB of DXIL or more unbuilt), not on this branch.

Regression run

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: AMD Radeon RX 9060 XT
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1343 (PresentX 1343)
presents per 2 s (last 3): 33 59 44
device removals: 0
crashes: 0
peak commit: 18667 MB
xcl-smoke v1
commit: 3567b2efdc94617de71e50be77e107991a6bd41c
gpu: AMD Radeon RX 9060 XT
title: retail-1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1438 (PresentX 1439)
presents per 2 s (last 3): 52 40 15
device removals: 0
crashes: 0
peak commit: 19252 MB

The 60 s smoke run ends before the world start, so it does not reach the whole forms; the numbers above the blocks come from the longer runs.

Not tested

AI use

  • Claude Code with Claude Opus 5.5: found the cause in the runs' logs, wrote the change and the test updates, ran the suite and the smoke runs, and wrote this description.

🤖 Generated with Claude Code

… form

A split compute program keeps its whole form for what its pieces cannot run
(an ExecuteIndirect, a dispatch without scratch). The runtime builds that form
under the dispatch-chain root signature (Chain::whole, chained, .chain.pso) on
the title's thread the first time it is needed. #2338 prebuilds only the pieces,
so every whole form was still compiled cold in the title.

On a retail title (RX 9060 XT, XCL_DIRECT_DXIL=1), after a full compute
precompile without the whole forms, the title's submit thread built 3-6 of them
(0.8-1.15 MB of DXIL) at its world start, 41-55 s each, presenting nothing
meanwhile; with them prebuilt, those binds loaded the blob in 3-4 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@futurepro62

futurepro62 commented Nov 25, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 3567b2e (on its base e1d84b7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1411 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1422 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main e1d84b7 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (Tests: heap_window_out_of_memory_falls_back_to_the_switch_form fails under XCL_REQUIRE_GPU=mesh (opt-in skip counted as missing coverage) #1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

@thehollowedone

Copy link
Copy Markdown
Contributor

Independent Windows integration check of 3567b2e merged locally, without a commit, onto current main b49be18 (#2371). The merge had no conflicts.

Tested: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug, XCL_HEAP_WINDOWS=1.

  • cargo test -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1: 7 passed, 0 failed, 0 ignored, no skips. Both offline_split_compute_pipeline_is_reused_by_a_second_process and the newly merged split_compute_prefers_the_offline_whole_pipeline passed.
  • cargo build --workspace: passed.
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1,435 passed, 0 failed, 47 ignored; 24 GPU skip notices.

The merged #2371 path tries an offline whole PSO with the ordinary compute root signature; this PR also prepares the chain-root whole form used by Chain::whole. The combined synthetic tests pass on this adapter. Not tested: a clean PR-head retail smoke pair on the new base, cold driver-cache time, AMD hardware, or title world entry. This local uncommitted merge is integration evidence, not a replacement for the PR's required rebased-head regression blocks.

AI use: Codex (GPT-6.2 Sol) reviewed the combined paths, ran these tests on this machine, and drafted this report. AI-assisted.

@afpruivo

Copy link
Copy Markdown

NVIDIA world data for this PR: RTX 3090 (driver 621.40), retail 1.0.2.1. With this PR's precompile the cold compute builds on title threads at the world start went from 30 to 0, and the title presented in the world until the next wall (#2403). One run per state; the runtime is the same main binary throughout, only the cache differs.

Setup

  • RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, release.
  • Runtime: main 08db802 (+ xcl run: xcl nvprofile puts xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590, which is not called at run time), XCL_DIRECT_DXIL=1 XCL_DRED=1 XCL_NETWORK=0 XCL_ACTIVITY=1, 480 s, A pressed every 4 s from 20 s, no driver profile for the exe.
  • Precompiler: xcl shaders … --precompile --only cs --pipelines --used-only with XCL_DIRECT_DXIL=1, first from main, then from this PR (3567b2e merged onto 08db802, no conflicts). This PR's pass added 117 whole-form blobs (.chain.pso) next to the pieces, 2,666 pipelines, 0 refused.

Result

precompile cold compute builds after the world start what the title did
main 30 (0.8–1.2 MB DXIL, 11–17 s each, huge, ungated here, about 387 s in the driver) 20 presents, then none for the rest of the run
this PR 0 (146 compute pipelines from blobs) presented for about 28 s in the world (186 presents), then the device was removed at 102.5 s (0x887a0005, DRED page fault at VA 0x0 with no allocations): the #2403 shader-heap limit, with no build in flight

So on NVIDIA, as in your RX 9060 XT runs, the whole forms were what the title waited on at the world start once the pieces were cached.

Not tested: more than one run per state; --precompile without --used-only; other cards; the heap-windows path.

AI use: Claude Code (Claude Opus 5.5) ran the precompiles and the runs on my PC, read the logs and drafted this.

@bielfreedom

bielfreedom commented Nov 26, 2026 •

Copy link
Copy Markdown

AMD Windows cost of this PR's offline pass: on an RX 9070 XT, the six whole forms in a 26-program set take 17–34 s each in AMD's driver. That doubles the --precompile --pipelines driver time for the set (about 110 s → 230–247 s) and raises peak memory from 1.47 to 2.17 GB. All whole forms built; none was refused. If they would otherwise be built on the title's thread at world start, as in the description, that is time moved out of the title. It is the right trade, but on AMD the offline pass gets noticeably longer.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4, native wave64), AMD driver 32.0.32029.2010.
  • CPU and memory: Ryzen 7 7700 (16 threads), 32 GB RAM, Windows 11, release.
  • Builds, each with a local timing patch that writes every CreateComputePipelineState time and result to a file:
    • main b49be18;
    • this PR at 3567b2e merged onto it.
  • Offline: xcl shaders <retail shaders.rpf> --precompile --only cs --pipelines, limited to 26 large compute programs, with:
    • XCL_DIRECT_DXIL=1, switch windows, XCL_PSO_DISK_CACHE=0;
    • one driver thread;
    • a fresh translation cache and a fresh exe name for every run (the AMD driver keys its own cache on the exe name, so every build is cold).
  • Two interleaved rounds (main, PR, then PR, main).
build pipelines made / refused driver time r1 / r2 peak memory
main 76 / 0 109.6 / 110.5 s 1.47 GB
this PR 82 / 0 247.3 / 230.1 s 2.17 GB

The six extra pipelines are the whole forms of the six split programs in the set, built with chained = true:

program whole-form DXIL driver ms r1 / r2
84eee477d68b6fdf 958,940 B 18,541 / 17,586
ed2f8fa2e996c6a6 873,976 B 17,938 / 17,725
b3618a0fd76af79c 851,060 B 34,011 / 30,187
c6f8ee0f53ed5709 795,920 B 29,036 / 28,577
d8435f454a510270 742,348 B 25,538 / 24,839
b5cc5a57995e563b 122,884 B 1,493 / 1,299

The other 76 pipelines (56 pieces and 20 unsplit programs) took 120.7 / 110.0 s with this PR against 109.6 / 110.5 s on main. The first round's extra 10 s looks like load on the machine. Times on this machine run about 30 % higher today than in my earlier reports because it is busier; the two builds ran interleaved.

Not tested: a title run and the reuse of these blobs at run time (I ran with the disk cache off).

AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this report; I posted it.

@SlopTart

Copy link
Copy Markdown

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
No new test functions in this PR (precompile plumbing); the suite above is the confirmation on this lane.

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

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

@afpruivo

afpruivo commented Nov 26, 2026 •

Copy link
Copy Markdown

On nvidia-dev af2cecc4 (RTX 3090), this PR merges cleanly. Without it, the title stops about 1 s after the world start, blocked in Chain::whole. With it, the title keeps submitting work to 316 s, and 201 of 231 large compute builds load a precompiled driver blob. 30 whole forms are still built cold, and the device is removed at 341 s. Details and dumps: #2741 (comment).

AI use: Claude Code (Claude Opus 5.5) ran the runs and drafted this; checked by me before posting.

@PACDevX

PACDevX commented Nov 26, 2026

Copy link
Copy Markdown

A follow-up from an RTX 3090 (driver 621.24, Windows Sandbox vGPU) on the NVIDIA integration base eae015021, using 16 heap windows and split wave64.

I checked six first-demand stalls against the sealed CLI precache. Each shader's translated record and all 67 split-piece PSOs were present. All six whole chain-ABI PSOs were absent. These six driver compiles took about 82 seconds total during the loading interval. A later sample of 40 whole variants showed the same missing-blob pattern.

With the recovered driver blobs in a private six-key cache, I exercised an opt-in backport of this PR. On the same cache, the normal --used-only path loaded 67 PSOs. Adding --with-chain-whole loaded 73. Both runs had zero refusals and zero outstanding duplicate work. This checks the exact offline/runtime keys and coverage. The end-to-end loading effect is still being measured. Opt-in backport

Credit to @DTsordas for the whole-variant precompile change. AI assistance: OpenAI Codex.

@kole07139

kole07139 commented Nov 26, 2026 •

Copy link
Copy Markdown

RTX 3070 8 GB (driver 617.42), on a tree that has #2404 (two items of your "Not tested": NVIDIA, and together with #2404): with this PR's whole forms in the cache, the title kept presenting to the end of two 420 s runs, and one of them loaded 55 whole forms from this PR's blobs. Without them, one of two runs stopped presenting at 181 s, 99 s after world entry, while whole forms were built cold. With the PR, no compute pipeline was built cold after the world start. The next cold builds are graphics pipelines from about 300 s, up to 12 s each.

run this PR first ListX #101 presents 0–30 s after 30–95 s 95–200 s 200–330 s end
Y2 no 82.4 s 104 14 19 3 300 s run, no removal
Y4 no 81.9 s 159 15 2 0 last present at 181 s, no removal
Z1c yes 88.5 s 120 15 21 26 last present at 415 s of 420, no removal
Z2c yes 104.9 s 24 16 24 23 last present at 419 s of 420, no removal
  • Precompile: xcl shaders <pack> --precompile --only cs --pipelines --used-only on the cache the earlier runs used (1404 used pipelines). It took 26.3 min at 15 threads, with peak process commit 4.4 GB. Result: pipelines made on the GPU 3886, refused 0 | pipelines loaded from the driver cache 3579. It added 304 blobs, one for each of the title's split programs.
  • Without the PR (Y4): from 184 s, six compute pipelines of 0.86–1.12 MB of DXIL with driver blob absent, one after another on the title's threads. The first two took 28.2 s and 20.2 s. Presents stopped at 181 s and did not resume.
  • Those six are whole forms: their DXIL sizes match six of the 304 blobs this PR's pass added, and no blob of the cache without the PR. Y2, Y3 and Y5 did not ask for them, and neither did Z1c or Z2c, so the six are not the comparison.
  • With the PR (Z1c, Z2c): no compute pipeline had driver blob absent. Z2c asked for 61 compute pipelines of 700 KB or more. 55 of them came from blobs this PR added (driver blob supplied; same DXIL sizes, none in the cache without it). Without the PR those would have been built cold, like Y4's six at 17–28 s each. Z1c asked only for the six big ones every run has, which were already cached. The slowest compute pipelines took 0.7 s and 4.6 s, of 28 KB and 181 KB of DXIL. The 16 and 20 driver blob absent lines are all graphics pipelines. The runtime still logged its whole form is built for the next ones once per run at about 130 s. Its build took no measurable time, since the blob was there.
  • What it does not change: in the world the title presents about 0.2–0.3 times a second with or without the PR. These runs show the stop gone, not a higher rate.
  • Peaks: commit 33.9 / 33.7 GB and local video memory 12.7 / 12.9 GB with the PR; 31.3 / 29.9 GB and 11.5 GB without it.

Tested

Not tested

  • The whole suite; the pass without --used-only; runs longer than 420 s; more than two runs per arm. Y2 and Y4 lasted 300 s, so for them the 200–330 s column covers only the first 18 s of that window.

AI use

  • Claude Code (Claude Opus 5.5) built the trees, ran the precompile and the runs, read the logs and wrote this report.

@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #2551 at head 3567b2efdc94617de71e50be77e107991a6bd41c (1 commit; exact parent & merge-base: e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555 ancestor of 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 (3567b2ef)

Command Result
cargo test --release -p xcl --test gpu_compute_e2e offline_split_compute_pipeline_is_reused_by_a_second_process -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 5 filtered out × 3 (0.96s, 0.83s, 0.83s, 0 skipped) — runs live on RTX 4060 + DXC 1.9.2609.5, precompiling both split piece .chain.pso blobs and the whole-form .chain.pso, verifying second-process warm driver-cache reuse and single-blob corruption recovery
cargo test --release -p xcl --test gpu_compute_e2e -- --test-threads=1 (3 consecutive runs) 6 passed; 0 failed; 0 ignored × 3 (1.99s, 2.00s, 1.98s; 5 executed on RTX 4060 + 1 self-skipped heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)
cargo test --release -p xcl --lib shaders:: (3 consecutive runs) 10 passed; 0 failed; 0 ignored; 1314 filtered out × 3 (0.20s, 0.19s, 0.18s; 9 executed + 1 self-skipped pso_measurement_compiles_an_exact_synthetic_record because Windows Developer Mode is off)
cargo build --release -p xcl Clean build (exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):

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

PR #2551 (3567b2efdc94617de71e50be77e107991a6bd41c):

xcl-smoke v1
commit: 3567b2efdc94617de71e50be77e107991a6bd41c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1601 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13991 MB

Runtime log observations (xcl.log)

  • 9222 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19558 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 13991 MB committed by the process; video memory 6115 MB local, 4650 MB non-local.

Limits of coverage

  • Offline --precompile --pipelines whole-form + split-piece .chain.pso emission, second-process driver-cache reload, and corrupt-blob recovery were directly verified end-to-end on desktop RTX 4060 via offline_split_compute_pipeline_is_reused_by_a_second_process (3/3 pass) and gpu_compute_e2e (5 executed + 1 self-skipped × 3).
  • shaders::tests::pso_measurement_compiles_an_exact_synthetic_record self-skipped because Windows Developer Mode is off on this host, and the 60 s retail smoke ran xcl run with warm caches rather than a full offline --precompile --pipelines sweep over a retail shader dump (confirming zero runtime regression on title: 29640639; frame-count delta vs. cached parent reflects single-run startup variance, not this PR).

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

@JJAutoCompare

Copy link
Copy Markdown

Tested: Clean 3567b2efdc94617de71e50be77e107991a6bd41c, Windows 11 build 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug. Built cargo test --locked -j 2 -p xcl --lib --test gpu_compute_e2e --no-run. Two CPU controls and four Arc tests passed with zero failures, ignores or skips. split_compute_program_prebuilds_and_caches_chain_pieces reused two pieces and a whole-form blob on its second pass. stale_blob_cannot_bypass_the_offline_pipeline_cap retained the cap and read back 42 at runtime. The exact CLI integration tests offline_compute_pipeline_is_reused_by_a_second_process and offline_split_compute_pipeline_is_reused_by_a_second_process covered normal and split reuse. The split test wrote five pieces plus whole, reused all six in the next process, and rebuilt one corrupted blob while reusing the other five.

Not tested: Live whole-form ExecuteIndirect or scratch-fallback dispatch, driver timing, workspace suite and retail smoke.

AI use: T3 Code / Codex (gpt-6.2-sol) ran and reran the checks and drafted this report.

@ettehn

ettehn commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

One rebase detail for shaders.rs: once Pipelines::make_with_cache_path builds the split program’s whole form, please remove the older startup.is_some() block that calls p.make_one(&c.dxil, &c.samplers, true, None) immediately after p.make(&c). That block is still present on main at 81693f02.

I reproduced the extra driver call on Windows with an RTX 5070 Ti Laptop, using xcl run on the repository’s test title and one synthetic split_program() shader (XCL_DIRECT_DXIL=1, XCL_DIRECT_SPLIT_INSTRUCTIONS=12, separate empty XCL caches). The shader split into six pieces, so preparation should create seven pipelines including the whole form. With 3567b2ef applied to my 06f90c19-based tree, preparation reported 8 created, 1 loaded from cache. Removing just the startup block gave 7 created, 0 loaded from cache. Both wrote the same seven .chain.pso filenames and the test title exited 0 with zero failures. The eighth call reloaded the blob just written in that same launch.

OpenAI Codex (GPT-6) assisted with integration and verification.

Royalflamejlh added a commit to Royalflamejlh/xcl that referenced this pull request Nov 28, 2026
main gained 345 commits since 753e8b1, most of them bmjask's stack (xcl-dev#2959),
plus xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086 from this branch. Conflicts, per PR:

- xcl-dev#2404 + xcl-dev#2633 (split chained ExecuteIndirect): main's xcl-dev#2959 took both over
  (ed98461, a05fbc4, 8626d5b: IndirectBuild/IndirectChain on a CBV root,
  one-command slicer, separate cache namespace). Main's side kept in
  dispatch_chain.rs, pso.rs (slicer, command signature, chain root),
  bind.rs (ExecuteIndirect path), device_x.rs (signature traits),
  pso_async.rs (no background whole build, so no build_waited_on), real.rs
  (ComputeBuild, driver_cache names) and shaders.rs (blob names). Dropped
  with them: slab_count, record_slicer, abi_signature_id names, the direct
  root-CBV constant blocks, list_x::predicated, the split.rs/runner.rs
  ExecuteIndirect test and the list_x chain-scratch test. Not in main: xcl-dev#2404
  ran the pieces before any whole form was built; main runs the whole form
  (built on the title's thread) until the indirect set is ready.
- xcl-dev#2707 (allocator reclaim): main has it (31930d8, 057f463, 8e7b566).
  alloc_pool.rs is main's, with xcl-dev#867's changes on top; bind.rs takes main's
  native_backing; xcl-dev#2707's tests and bind::push_uma_for_test go.
- xcl-dev#867 + xcl-dev#2477 (Wine vtables and fences), adapted to main's new code:
  real.rs keeps the in-place patching, UnadoptGuard and FenceProxy beside
  main's native_queue_* helpers; guards in cl_reset, bind_pipeline_exact,
  clear_pipeline_exact, reset_pc_allocator, the title ExecuteCommandLists
  closure and native_queue_execute; Signal/Wait unwrap the title's fence
  (also in native_queue_signal/wait); list_x guards in
  reset_reserved_segment and KickoffX's submit closures; create_raw_fence
  for main's new internal fences in alloc_pool.rs (SubmissionGate),
  title_textures.rs, present.rs, vram.rs, sparse.rs, cpu_writes.rs; tests
  as xcl-dev#2477 had them; runner.rs is main's plus submit_list.
- xcl-dev#1803 (heap addresses): kept, carried into main's PreparedSplit and
  PreparedAbiState (prepared_abi_io takes the heaps).
- xcl-dev#1368 (NodeMask 0): kept in compute_container, before main's per-node
  blob names, so names and pipeline use node 0.
- xcl-dev#1860, xcl-dev#2082 (cfg.rs, module/opt.rs): cfg.rs is 1567f72's version
  (xcl-dev#1860 on main's Succs); opt.rs is that plus xcl-dev#2082's arm and test.
- xcl-dev#2229 (rodata): kept through main's kernel.rs entry points;
  translate_entry_rodata loses wave32_only as main dropped per-GPU tables
  (3cde0cc); pso.rs and coverage.rs call it with main's options
  (no_remap, split for graphics); recomp Options keeps rodata and no_remap.
- xcl-dev#1975: kept in emit.rs and lower_valu.rs; its mesh barrier guard and its
  test dropped, main's wider guard (2ca9127) covers it; the now-unused
  lower::has_non_uniform_barrier goes.
- xcl-dev#2070 (64 MB stacks): pso_async::WORKER_STACK on main's worker, helper
  and preload threads; shaders.rs's piece threads on worker_thread.
- xcl-dev#2551 (whole forms prebuilt): split_whole_roots(false) is DirectChain,
  so the precompile builds every split program's whole form; main built it
  only for programs an earlier run used through ExecuteIndirect.
- xcl-dev#688 (dxc.rs imports), xcl-dev#2762 (host.rs log line), xcl-dev#3090 (list_x tests),
  arch/window-title-commit (present.rs with_commit on main's
  compiling_text), README.md: both sides.
- list_x.rs: main dropped title_textures::list_reset; main's side.
- sparse.rs, vram.rs: main's quarantine_tiles_for and per-device retire
  state, with create_raw_fence.
- xcl-dev#3090, xcl-dev#3092 tests: runner::device and Uma::block_len added from
  nvidia-dev (5 and 12 lines) so the lib tests compile.
- xcl-dev#751: its commit is already in main (b84e037, via xcl-dev#2844); it leaves the
  README table with xcl-dev#2404, xcl-dev#2633, xcl-dev#2707, xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@afpruivo

Copy link
Copy Markdown

merge-check
base: a798017
head: 3567b2e
merge: clean (git merge without conflicts; git diff --check clean), but the result does not build
build: cargo build --workspace --release -> failed: crates\xcl\src\shaders.rs:2371:53 E0308, make_one expects PipelineRoot, found bool (self.make_one(&c.dxil, &c.samplers, true, None);)
tests: not run (no build)
review: Read the whole diff. The change itself is right on the base it was written for: after the pieces, the whole form is built under the dispatch-chain root signature, the cap and the cached-blob reuse apply as for a piece, and the runtime's Chain::whole builds the same c.dxil under dispatch_chain_root_signature, so the blob names match (for programs without static samplers; the offline path_for leaves samplers out of the name while the runtime includes them, which is the same for the pieces and not this PR's). Since it was written, main has changed make_one to take a PipelineRoot (e9389076 / 4cbefd18 / 8f075e85, "prewarm observed indirect split pipelines"), and make_selected now builds the whole form only when prewarm_indirect is set: split_whole_roots(false) returns &[]. So on current main the port of this PR is probably that function returning &[PipelineRoot::DirectChain] for false, plus the test updates; the author should check that this is still wanted given the history-based prewarm.
performance: not measured. By design one extra driver build per split program in the precompile (the PR says about 2 h at 6 threads for the whole pack with them); nothing changes at run time except fewer cold whole-form builds on the title's thread.
verdict: not yet: the merge with current main does not compile (make_one now takes PipelineRoot); needs a rebase onto main
hardware / tool and model: RTX 3090 24 GB, NVIDIA 621.40, i5-13600K, Windows 11 26300, rustc 1.99.1 / Claude Code (Claude Opus 5.5)

@github-actions github-actions Bot added area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation area:tests Unit, integration, e2e tests, or testtitle gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) labels Nov 30, 2026
@brainhay5

Copy link
Copy Markdown

merge-check claim
head: 3567b2e

@brainhay5

Copy link
Copy Markdown

merge-check
base: d52ff48
head: 3567b2e
merge: clean
build: cargo build --workspace -> failed
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> not run (build failed)
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: not yet: cargo build --workspace failed
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 3567b2e

main already prepares the whole form of a split compute program during precompile. Commits e938907 and 4cbefd1 (merged with #2959) build it in shaders.rs:make_selected under DirectChain and IndirectChain roots when the program was seen in an ExecuteIndirect (prewarm_indirect). split_whole_roots(false) deliberately builds nothing for the other split programs. This PR builds the whole form for every split program, under the direct chain root only. That no longer matches the cache namespaces the runtime uses for indirect dispatches, and it conflicts with main's choice to build only what was observed.
Recommendation: close (superseded by main commits e938907 / 4cbefd1).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:shaders Shader cache, PSO compilation, pipeline libraries, precompilation area:tests Unit, integration, e2e tests, or testtitle gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)

Projects

None yet

Development

Successfully merging this pull request may close these issues.