Repository navigation
Shaders: a title's preparation workers build split programs' whole forms - #2794
joeypercia wants to merge 1 commit into
Conversation
The workers that build a title's compute pipelines before it starts (pipelines_in_workers) run precompile without a startup state, and only with one does it build a split program's whole form. The title then built each whole form at the program's first ExecuteIndirect, on its own thread (Chain::whole): 15 - 25 s a program cold, 750 KB - 1.1 MB of DXIL. A retail title froze in its world load for minutes on them (RTX 5090, RTX 4070 Ti; KDenKC's finding and change, xcl-dev#2624). precompile now builds the whole form in a preparation worker too (XCL_PRECOMPILE_PARENT set). The first preparation takes longer; the title then finds the whole forms in the driver cache. Assisted-by: Claude Code (Claude Opus 5.5)
|
Independent Windows check of warm-cache reuse and recovery on
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, 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. |
|
Independent RTX 4060 Laptop (8 GB, DXC Tested
Diff Check (
|
|
Test report: on an RTX 4080 16 GB this removes the no-frame stretch at world entry. This is the stall I measured on Tested
Not tested
AI use: Claude Code (Claude Fable 5.2) ran this on the owner's machine and wrote the report. |
|
RTX 5080 16 GB on a small PC (i7-7700K, 16 GB RAM),
The table, the settings and what else differed between the two arms are in #2551 (comment). Not tested: this PR's own commit and its new test; more than one run per arm. AI use Claude Code with Claude Fable 5.2 wrote the local change, ran the passes and the runs and wrote this text. |
|
Independent test report under Wine/Proton (not native Windows) for head Tested
Retail title (release build, 2 preparation workers,
The head's cached run reused the partial cache its killed cold run left behind. The two cached runs therefore started from different cache histories, and their preparation times are not a clean comparison. Neither cached run crashed or lost the device. Chained split dispatches: 50 on base, 252 on head. Not tested
AI use
|
|
AMD Windows test report for head Tested
The one extra pass is the new
Not tested
AI use: Claude Code (Claude Sonnet 5.5) ran the tests and drafted this report. |
|
8 GB desktop NVIDIA, one run of Tested
Results
Not tested: warm-cache runs, repeats, the full suite, AMD. AI use: run, analysis and this report by Claude Code (Claude Opus 5.5), reviewed for accuracy against the run log. |
|
Thanks @3L1A5-1. A silent AI use: Claude Code (Claude Opus 5.5) wrote this reply. |
The 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 (xcl run: shader preparation in worker processes, only what earlier runs used; upstream main; sampler fix #2624):xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590):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, DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #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 (D3D12.X: a memory line by owner, against DXGI's budget #2697, D3D12.X: count the resources XCL makes for itself, by where it makes them #2750).AI use