Repository navigation
Tests: measure distinct pipeline library scaling - #3055
Merged
Prime1997 merged 24 commits intoNov 28, 2026
Merged
Conversation
The driver builds about two pipelines at a time for one process, so the preparation before a title (xcl-dev#2555) stood for minutes on each stretch of large compute programs. The stages are still translated in the host; the compute pipelines are built by worker processes of the same program, each on its own slice of the records: the processors less two, 16 at most, 3 GB of the commit left for each (XCL_PREPARE_WORKERS; 1: as before). With a list of the pipelines an earlier run used, only those are built before the title starts. A worker that fails is logged and the title starts; a worker ends when the host does. A worker reports every record while a title waits on it, and the host logs its progress every 5 s. Measured on a retail title, RTX 5090, 32 threads: the first 92 % of the steps in 85 s (one process: 84 % of one pass after several minutes). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… record The two passes were added up (twice the records), and a worker's count moved every 200 records, so the screen stood on one number for many minutes. The workers' pass has its own heading and count, a worker reports every record, and the line under the bar says a large pipeline is compiling. Workers: the logical processors less four. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A run keeps the shaders of the pipelines it uses, each by its own key (used-shaders.txt beside the DXIL cache). With that list the preparation before a title translates only those records; the title translates another when it first uses it. XCL_PREPARE_ALL=1: every record, as without the list. XCL_PREPARE=0: no preparation, the title builds what it uses as it goes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Records with the same program are in several workers' slices. Each worker found no driver blob and built the pipeline: the driver's compile of one took about twice as long in each of four workers that built it at once, and a worker that had waited for its turn built what another had written to the cache meanwhile. A worker claims a pipeline with a file beside the blob it will write (<blob>.claim) and removes it when the build ends; a worker that finds the claim leaves the pipeline, and the cache is read again after the wait. A claim left by a process that died is taken over after 30 minutes. The count of pipelines left to another process is printed with the others. Reported by a tester who logged what each worker compiled. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The shader preparation before a title starts builds the compute pipelines earlier runs used, but no graphics pipeline: what is kept between runs is not enough to make one again. used-pipelines.txt holds only the key of a pipeline's shader set, and the driver cache holds blobs named after the translated DXIL and the description's hash. A retail title then builds ~6 000 graphics pipelines in its first minutes, with thousands of stand-ins that draw nothing meanwhile. A lazy graphics pipeline's description is now written down at its first use in a run (pso_async::on_first_use, told once, as used::note is): every field of the description but its pointers, its input layout, and the keys of its console shaders, ~200 bytes, under the key used-pipelines.txt has. The entry is made when the pipeline is (no shader copy is kept for it after its build) and written by a thread of its own, each description once, to used-graphics-pipelines.bin beside the DXIL cache (gfx_records: the format is in the module's comment). The file is versioned (another version reads as none and is started again), an entry cut short or damaged ends it, and it stops at XCL_GFX_RECORDS_MB (64) with a line in the log. No shader code is kept: the preparation finds the shaders in the title's shader files by key, as it does for used-shaders.txt. Mesh pipeline streams are not recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retail title's world lost the device with reason 0x887A0005 (no driver error, DRED state 0, no list in flight) at 23 to 26 GB of video memory and 46 to 49 GB of process memory, on a PC whose other programs held 71 GB of commit under a 147 GB limit. The sum looked like the limit; nothing in the log could say. - The memory line ends with "system commit N of M MB", and a removal reports it too. Measured with it: 30.8 GB were left at the removal, and the system's commit follows the process's own memory, not its video memory - the commit limit is not what removes the device (it is the driver's 512 MiB range for the code of pipelines in use, xcl-dev#2403). - A warning when less than 8 GB of commit are left (once, then at each halving): there allocations start to fail for every program. Tests: the rule of the warning; the commit is known and under its limit. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
After the compute pass, the shader preparation now reads the graphics pipeline records of earlier runs (used-graphics-pipelines.bin), finds their console shaders in the title's shader files by key, and builds each pipeline in worker processes, the way the title's background build makes it (real::prepare_graphics calls translated_graphics_pso, as build_graphics does): the translation, DXC and driver blob caches on disk then hold exactly what the title asks for, and the title makes these pipelines from the kept blob in milliseconds instead of compiling them while it draws stand-ins. Worker processes, as for the compute pipelines: the driver builds about two pipelines at a time for one process, and a driver that ends a worker ends no title. Nothing of the title's device is needed: a translated pipeline gets XCL's root signature, and what else its build reads of the process is the title's memory windows (given with --windows, no memory reserved: uma::leave_out, pso::set_title_windows) and the adapter (XCL_ADAPTER from the title's setting). Each worker gets a file of its part with the shaders it needs (gfx_records' format) in the temporary folder, removed after. The title did not keep the blob of most graphics pipelines: none of under 16 KB of DXIL and none built in under 250 ms (XCL_PSO_DISK_CACHE_MIN_MS), so most were compiled again in every run. A preparation worker keeps every blob, on disk only. The blob's file name is made of the description's state, the DXIL, the adapter and driver and the window count, no address, so the title's lookup finds the worker's file. The screen shows "Building graphics pipelines" with its own count, the 5 s line counts graphics pipelines, a failure is logged and skipped and the title starts regardless. XCL_PREPARE=0 skips it with the rest, XCL_PREPARE_GRAPHICS=0 skips this pass only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record supported console mesh streams with their fixed-function state and source shader keys. Replay through the existing graphics worker and two-pass translator to populate the runtime driver caches. Keep legacy graphics history compatible and leave unsupported streams to the existing runtime path.
Resolve shader and fixed-state selectors using a local layout profile. Publish a deduplicated native preparation job only after its recipes and shader references have been validated.
Share native replay between an offline CLI and the launch gate. Count successful recipes, propagate driver failures and cancellation, and scope recorded history to each title. Draw progress in the presentation window while workers prepare graphics, mesh and compute pipelines.
Avoid decoding the entire graphics job in both the launcher and worker. Validate the independent worker completion count and reject incompatible corpus configurations. Preserve cache reuse for inert mesh shader slots and cover the headless launch gate.
Match shader bytes and full graphics descriptors against the mandatory staged job. Keep distinct fixed-state variants and resolve their shader inputs from the staged corpus. A 48-recipe overlap fixture removed 48 redundant native submissions before the staged pass.
Limit record slicing to offline workers. An inherited slice from an earlier CLI run must not make the launch gate overlook an unstaged shader.
Use the intact prefix of optional history and defer records whose sources are still missing. Published worker jobs retain strict checks. Adapt the history reader regression contributed by thehollowedone.
Bind startup proofs to the driver, translation and pipeline ABI. Reuse only matching DXIL and validated native files, including both mesh passes. Restore the opt-outs for optional history and unstaged startup preparation while requiring published jobs to finish.
Exclude worker scheduling and observation settings from the preparation identity. Normalize Windows environment variable names, and report how many staged graphics recipes reused their existing native verification.
Add an internal owner for serialized D3D12 pipeline libraries and focused synthetic coverage for compute, graphics, and mesh state streams. The owner retains the input storage because CreatePipelineLibrary does not copy it. A 256-name synthetic library serialized to 47,888 bytes and reopened in 99 microseconds on the test adapter. Assisted-by: Codex (GPT-5)
Create a new D3D12 pipeline library with the API-mandated null blob pointer and zero length instead of Rust's non-null empty-slice pointer. Windows accepts both forms, while Wine correctly rejects the latter with E_INVALIDARG. Tested with the four native pipeline-library round-trip tests on an RTX 4090. Assisted-by: Codex (GPT-5)
Publish a SHA-256 identity with atomically staged pipeline corpora and expose it to the runtime. Add a pipeline-layout source identity that deliberately excludes compiler, profile, optimization, and diagnostic build inputs while preserving the existing preparation key. Existing corpora without the new identity remain readable and can take the conservative preparation path. Assisted-by: Codex (GPT-5)
Collect successful standalone compute, graphics, mesh and two-pass compute PSOs into process-local D3D12 pipeline libraries. Graphics and compute publish separate pending libraries because preparation crosses a process boundary. Verified-blob shortcuts remain unchanged outside an active library build. During library construction they replay cached PSOs once so StorePipeline receives the native objects. Unsupported drivers retain the existing preparation path. Assisted-by: Codex (GPT-5)
Publish validated graphics and compute pipeline-library bytes with a semantic receipt after corpus preparation completes. On an unchanged corpus, adapter, driver, translation layout, and runtime memory configuration, validate the serialized libraries and bypass title shader parsing and PSO preparation entirely. Interrupted, corrupt, incomplete, or stale artifacts fall back to the existing preparation path. Tested with focused receipt, native-library, and warm-settings tests on an RTX 4090. Assisted-by: Codex (GPT-5)
Activate validated graphics and compute pipeline libraries on the runtime D3D12 device, then lazily load standalone compute, conventional graphics, depth-bounds, mesh, geometry, and hidden two-pass compute PSOs by their stable preparation names. Stripe same-name loads for thread safety and preserve the existing driver-blob and compilation paths on every miss or rejection. Tested with focused receipt, pipeline-library, and two-pass tests on an RTX 4090. Assisted-by: Codex (GPT-5)
Build, store, serialize, reopen, and individually load 32 distinct synthetic compute PSOs. Report cold construction, serialized size, library open time, and aggregate lazy-load time so the native-library path has repeatable scale evidence without title data. Tested on an RTX 4090: 32 entries, 19,192 serialized bytes, 41-44 us open, and 148-183 us to load all entries across two runs. Assisted-by: Codex (GPT-5)
bmjask
force-pushed
the
shaders/pipeline-library-scale-tests
branch
from
November 27, 2026 19:44
6e95c83 to
a19c48b
Compare
Prime1997
marked this pull request as ready for review
November 28, 2026 01:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3054, #3053, #3051, #3046, #3045, and #2829. ## What and why The native-library path needs synthetic scale evidence that distinguishes many real PSOs from many aliases of one PSO. This fixture creates distinct DXIL and distinct compute pipeline objects, then measures serialization and lazy reuse without title data. What is in it - A 32-entry synthetic compute corpus with distinct shader programs and PSOs. - Round-trip validation that every named entry loads after serialization and reopening. - Reported cold construction, serialized size, open latency, and aggregate load latency. Tested Commit
6e95c83a, Windows 11, NVIDIA RTX 4090: -cargo test -p xcl --lib pipeline_library -- --test-threads=1 --nocapture: 6 passed, 0 failed, 0 ignored, 0 skipped. - Two scale runs produced 19,192 serialized bytes. Library open took 41-44 µs; loading all 32 distinct PSOs took 148-183 µs. Cold synthetic construction took 87-145 ms. - Full-stack heade475c76f, Windows 11, NVIDIA RTX 4090:cargo build --workspacepassed;cargo test --workspace -- --test-threads=4passed 1,510 tests in 38 suites, with 0 failed, 47 ignored, and 26 explicitly reportedSKIPPEDcapability tests. Regression run Not run. Repository policy requires a real-title smoke pair here, while this task explicitly prohibited launching a retail title. No smoke block or result has been invented. Not tested - A real-title regression smoke pair or a full real corpus (explicitly prohibited for this task). This remains a draft until the complete stack is validated. AI use Codex, GPT-5 implemented and reviewed the test and ran the commands reported above.