PSO: xcl pso-precompile builds a title's compute pipelines before its run #1871
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!1871
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1871"
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?
@bmjask on GitHub · 2026-11-24 22:25 UTC · original
bmjask:perf/pso-aot→main· +251 −18 · 3 files · 2 commits · openA retail title's world load creates hundreds of compute pipelines, several of them 0.3 – 1.6 MB of DXIL that take NVIDIA's compiler 15 – 170 s each. Compiled cold during the run, the title's binds wait for them or run without them, and its loading never finishes.
xcl pso-precompilebuilds them before the run. It translates the title's compute programs from its shader package and has the driver compile each pipeline the way the runtime does (same DXIL, XCL ABI root signature with the program's static samplers, flags). It writes the blob to thedriver_cachefile the runtime reads, so the run loads it instead of compiling.What is in it
xcl pso-precompile <game folder | shaders.rpf> [--threads N] [--records FILE] [--used]:shaders --precompile --pipelinesof the folder'sshaders.rpf.used-pipelines.txt) go first, and within each group the biggest go first, so the longest compiles don't start last.--threads,XCL_PIPELINE_THREADS, or one per core but at most one per 2 GB of RAM (was 4).--records FILE(record hashes as the runtime's "driver compile start … record H" lines name them, or pipeline keys) and--usedrestrict the pass to those programs. A whole retail pack is 26,503 records. The set the load needs is a few hundred.XCL_DIRECT_DXIL/XCL_HEAP_WINDOWSchange the translation keys, so the warm-up must run with the same values as the game.used-pipelines.txtparsing, shader package lookup, record / key selection.Numbers (RTX 4090, 24 driver compiles at once,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1)--threadsis probably better and is not measured yet.Tested
cargo test --release -p xcl --lib pipeline_tests: 5 passed.Regression run
XCL_PRESS_AT=2:B,4:B,6:B,8:B,XCL_PRESS_A_AT=10,20,…,60main:
PR:
Not tested
cargo test --workspacesuite. Whole-pack warm-up time (26,503 records). AMD / Intel GPUs. The HLSL path's warm-up for the full load set (its translations are far slower).AI use
🤖 Generated with Claude Code
@WebIdentity1 on GitHub · 2026-11-24 22:42 UTC · original
RTX 3090 full-suite check and a small
--recordsoperand fix for exact head27362a08509c7dd79f7eebdf39c4ad29e98e4d6f. Windows 10 19045, driver 591.74, Rust 1.98.1 MSVC;XCL_ADAPTER=3090, direct-DXIL and REQUIRE_GPU unset. Synthetic fixture only.Tested
cargo build --locked --workspace: exit 0 on the exact head and on the head plus the local patch.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: exact head 963 passed / 1 failed / 43 ignored, candidate 964 / 1 / 43, across 20 targets, 25 explicitSKIPPEDlines on each. The only failure on both was the knowngpu_clamp_and_omod_per_instructionon this adapter; no candidate-only failure.pso_precompile_rejects_records_without_a_file: 0/1/0 with the head's runtime, 1/0/0 with the local fix. An empty 64-byte synthetic RPF header made this safe: bare--recordsexits 0 on the head and falls through to the unrestricted selector (precompiling 0 shadersfor this empty fixture). With real records that would select the whole pack. The fix reuses the existingrequired("--records")check, rejecting bare--recordsand--records --usedwith exit 2 and a missing-value error.The three 303-file source snapshots matched their SHA-256 manifests before and after native Windows runs. This PR head is still behind current
main689f2db; the paired suite above is head versus head+patch, not a current-main integration test. No code commit or competing PR from me; this patch is for the author to incorporate:Two-file patch (28 insertions, one deletion)
Not tested: retail smoke, whole-pack precompile time or memory, runtime cache reuse, and gameplay. This is a bounded CLI regression, not merge readiness.
AI use: Codex desktop (GPT-6) wrote the test and local patch, ran the Windows checks and drafted this report; results are from retained raw logs.
@Alm0stSurely on GitHub · 2026-11-24 22:55 UTC · original
Tested on Proton Experimental with the HLSL backend. The title reused the offline blobs when paired with #1368. Both runs reached illustrated loading and showed black at 105 and 240 s.
I applied the three-file diff from this PR at
27362a08509c7dd79f7eebdf39c4ad29e98e4d6fto main689f2db477c3c062cf162649781640ef8a977c18to keep the shader translator identical between preparation and playback. The comparison used the same diagnostic runtime on main, first as-is, then with #1368 at0074749a9678a697455c48a95f7c4f746ccd602e. EndeavourOS, Ryzen 9 9950X3D, 60 GiB usable RAM, RTX 5080 / NVIDIA 620.73.04, Proton Experimental, vkd3d-proton 4522cc1 / dxil-spirv 53aac418 with the local dominance-performance patch, DXC 1.9.2609.5.xcl pso-precompile <shader-package> --records records.txt --threads 4. The file contained 262 unique compute records previously observed without a driver blob.XCL_DIRECT_DXIL=0 XCL_COMPACT_CS=auto, four memory windows, split wave64. Translation reported 247 compute jobs and zero errors. I stopped preparation after more than 10 minutes. Of 245 distinct matching translations in the fresh cache namespace, 244 had a nonempty driver blob. The 29,215,780-byte DXIL program still had none.xcl <title-exe>, same backend, driver, 45-key preload history andXCL_RUN_SECONDS=240, independent copies of the same partially warmed XCL/vkd3d/NVIDIA caches. On main, 204 selected records had a supplied blob refused and 18 had none. With #1368, 242 selected records completed with a supplied blob and no cold retry, and 18 had none. For all 203 records supplied in both runs, refusal changed to acceptance. The precompiled and runtime-rewritten blobs checked had the same filename and different compute state hashes consistent with NodeMask 0 versus 1 at flags 0.One playback per configuration. This measures blob acceptance and the observed screen; full-pack preparation, linked adapters, and native Windows were outside this test. Investigation, log analysis and report assisted by OpenAI Codex (GPT-6.2 Astra).
@Kalmarv on GitHub · 2026-11-24 23:15 UTC · original
A test note from a run on an RTX 5070 Ti (NVIDIA), of our own precompile pass (the same approach, not this PR's code). It concerns which programs a
shaders.rpf-only input can cover.In a 300 s title run after a pass over 1,957 compute programs, 60 compute programs the title created had no translation and no driver blob:
shaders.rpfat all. They are DXBC containers inside the title'sXboxBvhBuilder.dll(it holds 52; the run created 31).pso-precompilereads onlyshaders.rpf, so it cannot cover them, and with--usedtheir keys appear inused-pipelines.txtbut no record matches. Cold, on their own, they took a median of 119 ms and at most 7.0 s each, 20 s in all. That is small, but they are still compiled during the load.shaders.rpf(27CS_…Classified0…26_…_Wrappedrecords of one effect plus twoCS_RaytracingResolve_…_Wrapped). Our pass missed them only because its input list came from an older inventory. A whole-packpso-precompilewould include them, and so would--usedafter a run that created them. They include the two slowest programs of the load (1.14 MB and 1.21 MB of DXIL: 14.6 s and 24.2 s cold).A suggestion: also take the DXBC containers of the title's DLLs (or of
XCL_DUMP_SHADERSdumps), or at least report the--usedkeys that matched no record, so a warm-up that looks complete isn't missing programs without saying so.Tested: RTX 5070 Ti, Windows 11 26200, DXC 1.7.2308 (Windows Kits),
XCL_HEAP_WINDOWS=1; one title run plus a precompile of the 60 from the run's cache records.AI use: Claude Code (Claude Opus 5.5) ran the pass and the title run on our machine and wrote this.
@thehollowedone on GitHub · 2026-11-24 22:32 UTC · original · edited 2026-11-24 23:21 UTC
Independent check of 27362a0 on an RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC debug.
I generated a two-record synthetic shader package and ran
xcl pso-precompile <folder> --threads 1 --records <file>in fresh processes withXCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1. A nonmatching hash made zero pipelines. Selecting one record with an empty XCL cache built one pipeline and saved a 1,530-byte driver blob. The warm run loaded one pipeline from that blob, compiled zero in the driver, and left the blob byte-for-byte unchanged. Zero refusals across the three runs.cargo build --offline --locked -p xclsucceeded.cargo test --offline --locked -p xcl --lib shaders::pipeline_tests:: -- --nocapture --test-threads=1passed 5/5, with zero skips. This report covers record selection and reuse by the precompile command itself.AI-assisted. Codex (GPT-6 family, exact variant unavailable) generated the synthetic fixture, ran the checks, and drafted this report.
Runtime cache check
On the same revision and hardware, I also passed a synthetic compute shader through the runtime's public
CreateComputePipelineStatehook in two fresh processes. The empty-cache control created the translated PSO without a blob. Afterxcl pso-precompile <folder> --threads 1 --records <file>seeded a separate cache, the runtime supplied the blob on its first attempt, recorded one disk-cache hit and made the translated PSO without a retry. The driver blob stayed byte-for-byte unchanged. Both runs used split wave64 and four descriptor-heap memory windows.The scratch test
scratch_precompile_to_runtime_compute_pso, built withcargo test --offline --locked -p xcl --lib, passed 1/1 in each process with zero skips. The check covered pipeline creation.AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the scratch test and drafted this update.
Selection coverage check
Following Kalmarv’s report, I tested a synthetic pack with three requested keys. Two keys referred to the same compute shader, and one key had no match. The current PR head built one pipeline and exited successfully without reporting the unmatched key. A local test build counted 2 of 3 keys matched for
--records, 1 of 2 for--used, and 2 of 3 when combined. All three runs still made one pipeline. Filtering out compute with--only PSgave 0 of 3 matches and made zero pipelines.Same Windows 11 and RTX 3080 Ti setup.
cargo test --offline --locked -p xcl --lib shaders::pipeline_tests:: -- --nocapture --test-threads=1passed 5/5. The CLI runs usedxcl pso-precompile <folder> --threads 1with the selectors above. Synthetic inputs only.AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote the local change, ran the tests, and drafted this update.
@Filip722 on GitHub · 2026-11-24 23:31 UTC · original
The selective precompile worked across separate Proton processes on an RTX 5060 Laptop GPU (8 GiB), NVIDIA 615.78.08, Bazzite 44 and Proton Experimental 11.0-20261112. I used the record selector from this PR ported to main
689f2db, one compiler, and a custom vkd3d-proton build based on4522cc1. Both offline passes usedpipeline_library_app_cache.The seven selected compute pipelines took 120.4 s in the cold driver stage. The warm stage took 0.3 s, with seven cache hits and zero refusals. All seven blobs contained both inline SPIR-V and Vulkan cache data (18,011,104 bytes total). This exercised the underlying record selector on seven private inputs. Six were also found in the shader archive.
A separate offline title run using the same app-cache mode and the saved blobs on a composite XCL build reached six of those records before the host froze. Their six logged driver calls completed in 1–120 ms. That title run ended with a manual power cycle during loading. Gameplay and the cause of the freeze remain unverified. Only the offline cold/warm timings above are a matched comparison.
OpenAI Codex assisted with these tests and the report.
@DavidM1911 on GitHub · 2026-11-25 01:45 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@JJAutoCompare on GitHub · 2026-11-25 03:08 UTC · original
PR #1871 compatibility verification
Tested detached head
27362a08509c7dd79f7eebdf39c4ad29e98e4d6fon STOR-WINLAB. The offline compute cache integration test passed on Arc. The workspace suite had 19 failures, and the new subcommand's--helpinvocation exited 2.Environment
Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32,
DoublePrecisionFloatShaderOps=0). DXC/DXIL 1.9.2609.5, rustc 1.100.0 (0ef1bc386 2026-11-09), dev/test profiles without debug info,XCL_ADAPTER=A770.Tested
cargo build --workspaceandcargo test --workspace --no-runsucceeded.cargo test -p xcl pipeline_tests -- --nocapturepassed all 5 new tests, covering package lookup, record and pipeline key selection, used-key parsing, job order, and thread limits.cargo test -p xcl --test gpu_compute_e2e offline_compute_pipeline_is_reused_by_a_second_process -- --nocapturepassed (1 passed, 0 skipped) under the Arc lock. The synthetic shader exercised the sharedshaders --precompile --pipelinespath: cache write, reuse in a second process, and rebuild after cache corruption.xcl --helpexited 0 and listed the new command and options.xcl pso-precompile --helptreated the flag as a path and printedno shaders.rpf in --help.cargo test --workspace --no-fail-fast -- --test-threads=4exited 101. Across 20 result blocks, libtest reported 945 passed, 19 failed, 43 ignored. The log contains 22SKIPPEDlines, which represent no coverage for the skipped paths. All 6 focused tests passed again.Failures and skips
0x80070057, including FP64 cases. Four other GPU assertions failed on fused FMA, sampling LOD, the FP16 high half, and pixel-wave reductions. The test title failed the dynamic depth-bias check.Not tested
Retail
shaders.rpfthrough the new subcommand, retail title smoke or startup timing, main baseline, other adapters, and the D3D12 debug layer (d3d12SDKLayers.dllabsent).XCL_SAMPLE_*inputs were unset.AI use
T3 Code / Codex (
gpt-6.2-sol,reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified counts againstpr1871-suite.logand published this report.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.