Shaders: --precompile --pipelines also builds a split program's whole form #2551
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2551
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2551"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@DTsordas on GitHub · 2026-11-25 22:43 UTC · original
DTsordas:precompile-chain-whole→main· +27 −17 · 2 files · 1 commits · openxcl shaders --precompile --pipelinesnow 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 inChain::wholewithchained = 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 anExecuteIndirecton 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_pathbuildsc.dxilwithchained = true(the cap and the cached-blob reuse apply as for a piece). The unit test now expects the whole form's.chain.psotoo, 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_processcounts the whole form's blob with the pieces' (5 pieces + 1 whole form).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4at3567b2e: 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 onmaine1d84b7on this card; they are not touched here.d3d12SDKLayers.dll(3),f16_programs_on_the_gpuandf32_programs_on_the_gpuper-lane forms (6), no heap windows (1).main06c9f55+ 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
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
🤖 Generated with Claude Code
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590@futurepro62 on GitHub · 2026-11-25 22:54 UTC · original · edited 2026-11-25 23:03 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
3567b2e(on its basee1d84b7).Tested
cargo build --workspace, thenXCL_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.#[test]functions in the diff.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 #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #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 #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 #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 #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 #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on maine1d84b7too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 23:06 UTC · original
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 on GitHub · 2026-11-26 00:57 UTC · original
Independent Windows integration check of
3567b2emerged locally, without a commit, onto currentmain 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. Bothoffline_split_compute_pipeline_is_reused_by_a_second_processand the newly mergedsplit_compute_prefers_the_offline_whole_pipelinepassed.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 on GitHub · 2026-11-26 02:20 UTC · original
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
mainbinary throughout, only the cache differs.Setup
main08db802(+ #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.xcl shaders … --precompile --only cs --pipelines --used-onlywithXCL_DIRECT_DXIL=1, first frommain, then from this PR (3567b2emerged onto08db802, no conflicts). This PR's pass added 117 whole-form blobs (.chain.pso) next to the pieces, 2,666 pipelines, 0 refused.Result
mainhuge, ungated here, about 387 s in the driver)0x887a0005, DRED page fault at VA 0x0 with no allocations): the #2403 shader-heap limit, with no build in flight--used-onlylist (29 and 17 cold builds). Precompiling again after each run covers them. I did not check whether those were whole forms.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;
--precompilewithout--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 on GitHub · 2026-11-26 03:10 UTC · original
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 --pipelinesdriver 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
CreateComputePipelineStatetime and result to a file:mainb49be18;3567b2emerged onto it.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;main, PR, then PR,main).mainThe six extra pipelines are the whole forms of the six split programs in the set, built with
chained = true:84eee477d68b6fdfed2f8fa2e996c6a6b3618a0fd76af79cc6f8ee0f53ed5709d8435f454a510270b5cc5a57995e563bThe 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 on GitHub · 2026-11-26 05:13 UTC · original
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 targetx86_64-pc-windows-gnurun 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.
xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590@afpruivo on GitHub · 2026-11-26 11:13 UTC · original
On
nvidia-devaf2cecc4(RTX 3090), this PR merges cleanly. Without it, the title stops about 1 s after the world start, blocked inChain::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.AI use: Claude Code (Claude Opus 5.5) ran the runs and drafted this; checked by me before posting.
@tiagonleal on GitHub · 2026-11-26 14:04 UTC · original
Test report for #2551 on RTX 5070 Ti (Windows 11): no cold compute builds of whole forms after the world start in two runs, but both runs were cut by my RAM guard and one still stopped presenting for 32 s
This adds a 5070 Ti (NVIDIA profile, 1024 MB shader heap) next to the RTX 3090 report above. Two runs after the PR, three before.
Tested
3567b2efdc94617de71e50be77e107991a6bd41c(still the head when I checked), merged locally and cleanly (6843ee87) onto my base333eb126=nvidia-devaf2cecc4+ #2590 + #684. "Before" is333eb126without the PR. Neither is the PR's own base (maine1d84b7). Release builds.9cc6a39e), Series X profile, 300 s requested,XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_GFX_PSO_WAIT_MS=200 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PREPARE=0, A pressed at 15-100 s. Before each run:xcl shaders <pack> --precompile --only cs --pipelines --used-only. Memory guard on (free RAM < 1 GB, commit > 70 GB)..chain.psoblobs; 118 and 42 of those have 700 KB or more of DXIL in their file name, which I take as whole forms (inferred, not counted by the tool). Their own output was overwritten by later precompiles, so I have no "pipelines made" count for them.Not tested
--used-onlyonly knows programs that earlier runs reached, and x9 reached new ones.cargo testrun, no AMD, no run on the PR's own base.AI use
@imnicho on GitHub · 2026-11-26 14:54 UTC · original
RTX 5080 16 GB on a small PC (4 cores, 16 GB RAM),
nvidia-devaf2cecc4: with the whole form of every split program in the cache, no compute pipeline was built cold after the world start. 168 were created there, all from a driver blob, 165 of them whole forms. Building all whole forms took 4 h 17 min on this machine. One run per state.This adds a third NVIDIA card to the two reports above, and the cost of the pass without
--used-onlyon a slow machine.Tested
nvidia-devaf2cecc4+ #684 + the pool size of #2630. Not this PR's commit. A local change makes the same call for the same blob: inprecompile, after the pieces,make_one(&c.dxil, &c.samplers, true, None)for a program of two or more pieces, when the process runs as a worker of the launch preparation. So this measures the whole forms being in the cache, not this PR's diff.XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_TEXTURE_SAFE_READ=1 XCL_PSO_AHEAD=0 XCL_PREPARE=0 XCL_DRED=1 XCL_NETWORK=0, scripted A presses.--precompile --only cs --pipelinesover every compute program of the pack, no--used-only: 2,689 compute programs, 805 of them split into 8,073 pieces, 0 refused.0xc0000005in title code at 424 sCost of the whole-form pass here
.chain.psofiles.For
nvidia-devxcl runonaf2cecc4builds the whole form only in its in-process path (shaders.rs, thestartup.is_some()test afterp.make(&c)). Its worker processes, which are the default, run--precompile --only cs --pipelinesand leave it out. With this PR's change inmake_with_cache_paththe workers build it too.Not tested
main, AMD.XCL_GFX_PSO_WAIT_MS=100 XCL_PSO_IMAGE_SKIP=1 XCL_PSO_DISK_CACHE_MIN_MS=0 XCL_TWO_PASS_MB=2048and the 2,048 MB shader-heap profile of #2590, and the "before" run had neither. So only the compute rows can be put down to the whole forms.AI use
Claude Code with Claude Fable 5.2 wrote the local change, ran the passes and the runs, read the logs and wrote this text.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.