Preparation: a failed preload pipeline or worker no longer stops the launch #3670
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3670"
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 Prime1997 on 2026-12-02T05:54:29Z.
Requested by Prime
Before a title starts, XCL builds the shader pack's compute pipelines and the graphics pipelines of earlier runs (the history) in worker processes. Any history graphics recipe the driver refused, and any compute or graphics worker that failed, made preparation return an error, and the host then exited with 2 without starting the title. With thousands of cold pipelines, one bad recipe or one driver crash in a worker cost the whole start. The history is a head start, not a promise: such pipelines and failed workers are now logged ("F of N history pipelines not prepared ...; the title builds them at first use") and the title starts. A staged corpus stays mandatory, and cancelling from the window still quits without starting.
Related: #3210 also stops a history recipe from aborting the start, for a different cause (a recipe whose shader is not in the title archive); this one covers driver refusals and failed workers. #2712 adds recovery for failed compute workers and still returns an error when pipelines remain; both change what happens when a compute worker fails, so they will need reconciling.
What is in it
crates/xcl/src/shaders.rs:pipelines_in_workersandgraphics_in_workerslog failed workers and refused history pipelines and go on, unlessXCL_PRELOAD_KEEP_GOING=0(with one worker, compute pipelines are built in-process and a failure there still stops the launch). The graphics check is a pure function,history_outcome, with a test (history_failures_do_not_stop_the_launch). The setting is logged once.Tested
1c8b5514):cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnupasses. The test suite was not run on this exact branch.Regression run
Not tested
scripts/smoke.ps1on this branch; AMD.Switches
XCL_PRELOAD_KEEP_GOING(default on):=0restores the old behavior, where a refused history pipeline or a failed worker stops the launch.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:21:28Z.
Review (head
123146f2, diff read, not a merge-check; checks red):crates/xcl/srcand has noxcl-smokeblocks under Regression run ("Not run yet"), whichscripts/pr_check.pyrefuses. Tested also has no test-suite counts: onlycargo checkfor the gnu target, and the description says the suite was not run on this branch.pipelines_in_workers(crates/xcl/src/shaders.rs~3524) andhistory_outcome(~3813) never stop on their own, and the test assertshistory_outcome([0, 0, 0, 0], 4, 10, true) == Ok((0, 10))("every worker failed", ~4845).in_workers(~3606) also counts workers that never started as failed. So a cause that hits every worker, such as no pipeline device, a wrongXCL_ADAPTERor no commit left, now starts the title with the whole history and pack still cold. The log does not say why the workers failed: their stdout is null, andin_workerskeeps only the progress and summary lines from stderr, so the warning says only "worker i ended with exit code". Stopping whenfailed == workers(or when nothing was confirmed), or logging each failed worker's last stderr line, would keep the "one bad recipe" case without hiding failures that hit every worker.graphics_in_workers(~3624) says "a driver that ends a worker ends no title". With this change, a history recipe that kills its worker is logged and then built in the title's own process when the title first uses it, so the same driver fault happens in the game. Before, the launch stopped. The recipe also stays in the history, so every launch pays for the failing worker again. Neither point is in the description.XCL_PRELOAD_KEEP_GOINGcovers only the multi-worker paths. With one worker (workers_forgives 1 at 5 or fewer logical processors or under 6 GB of free commit), compute pipelines are built in the same process, andprecompilestill stops on any record failure, refused pipeline or pipeline over the size cap (~4488). The opt-inXCL_PREPARE_HISTORY_PRESENTpath still stops on a refused history recipe (prepare_history_graphics~3685). So the same failure stops one machine and not another. In the worker path, the cap hint ("Raise XCL_PIPELINE_MAX_KB") is also lost and only shows as a failed worker. The description's "any history graphics recipe the driver refused" claims more than the code does.history_failures_do_not_stop_the_launchtests the pure function. Nothing tests the compute-worker change (the description says so), and nothing tests howpreload_keeps_goingreads the environment.Fine: cancelling still returns an error on both paths. A failed worker's slice does not save its pack proof, so it gets prepared again on the next launch. The staged corpus path (
corpus.prepare/check_corpus_complete) stays mandatory.in_workerspollstry_wait, so a worker that dies or panics is reaped and nothing waits on it. Reading the code, there is no textual conflict with #3633/#3655/#3664/#3669. #3633 changesprepare_for_launch, not these failure paths. #2712 (open), as the description notes, changes the same compute-worker failure handling in the other direction.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T09:37:45Z.
Test report (not a merge-check:
PR descriptionred)base:
1c8b551475head:
123146f20bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read by one reviewer at this same head; the review is at https://github.com/xcl-dev/xcl/pull/3670#issuecomment-7340765815 and its findings stand. Most serious: the launch goes on even when every worker fails, and no reason is logged.
performance: 60 s smoke of a retail title, main
1c8b5514vs this merge (123146f2): 1652 -> 1685 frames shown (101 %; last presents per 2 s: 61 60 60), peak commit 18228 -> 17259 MB, 0 device removals, 0 crashes.assessment: merges, builds and passes the whole suite on current main, and the smoke run is clean; the blocking point is in the review: the launch goes on even when every worker fails, and no reason is logged
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T20:47:06Z.
Review: COMMENTED
Review of
123146f2: 2 finding(s) (2 medium), most severe first.crates/xcl/src/shaders.rs:3392: see below.crates/xcl/src/shaders.rs:3685: see below.On lines outside the diff:
Medium
crates/xcl/src/shaders.rs:3392: Keep-going applies only when compute pipelines are built in worker processes. The in-process path (workers == 1, or looseshaders/files) still runs a mandatory precompile in which any refused pipeline stops the launch, so the new default behaves differently depending on the hardware. On a machine with 4 or fewer logical processors or under 6 GB of free commit,workers_forreturns 1 (as it does for any title with loose .dxbc shaders),precompile(..., pipelines=true, startup)is mandatory, and one refused compute pipeline returns Err and the host exits with 2. The same title on a 16-thread machine starts with a warning. Applying XCL_PRELOAD_KEEP_GOING at themandatorydecision inprecompilewould make it consistent.Medium
crates/xcl/src/shaders.rs:3685: The history-milestone path (prepare_history_graphics, andmilestone::prepare_launchfor compute) still aborts the launch when the driver refuses one history graphics recipe, contrary to the PR's claim that a refused history recipe no longer stops the start. With XCL_PREPARE_HISTORY_PRESENT=N set,prepare_for_launchtakes the milestone branch, and one refused exact graphics recipe hitsif !ok { return Err("Graphics history recipe ... failed") }, so the host exits with 2 even though XCL_PRELOAD_KEEP_GOING defaults to on. Routing that path through the same keep-going check would match the description.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T06:19:55Z.
merge-check
base:
078358a058head:
123146f20bmerge: clean
build: ok
tests: 3007 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 1 high, 6 medium (below)
performance: 60 s smoke run: 1669 → 1674 frames (100 % of main), peak commit 17577 → 17609 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 234 s there, 0 device removals, 0 crashes, 2.9 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet: 1 blocking finding (critical or high, below); also
PR descriptionis redhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: Lets the launch go on when a history graphics pipeline is refused or a preparation worker fails; XCL_PRELOAD_KEEP_GOING=0 brings back the old stop. The head is the one reviewed and test-reported on 2 December and nothing has changed, so every earlier finding is still open. The blocking one: a run where every worker fails still starts the title, and no reason is logged.
High
Medium
Checked and fine
1c8b5514) is behindHow this was tested
078358a0, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main078358a0and on this merge; presents per 2 s at the end: 60 61 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.