Compile a title's queued pipelines outside the title (xcl pipelines) #750
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from ivall/xcl. Originally posted by oishigeso on 2026-11-24T04:43:47Z.
Problem. A retail title queues ~58 000 pipelines with console shaders in its first minute
(
pso_async, lazy). Every one is translated, compiled by DXC and then by the driver inside thetitle's process, at the latest when the title first binds it. #690 builds the pipelines an
earlier run used ahead of their first use, and #634 keeps compute blobs on disk. Both of those
work inside the title, from the second run on, and only for pipelines already used.
xcl shaders --precompile [--pipelines]covers single programs and compute pipelines from ashader package, but not the graphics pipelines (VS + PS + state, input layout, target formats)
the title creates. Those are only known at run time.
Proposal. The title writes the pipelines it queues to a journal
(
<data>\cache\pipelines.bin). A new command,xcl pipelines <game> [--watch], makes them inits own process: before the next run, or next to a running title. It fills the DXIL cache, the
driver's cache and #634's
driver_cache, so neither the title's process nor its threads do thatwork, including for pipelines no run has used yet.
Three stacked PRs:
prep_graphics: the PC desc of a translated VS / PS pipeline in its own function (no changein behaviour).
with the run's memory windows; pipelines the title built are marked as used. It is
append-only, written by one title process at a time;
XCL_PSO_JOURNAL=0turns it off.xcl pipelines: makes each pipeline on its own device as the title would (the title'sadapter, the used ones first), at below-normal priority on half the cores. It can be resumed,
and failures are retried. GS / HS / DS and mesh pipelines are left to the title.
Measured (RX 6700 XT, retail title, 60 s smoke runs, each with its own empty DXIL cache):
xcl pipelinesfor8 min into another empty cache. Run B with only that cache: 4 hits, 0 compilations in the
title. (Few in absolute terms: the title builds lazily, and 60 s ends in its loading screen.)
mainand the stack: exit 0x0, no crash or device removal, 395 / 479 frames.Is this a direction you would take? The three PRs are open as drafts (#757, #758 and #759, stacked in that order) and wait for your answer here. Written with Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by oishigeso on 2026-11-24T06:06:50Z.
A fuller measurement, as the first one counted only the 4 programs a 60 s run compiles before its loading screen.
For it, a local build of #759's head adds a read-only counter (
XCL_PSO_PROBE, not part of the PRs): on a thread of its own it checks, for every pipeline the title hands topso_async, whether its DXIL is already in the cache as the title would ask for it (same device, memory windows and wave width), without compiling anything. RX 6700 XT, Series S profile, a fresh data folder and DXIL cache per run, 60 s each:xcl pipelines, title closed, 10 min51210 done before.--watchnext to a running title.Written with Claude Code (Claude Opus 5.5); the runs were made on my PC.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-01T03:06:40Z.
A Linux data point for building in another process (NVIDIA 615.71.09, RTX 4060 Ti 16 GB, Wine 11.21 Staging, vkd3d-proton
master71cae091with local patches): the title did not find another process's driver compiles through the driver's disk cache, and did find them when they came as XCL's driver blobs.The driver keeps one disk-cache file per process and a process reads only its own (a small Vulkan test: 10.1 s again from another process's file, 4 ms from its own; 1 run each). Two title runs on a driver cache folder with no file of the title's had 25 % then 83 % of their large compiles under 0.3 s after the 16-worker launch pass, and 26 % then 80 % with
XCL_PREPARE=0. WithVKD3D_CONFIG=pipeline_library_app_cache,no_descriptor_heapvkd3d-proton's blobs hold the driver's data, and 173 of 176 and 178 of 181 large compute compiles with a blob supplied took under 0.3 s in the title (2 runs; 63 of 116 with the first setting alone, 1 run with the driver's disk cache on and warm). The details are in #2003 and #3067.Not tested: Windows, AMD,
xcl pipelinesitself (#759).AI use: Claude Code (Claude Fable 5.2) made the runs and wrote this.