Shaders: speed up startup preparation with dynamic LPT workers #2906
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2906"
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 saintwolf on 2026-11-26T22:36:18Z.
Speeds up startup shader preparation on NVIDIA GPUs by removing static-slice tail stalls, pack-RAM duplication across workers, and under-utilized pipeline concurrency. Rebased onto
main(beeb81be) after thenvidia-devmerge.What is in it
crates/xcl/src/gpu/pack.rs:Pack::seek_read(random-access single-record read viaFileExt::seek_read) andPack::record_lenso workers read individual records on demand without loading the entire shader pack into memory.pack::name_stageto require an explicit_separator and non-empty suffix (<STAGE>_<nonempty>) so non-canonical names likeAsset01fall through to container inspection rather than colliding withAS.crates/xcl/src/gpu/recomp/dxc.rs: addsset_memory_reserve(gb)soprepare_for_launchcan temporarily lower the DXC commit reserve (restored via RAII before title start).crates/xcl/src/shaders.rs:ComputeCoveragemap is active) with dynamic LPT (largest-first) work-stealing over a single shared--compute-workerjob stream (0 MBpack RAM per worker), usingPipelines::prepare_compiled_compute+warm_blobsand propagating translation, refusal, andXCL_PIPELINE_MAX_KBsize-cap failures back to launch preparation.XCL_PIPELINE_THREADS=2and addscompute_worker_countconvertingsystem_commit()bytes to MiB, reserving 4 GiB for the OS/parent, budgeting1 GiB + 2.5 GiB * per_workerper worker (6 GiBat 2 threads/worker), and capping the automatic default at 4 workers (override withXCL_PREPARE_WORKERS) so high-core machines do not exhaust RAM/commit.precompile()andgraphics_in_workers()largest-first (LPT), deduplicates identical blobs inprecompile()after--onlystage filtering, lowersdxc::set_memory_reserve(2)duringprepare_for_launch(restored to 6 GB via RAII before title start), and routesMSthroughconsole_mesh_inwhenXCL_DIRECT_DXILis enabled — falling through to the per-program loop onincomplete translationso mixed containers still prepare supported variants.parse_compute_job_accepts_three_numbers_and_rejects_malformed,compute_worker_count_saturates_cpu_within_commit_budget,a_valid_canary_does_not_hide_a_second_stale_compute_blob, and stage-prefix edge-case assertions ingpu::pack::tests.crates/xcl/tests/gpu_two_pass_cache_e2e.rs: addsmixed_mesh_preparation_keeps_supported_variantsregression test for mixed incomplete + supported mesh containers.Tested
32.0.16.2140), AMD Ryzen 7 7800X3D (8 cores / 16 threads),rustc 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL1.8.2502.11.cargo test -p xcl --lib shaders:: -- --test-threads=1: 66 passed, 0 failed, 0 ignored (1 skipped:pso_measurement_compiles_an_exact_synthetic_record, Developer Mode required).cargo test -p xcl --lib gpu::pack:: -- --test-threads=1: 4 passed, 0 failed.cargo test -p xcl --test gpu_two_pass_cache_e2e mixed_mesh_preparation_keeps_supported_variants -- --test-threads=1: 1 passed, 0 failed.XCL_DIRECT_DXIL=1, isolated caches, prior head):4w × 1tstatic modulo slicing: 315.3 s4w × 2tLPT: 167.8 s (1.88× faster;8w × 2tmeasured 229.9 s due to SMT/L3 thrashing on 8 physical cores, confirmingcores / 2as the sweet spot).Regression run
main:PR head (
XCL_DIRECT_DXIL=1,XCL_PREPARE=0,XCL_PSO_PRELOAD=0):Not tested
.dxbcfolder inputs forprepare_for_launch(pack path tested).AI use
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T22:52:13Z.
On exact #2906 head
5224220c59262488b7bde3f15a1ddba968c054f1, the warm-cache shortcut can count a damaged compute PSO as prepared. After one cached blob passes D3D12 validation,Pipelines::make_onetreats every later nonempty, in-cap file as reused without reading or validating it. The compute cache filename includes the DXIL hash, size and flags, but no driver or adapter identity. A mixed or damaged cache can therefore pass the one canary while another entry is unusable. The runtime may rebuild such an entry at first use; I did not measure that in a title.I added a synthetic two-PSO test using a temporary cache and the NVIDIA D3D12 adapter. It warms distinct A and B, replaces only B's file with nonempty invalid bytes, then creates a fresh
Pipelinesinstance and prepares A followed by B. On the unchanged PR code,cargo test --offline --locked -p xcl --lib a_valid_canary_does_not_hide_a_second_stale_compute_blob -- --test-threads=1 --nocapturefailed: 0 passed, 1 failed, 0 ignored, 0 skipped. B stayed damaged whilemade=2, reused=2.The small candidate below restores per-entry native validation while retaining this PR's worker scheduling and LPT changes. With it, B was repaired and
made=2, reused=1; the test passed 1/0/0/0.cargo test --offline --locked -p xcl --lib shaders:: -- --test-threads=1passed 18/0/0/0. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, rustc 1.99.1 MSVC, DXC/DXIL 1.8.2502.11. No game files were used.Restoring validation removes the reported 2.27 s warm-cache shortcut, so that timing needs a new measurement if this approach is adopted. A future skip path would need validity established per entry for the current adapter/driver, rather than inferred from one other blob. I have not run the full workspace suite or paired retail smoke for this local candidate.
Candidate correction and regression diff
AI use: Codex (GPT-6.2 Sol) traced the cache path, wrote and ran the regression and candidate, and drafted this report.
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-27T00:15:58Z.
Good catch — thank you for the concrete repro. Removed the
cache_verifiedcanary shortcut in023395aeso every cached compute.psoblob is validated per entry through D3D12 (keeping the dynamic LPT work-stealing,seek_read0 MB pack RAM,cores / 2worker scaling, andXCL_PIPELINE_THREADS=2cold-prep improvements intact).Added
shaders::pipeline_cap_tests::a_valid_canary_does_not_hide_a_second_stale_compute_blobcovering this exact scenario (made=2, reused=1, damagedBrebuilt on disk), verifiedcargo test -p xcl --lib shaders:: -- --test-threads=1(18 passed, 0 failed, 0 ignored, 1 skipped for Developer Mode), re-ran the 60 s regression smoke on023395ae, and updated the PR description accordingly. Any future warm-cache skip can be tackled separately with per-entry adapter/driver-keyed validation.Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T00:21:55Z.
The new dynamic worker count has the same byte/MiB mismatch as the older worker selection tracked by #2705. On
023395ae,host::system_commit()returns bytes. The dynamic caller passes that difference directly tocompute_worker_count, which divides by 1,536 MiB. The unit test calls the helper with values already in MiB, so it misses the caller mismatch.I compiled the exact helper from this head on Windows and fed it synthetic commit snapshots using the caller's units. With 16 logical CPUs, 2 pipeline threads per worker and 3 GiB free, the current call selects 4 workers versus 2 after converting the bytes to MiB. At 512 MiB free it selects 4 versus 1. No system memory pressure was induced. A shared bytes-to-MiB conversion at both host-commit call sites, plus a test starting from bytes, would cover this path without changing the explicit
XCL_PREPARE_WORKERSoverride.The clean head also passed the
shaders::filter on native Windows / RTX 5070 Ti Laptop (driver 621.24, Rust 1.97.1 MSVC, DXC 1.8.2502.11), including the stale-blob regression. Harness totals: 18 passed, 0 failed, 0 ignored, with one of those 18 returning early becauseXCL_SAMPLE_RPFwas unset. OpenAI Codex (6.2sol) assisted with verification.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T00:35:53Z.
Tested: Clean
023395ae4cec59763b37334c2e6b51058643794e, Windows 11 build 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 MSVC debug. Ranxcl run <synthetic-title-folder> -- --helloon exact head and parenteae015021c639866ab061cdff2e9daf8ba9daac5, with fresh caches, Arc A770, Direct DXIL, two worker processes, two pipeline threads per worker and startup graphics preparation off. Both produced the same eight driver-cache filenames and zero worker failures. The head reported eight unique jobs from a 12-record pack containing four duplicates. In this matched rerun the worker phase took about 1.43 s on parent and 0.33 s on head. Both launchers exited 1 on the same syntheticRSSetDepthBiasXpixel check, and both skipped optional voices because no audio device was available.Not tested: Retail performance, automatic worker sizing under pressure, startup graphics preparation, and the full suite.
AI use: T3 Code / Codex (
gpt-6.2-sol) ran and reran the checks and drafted the report.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:07:33Z.
On head
023395ae4cec59763b37334c2e6b51058643794e, changingXCL_PREPARE_WORKERSchanged whether startup enforced the explicit pipeline size cap.I built the unmodified head with
cargo build --locked -p xcl --bin xcland ranxcl run <synthetic-title> -- --hello. The repository test title contained a syntheticshaders.rpfwith one valid compute shader, 64 threads per group, and the instructionss_mov_b32ands_endpgm. The DXIL was 4,452 bytes. Both runs used fresh, separate data and shader caches,XCL_PIPELINE_MAX_KB=1,XCL_PIPELINE_THREADS=1,XCL_PREPARE_GRAPHICS=0, andXCL_PSO_DISK_CACHE_MIN_MS=0.1 compute pipelines doneand zero failed workers.The expected driver blob was absent in both capped runs. With the default cap and a fresh cache, the standalone pipeline command created one native pipeline and its driver blob for the same pack. The worker currently acknowledges each input line after calling
pipelines.make, including when the size cap prevents creation. Reporting capped jobs separately and propagating that status to launch preparation would make the two paths agree.All inputs were synthetic. The test covers the startup preparation gate. Retail title behavior was outside this run.
AI use: OpenAI Codex (GPT-6.2 Astra) generated the synthetic pack, ran the controls, inspected the source, and drafted this report.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:12:11Z.
Follow-up to my capped-job report: a local candidate keeps an acknowledgement for scheduling progress but separately makes a worker exit unsuccessfully if a translation, size-cap or native-pipeline failure occurred. The parent checks acknowledged job count and the exit status of workers that actually started.
In synthetic subprocess checks:
The injection is test-only and not part of the candidate. These runs validate the scheduling and failure gates, not GTA VI loading time or retail behavior. The distinction between requested workers and successfully started workers matters: a failed spawn need not fail an otherwise fully completed job set.
AI use: OpenAI Codex with GPT-6.2 Astra designed and ran the synthetic checks and reviewed the candidate; Codex coordinated and prepared this report.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:16:24Z.
I checked an interaction with #2931 using a local integration of the two PRs. Two overlapping test/scheduling hunks needed manual resolution; this is not a test of either standalone head. Trace-only instrumentation counted shared-helper starts and fallback-helper starts.
With the same four synthetic split shaders and separate fresh caches:
--compute-workerpath started no shared helpers and instead created four fallback helper groups, with eight distinct helper threads for the same 16 pieces.Both runs completed successfully and produced the same set of distinct PSO filenames; the worker acknowledged all four jobs. Source review indicates that the shared pool currently starts inside
precompile(), whilecompute_worker()callsPipelines::makedirectly. If these PRs are combined, opening the shared pool around the worker loop may preserve the intended bound during startup as well.This is synthetic integration evidence, not a measured GTA VI thread count or loading-time regression. AI use: OpenAI Codex with GPT-6.2 Astra integrated and ran the checks; Codex coordinated and prepared this report.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:28:54Z.
A scope correction to my #2931 interaction test above: the four synthetic compute records split into 16 pieces with
--windows 1andXCL_DIRECT_SPLIT_INSTRUCTIONS=12. Those helper-thread counts apply to that setup.On unmodified #2906 head
023395ae4cec59763b37334c2e6b51058643794e, omitting--windowsselected four windows. Both implicit and explicit four-window runs built four whole pipelines at the same forced threshold. A diagnostic-only build showed why: each program had an indivisible component of 52 IR instructions; the planner keeps the program whole when that exceeds four times the limit (48).With four windows and a forced limit of 16, the same four records again split into 16 pieces. Through
xcl runon the repository synthetic title, one configured preparation worker selected in-process preparation and built those 16 pieces plus four whole pipelines. Two configured workers selected the dynamic path: the same seven distinct piece blobs were present, but the four additional whole-pipeline blobs were absent. Both guests exited 0. This last case is the existing whole-form preparation issue tracked by #2794.No retail title was used. These tests varied a synthetic split threshold and did not measure loading time or repeat the helper-thread count at four windows.
AI use: OpenAI Codex (GPT-6.2 Astra) ran the comparisons and prepared this follow-up.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:32:46Z.
Another startup-discovery case on head
023395ae4cec59763b37334c2e6b51058643794e: a valid compute record namedAsset01starts withASbut does not have anAS_stage prefix. The worker collector rejects it before checking the shader payload, while in-process preparation classifies the payload as compute.Three native runs used the repository synthetic title, the same valid compute bytes, fresh separate caches and data roots, and
XCL_PREPARE_ALL=1. The only pack difference was the seven-byte record name; all guests exited successfully.Asset01Asset01CS_TestThe two successful builds produced the same PSO key. The finding concerns prewarming only; the test does not establish whether retail packs contain such names or whether gameplay stalls. Checking the separator before interpreting a stage prefix would protect this example; inspecting the container stage remains the reliable choice for arbitrary names.
AI use: OpenAI Codex with GPT-6.2 Astra constructed and ran the synthetic controls; Codex coordinated and prepared this follow-up.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T01:36:18Z.
Follow-up to the
Asset01report: I tested a local stage-token change that accepts a name as an explicit stage prefix only when the recognized token is followed by_and a nonempty suffix. Noncanonical names fall through to the existing container-stage inspection; canonical names keep the fast path.The pack tests passed 5/5, covering all eight recognized tokens, namespaced names and ASCII case. Four synthetic title launches with worker preparation exited 0:
Asset01,fx:cs_Test, andCS_Testeach produced the same compute PSO;asset_pixelwith a real pixel-shader payload produced no compute PSO. The candidate was independently reviewed.This fixes accidental prefix collisions, not every possible name/payload disagreement. For example, a compute payload explicitly named
PS_Teststill follows the existing trusted canonical-name fast path. Retail naming, startup cost and GTA VI behavior were not measured.AI use: OpenAI Codex with GPT-6.2 Astra wrote, tested and reviewed the local candidate; Codex coordinated and prepared this follow-up.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T02:41:56Z.
I checked the loose-input case listed under Not tested on unmodified head
023395ae4cec59763b37334c2e6b51058643794e, using the repository synthetic title and one valid nested compute shader atshaders/nested/Asset01.dxbc, with noshaders.rpf. Each run used fresh data and shader caches and the title's required--helloargument.With
XCL_PREPARE_WORKERS=1and separately with=2, preparation compiled one shader with zero errors or skips, produced the same PSO cache filename, and the synthetic guest exited 0 with zero failures. Loose inputs remain in-process in this path. This differs from my earlier packedAsset01report, where the dynamic worker collector omitted the record.The native driver blobs were not byte-identical across runs, so the comparison is of the cache filename and successful behavior, not blob bytes. No retail title or GTA VI loading time was tested.
AI use: OpenAI Codex with GPT-6.2 Astra ran the synthetic checks; Codex coordinated and prepared this follow-up.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T02:48:16Z.
Another synthetic CLI summary case on head
023395ae4cec59763b37334c2e6b51058643794e: the duplicate counter can increment before--onlystage filtering, so it can describe a shader as cached even when no requested-stage shader was compiled and the cache remains empty.With fresh caches and one valid synthetic compute blob,
--only PSreported 0 compiled / 0 cached and wrote no DXIL. With two identical copies,--only PSreported 0 compiled / 1 already cached but still wrote no DXIL. As a control, the same two copies with--only CSreported 1 compiled / 1 cached and wrote one file. All runs exited 0.This finding concerns the summary, not missing requested-stage output or demonstrated GTA VI behavior. The worker-job duplicate test in the discussion covers a different path.
AI use: OpenAI Codex with GPT-6.2 Astra ran the synthetic checks; Codex coordinated and prepared this follow-up.
Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-27T03:56:52Z.
Paired measurements of PR
#2906(023395aemerged withnvidia-devecc0bb57) on a 6-core / 12-thread AMD Ryzen 5 5500 + RTX 3060 Ti (8 GB, driver621.40), Windows 11 build 26300, DXC1.9.2602.17.On this 6-core CPU, PR
#2906was ~2.1× slower thannvidia-dev(ecc0bb57) in both warm startup preparation and cold--used-onlyworker precompilation:1. Warm startup preparation (
xcl run, identicalseed-lockhartcache snapshot)Cache snapshot had
1,296used-pipelines,1,572used-shaders, and3,206cached driver blobs (XCL_DIRECT_DXIL=1,XCL_PREPARE_GRAPHICS=0).nvidia-dev(ecc0bb57, run 1)nvidia-dev(ecc0bb57, run 2)#2906(023395ae+ecc0bb57)2 threads/worker,698unique pipelines)Log progression on
#2906warm run:10.1 s:26503 of 26503 records translated(note5.0 sonly reached4061/26503vs20832/26503onnvidia-dev)15 s->24/698,20 s->54/698,25 s->83/698,30 s->116/698,35 s->170/698,40 s->304/698,45 s->698/698,59.4 s->done in 50.8 s.With
cores = 12logical (6physical),compute_worker_count(12, free_mb, 2)spawns only 3 workers (6concurrent threads total), which spent ~35 s chewing through the heaviest LPT-first cached blobs before clearing the remaining entries.2. Cold compute pipeline precompilation (
xcl shaders shaders.rpf --precompile --only cs --pipelines --used-only)Isolated
XCL_DXIL_CACHEcontainingtranslated/from the snapshot, nodriver/blobs, and the first 120 lines ofused-pipelines.txt/used-shaders.txt(XCL_DEVICE_TYPE=lockhart,XCL_DIRECT_DXIL=1):nvidia-dev(ecc0bb57)compiled 92, already cached 0,pipelines made 126(12split,49pieces)#2906(023395ae+ecc0bb57)compiled 90, already cached 614,pipelines made 126(12split,49pieces)Two anomalies visible in
#2906's cold output:5600/26503 (4 s)and5800/26503 (15 s)there was an 11 s stall duringprecompile, and#2906reportedalready cached 614(vs0onnvidia-dev).47.2 svs22.21 s) thannvidia-dev's 8-worker path on this 6C/12T CPU.Not tested: 8-core/16-core CPUs,
XCL_PIPELINE_THREADSoverrides, full 26k-shader cold run.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T03:57:54Z.
The FSPX admission change from #2822 needs one additional caller when combined with #2906. Otherwise packed FSPX compute shaders can reach guest entry but miss offline pipeline warming when multiple preparation workers are enabled. This concerns the FSPX inputs reported in #2057 and startup preparation tracked in #2088.
I tested #2906 head
023395aeand two local variants on native Windows with an RTX 5070. The synthetic title contained a single valid FSPX-only compute shader inshaders.rpf, namedCS_Test. Each run used a new data directory and pipeline cache,XCL_PREPARE_ALL=1, andXCL_PREPARE_GRAPHICS=0.is_compute_containerThe bulk-only port compiled the shader in both runs, so its successful guest exit did not show whether pipeline warming completed. The multi-worker collector separately called
xbox::parse, which rejects FSPX-only containers. Reusing the existingis_compute_containerhelper made the collector schedule one job. Its worker completed successfully and wrote the same PSO filename as the single-worker control. The restored job count is distinct from the earlierAsset01stage-name issue:CS_Testalready passes the name filter.These are local integration results using the repository’s synthetic guest and generated shader bytes. No GTA files, retail timing, or performance improvement were measured. AI use: OpenAI Codex with GPT-6.2 Astra adapted the existing admission change, built and tested the local variants, and independently reviewed the result; Codex coordinated and prepared this report.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T04:57:55Z.
Cold startup-preparation timing of #2906 on an Ampere card, head
023395ae4cec59763b37334c2e6b51058643794eagainst its parenteae015021c639866ab061cdff2e9daf8ba9daac5(nvidia-dev). One run of each, so treat the ratio as indicative.Setup
XCL_DXC_DIR).xcl runon a retail title (same title, same used-shader manifest for both: "only the 2648 shaders earlier runs used"), 30 s after the preparation, A presses scripted.xcl.exe(new NVIDIA cache identity, as in #2129's-ClearNvCachemode) andXCL_PSO_DISK_CACHE=0. The DXIL translation cache was warm for both (filled once by an untimed run of the parent; the two trees hash the same translator sources).XCL_PREPARE_WORKERS=4for both, everything else default: so the parent ran its default pipeline threads per worker and the head its "2 threads/worker".Results (times from the log's preparation lines)
eae01502023395aeSo on this machine the whole preparation took 2.1× less time, and the compute phase 2.2×.
Memory note, for the worker count. With
XCL_PREPARE_WORKERSunset, the parent started 28 workers here; they grew to about 4–4.6 GB each and took commit to 109 of 114 GB before I stopped them. That is the bytes-vs-MiB mix-up ettehn pointed to above (#2705): the commit cap does not bite, so only the thread count limits the workers. I then pinned both trees to 4 workers. During the head's run each worker also sat at about 4.7 GB, so the 1.5 GiB-per-worker budget incompute_worker_countlooks low for this pack on NVIDIA even once the unit is fixed.Edit: the head's default worker count runs this machine out of RAM. A cold run of the head with
XCL_PREPARE_WORKERS=8(whatcompute_worker_countpicks here: 32 threads / 2 / 2 threads per worker) reached 0.2 GB of free RAM at 81.5 GB commit during the compute phase, and my watchdog stopped it, so there is no 8-worker timing. 64 GB RAM, nothing else heavy running. With the 1.5 GiB budget per worker, the memory side of the formula would not have stopped it even with #2705 fixed.Not tested
XCL_PSO_DISK_CACHE=0), the full test suite on this tree.AI use
Claude Code (Claude Opus 5.5) set up and ran the benchmark, read the logs and wrote this report.
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-27T14:29:07Z.
Desk check from reading the diff at
023395a, nothing was run: incrates/xcl/src/shaders.rs:2530-2545(the mesh arm at:2514-2528is the same), everyErrfromconsole_to_dxil_incounts asfailed, including "incomplete translation".prepare_for_launchreturns an error whenfailed > 0(:2636), whereas onmainthe per-program loop skips an incomplete program. With direct graphics on, one VS/PS the translator cannot finish stops shader preparation. #2613 and #2950 treat an incomplete translation as a skip and test it. Details are in the D148 check on #1607 (https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7220838633).AI use: Claude Code (Claude Sonnet 5.5).
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-27T15:12:01Z.
@andrewDoing Thanks for the thorough edge-case testing — all three standalone findings are fixed in
d90683e4:Asset01):pack::name_stagenow requires an explicit_separator and non-empty suffix (<STAGE>_<nonempty>), soAsset01,asset_pixel,CS_, etc. fall through to container inspection (added assertions togpu::pack::tests,4 passed, 0 failed).--onlyduplicate counter: movedseen_blobsdeduplication inprecompile()afterxbox::parseand--onlystage filtering so filtered-out stages do not incrementcached.XCL_PIPELINE_MAX_KB):compute_workerkeeps per-job1acknowledgements for scheduling progress but exits2on any job, refusal, or size-cap failure, andpipelines_in_workersreturnsErr(...)ifstarted == 0,done_count < total_jobs, or any started worker failed (so a single failed spawn does not fail if the remaining workers drain all jobs cleanly).Re-ran
shaders::(18 passed, 0 failed, 1 skipped for Developer Mode),gpu::pack::(4 passed, 0 failed), and the 60 s regression smoke ond90683e4(1,580 frames,0removals,0crashes,15,398 MBpeak commit), and updated the PR description.Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-27T19:34:32Z.
@Anon64 @oni-swr Both issues are fixed in
2ff7cb85:@Anon64):compute_worker_count(limit.saturating_sub(used) >> 20).1.5 GiBto1 GiB + 2.5 GiB * per_worker(6 GiBat 2 threads/worker, matching the ~4.7 GB observed footprint plus headroom) with a4 GiBOS/parent reserve, and capped the automatic default at4workers (still overridable viaXCL_PREPARE_WORKERS). On a 32-thread / 64 GB machine this now defaults to4workers instead of8, and on 16 GB machines scales down to1worker.compute_worker_count_saturates_cpu_within_commit_budgetto cover 12/20/28/56 GiB free-commit cases andper_worker = 1vs2.@oni-swr):MS(console_mesh_in) anddirect_gfxVS/PS(console_to_dxil_in) arms ofprecompile(),Err(e)starting with"incomplete translation"now incrementsskippedinstead offailed, matchingmain's per-program loop so an unsupported shader does not abortprepare_for_launch.Re-ran
shaders::(18 passed, 0 failed, 1 skipped for Developer Mode) and the 60 s regression smoke on2ff7cb85(1,579 frames,0removals,0crashes,15,414 MBpeak commit), and updated the PR description.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T20:30:45Z.
The new incomplete-translation handling in
2ff7cb85fixes guest startup for an unsupported mesh shader. There is still a difference from the parent's per-program loop when a single container holds an incomplete variant followed by a supported variant. The guest starts successfully, but preparation misses both DXIL files for the supported variant.I ran the repository's synthetic guest on Windows 11, Ryzen 7 5700X3D / RTX 5070. Each row used a loose mesh DXBC with its PSV0 metadata, a fresh cache for the cold run, the same cache for the warm run, and fresh guest data for both. Settings included
XCL_PREPARE_ALL=1,XCL_PREPARE_WORKERS=1,XCL_DIRECT_DXIL=all, andXCL_PREPARE_GRAPHICS=0. All 12 launches reached guest completion with exit 0.eae01502DXIL files, cold → warm2ff7cb85DXIL files, cold → warmFor the mixed input the parent reported two compilations and one skip on the cold run, then two cache hits and one skip. Its two keys (
14b18d3ed501407b,f1e975fb4e2f93fd) matched the supported-only control on both revisions. The head reported one skip and zero errors on each mixed run. The blob-level mesh branch finishes the record as soon as its first translation reports incomplete. Falling through to per-program preparation on that specific outcome would retain the supported sibling. The analogous case and a tested candidate are in #2950.These were startup correctness controls on loose inputs. No retail loading-time or worker-balancing measurement was made.
AI assistance: OpenAI Codex (GPT-6) ran the matched controls and drafted this report.
Tested candidate for
2ff7cb85. The mesh fast path now hands only an incomplete translation to the existing per-program loop. Successful translations and other errors keep their current paths. Six more synthetic guest launches on the candidate completed successfully. The mixed container produced two compilations and one skip cold, then two cache hits and one skip warm. The supported-only control kept the same two keys and the incomplete-only control still produced none. The included CLI regression passed, checking both cold compilation and warm reuse. Full suite and retail runs remain untested on the candidate.Apply-checked patch with regression test
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-28T21:18:53Z.
@andrewDoing Thanks for the catch and clean patch — folded into
6612fa0balong with rebasing#2906ontomain(beeb81be):precompile(), theMS(console_mesh_in) fast path now falls through to the existing per-program loop onincomplete translationinstead ofcontinueing past the container, so mixed containers still prepare supported variants.mixed_mesh_preparation_keeps_supported_variantsincrates/xcl/tests/gpu_two_pass_cache_e2e.rs(1 passed, 0 failed).main(beeb81be), preservingmain'spipeline_library/warm_blobs/prepare_compiled_compute/pso_corpuspaths;shaders::(66 passed, 0 failed),gpu::pack::(4 passed, 0 failed), and 60 s regression smoke on6612fa0b(1,589 frames,0removals,0crashes,14,990 MBpeak commit) all pass.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T01:06:14Z.
Confirmed the adopted fix on exact
6612fa0bthrough the original guest startup path, in addition to the PR's offline CLI regression. All six synthetic guest launches exited 0 and reached the guest's own completion marker (Windows, Ryzen 7 5700X3D / RTX 5070). Each input had an independent empty cache for cold, reused for warm, with fresh guest data each launch.The mixed arm compiled two artifacts and skipped one unsupported variant cold, then reported two cache hits and one skip warm, with zero errors both times. Both mixed artifacts (
c45a990fbe4c098f,f1e975fb4e2f93fd) matched the supported-only control byte for byte. On the previously reported2ff7cb85, that same mixed input produced zero files. This closes the startup regression I reported. No retail timing or worker-balance measurement was involved.AI assistance: OpenAI Codex built the exact revision, ran the controls, verified the artifact contents and drafted this report.
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-29T14:15:31Z.
Closing this PR as it'll be redundant with the new shader compilers which have been announced.
Pull request closed