Shaders: a title's preparation workers build split programs' whole forms #2794
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!2794
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2794"
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?
@joeypercia on GitHub · 2026-11-26 13:34 UTC · original
joeypercia:shaders-worker-whole-forms→nvidia-dev· +57 −1 · 2 files · 1 commits · openThe workers that build a title's compute pipelines before it starts (
pipelines_in_workers) never build split programs' whole forms.precompilebuilds a whole form only when it has astartupstate, and the workers run it without one. The title then builds each whole form at the program's first ExecuteIndirect, on its own thread (Chain::whole): 15–25 s a program cold, for 750 KB – 1.1 MB of DXIL. With that, the newer retail title froze in its world load for minutes. @KDenKC found it and posted this change on #2624 as a suggestion, not a PR. This is that change, with a test.What is in it (one commit)
crates/xcl/src/shaders.rs:precompilealso builds the whole form of a split program in a preparation worker (XCL_PRECOMPILE_PARENTset, asworker_commandsets it).crates/xcl/tests/gpu_compute_e2e.rs:a_preparation_worker_also_builds_a_split_programs_whole_form. It runs the split program ofoffline_split_compute_pipeline_is_reused_by_a_second_processas a worker would. The precompile must make one pipeline more than the program has pieces, and keep a driver blob for each. Without the change it fails: "the whole form was not built" (7 pipelines with it, 6 without, for 6 pieces).What it does in the title (one run per arm each)
used-*lists (#2624):Chain::whole(symbolized thread dumps).The cost is a longer first preparation. Later launches find the whole forms in the driver cache.
Tested
XCL_ADAPTER=Radeon. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4, on this PR's head3c4891ddand on its baseaf2cecc4:texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_staystexture_upload::tests::pieces_hold_the_texels_of_their_levelsconsole_ms_in_as_slot_and_ms_with_as_are_refused_cleanlyasync_compute_pso_registers_real_pso_and_not_standintwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(RTX 4070 Ti, twice)fuzz_validate_and_gpu_1(RDNA2, #2115)... ok).Regression run
RTX 4070 Ti (driver 621.40), release builds, 60 s each,
scripts/smoke.ps1 -Game <folder> -Title retail-titleon the newer retail title, with the same settings. All three ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine. The game reaches no ExecuteIndirect of a split program in 60 s, so this checks that nothing else changes. Base and PR ran one after the other; the base's run shared the GPU with a test suite of mine for part of it.main (
b49be183, merge base ofmainandnvidia-dev):nvidia-dev (
af2cecc4, this PR's base):PR:
Not tested
af2cecc4together with my memory-report commits (#2697, #2750).AI use
@ettehn on GitHub · 2026-11-26 13:40 UTC · original
Independent Windows check of warm-cache reuse and recovery on
3c4891dd4cf7d249d7f818aec05c7150a347504a. The only local change was a synthetic test extending the six-piece fixture. Each row launched a freshxcl shadersprocess. The ordinary and worker arms began with separate empty XCL caches.All four runs reported zero refused pipelines. On Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop 12 GB (621.24), Rust 1.97.1 MSVC debug, DXC 1.8.2502.11,
XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64:4 passed, 0 failed, 0 ignored, no reported skips. This covers the worker CLI cache path with a synthetic shader. A retail title’s first ExecuteIndirect and the full workspace suite were outside this run.
OpenAI Codex assisted with the test and verification. The exact model identifier was unavailable in this session.
@retrope13 on GitHub · 2026-11-26 13:53 UTC · original
Independent RTX 4060 Laptop (8 GB, DXC
1.9.2602.17) full-suite verification and diff check of#2794(3c4891dd) against basenvidia-dev(af2cecc4): full workspace suite passes with zero new failures. No title was run.Tested
32.0.16.2140, wave32), Intel Core i5-14500HX (14C/20T), 24 GB RAM, Windows 11 26H2 (build26300.9818),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA.gpu_compute_e2e, debug):cargo test --locked -p xcl --test gpu_compute_e2e -- a_preparation_worker_also_builds_a_split_programs_whole_form offline_split_compute_pipeline_is_reused_by_a_second_process split_compute_prefers_the_offline_whole_pipeline --test-threads=1 --nocapture: 3 passed, 0 failed, 0 skipped (4.40 s).XCL_ADAPTER=Intel(Intel UHD Graphics, driver32.0.101.7092): all 3 cleanly reportedSKIPPED: no wave32 GPU.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4:af2cecc4: 1748 passed, 6 failed, 48 ignored#2794(3c4891dd): 1749 passed, 6 failed, 48 ignored (+1 new test, 0 regressions)nvidia-devfailures listed in the PR description).Diff Check (
af2cecc4..3c4891dd)recomp::pso::console_to_dxil_inroutes both cold translations andXCL_DXIL_CACHEhits through the sameOk(c)path inshaders.rs:2168-2178, wherep.make(&c)builds only the split pieces andp.make_one(&c.dxil, &c.samplers, true, None)builds the whole form againstdispatch_chain_root_signature.std::env::var_os("XCL_PRECOMPILE_PARENT").is_some()check atshaders.rs:2175matches the existing worker check atshaders.rs:2097.Not Tested
#[ignore]/SKIPPEDtests.AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the builds/tests, checked the diff, and drafted this report.
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.