Shaders: defer unavailable graphics history #3210
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3210"
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 bmjask on 2026-11-28T20:09:01Z.
Follow-up to #3197 and #3198. History-backed launch preparation currently aborts title entry when any recorded graphics recipe names a shader unavailable in the title archive. This keeps buildable recipes in manifest order, counts unavailable recipes as deferred progress, and leaves those optional pipelines for runtime creation.
Blocked on #3213, which corrects a stale merged-main GPU test assertion. Both PRs' hosted checks are green.
What is in it
5d4e840ffilters exact graphics history to recipes whose shader sources are available, logs deferred recipes, and adds regression coverage for mixed buildable/unavailable history.Tested
cargo test -p xcl --lib a_graphics_record_is_built_only_with_its_own_shaders -- --test-threads=1: 1 passed, 0 failed, 0 ignored.be90e827(this change on #3213c5980984),cargo build --workspacethencargo test --workspace -- --test-threads=4: 2,594 passed, 0 failed, 49 ignored; 28 capability skips reported.Regression run
Main:
This PR:
Not tested
AI use
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-28T21:46:19Z.
Windows AMD test of #3210 (
5d4e840f) against its base (765b2c5b)Radeon RX 7800 XT 16 GB, driver 32.0.31035.1003, Ryzen 7 5700X3D, 64 GB, Windows 11 25H2 build 26200.9974, rustc 1.100.0, release builds of exactly
765b2c5band5d4e840f(the PR head is one commit on that base).Setup. One 75 s run of main
5b711248withXCL_PSO_MANIFEST=1recorded the history: 3 compute and 11 exact graphics first uses through present 1024. Each arm then ran on its own isolated copy of that cache withXCL_PREPARE_HISTORY_PRESENT=1024(default 15 s budget) andXCL_RUN_SECONDS=55. One run per arm.765b2c5b765b2c5b+ #3210The unavailable recipe comes from the recorded history of a real run. I did not edit it. As a second check I added one recipe to a copy of the cache that names a shader not in the archive: the base again exited with code 2 after 4.3 s; with #3210 two recipes were deferred, the same 8 were prepared and the title ran (1435 presents).
Not tested: other GPUs or drivers; repeated runs (one run per arm, so the present counts are not a performance claim); why that one recipe's shaders are unavailable; pipeline-library reuse (no library generation was opened in these runs and driver blobs were cold: 0 hits); the AMD driver shader cache was left as a reboot leaves it, not cleared.
AI use: Claude Code, Claude Sonnet 5.5 built both commits, ran the arms and wrote this comment.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T22:06:35Z.
On
5d4e840f, a graphics-only history with a valid manifest and exact recipe still aborts before title entry if all shader sources are absent. I called productionprepare_for_launchwith an isolated on-disk manifest through Present 1, one framed legacy graphics recipe, no compute keys, and no native library to reuse.shaders/, noshaders.rpf: returnedNo shader records are available for history preparation..dxbcfile: returned success with 1/1 deferred and zero native pipeline calls. The unrelated bytes matched no shader key.I also checked the partial/restored case through the disk reader, exact-record resolver and source selector. With two recipes, one missing source yielded one ready and one deferred twice. Wrong bytes under the right filename still deferred it. Restoring the exact bytes made both eligible in original manifest order. Removing the file deferred it again; the history file was byte-identical on all five visits.
A local one-line change removing the early
inputs.is_empty()return let both graphics-only arms defer 1/1. An empty-source control with a required compute key still returnedunmatched compute keys (1)from the existing compute selector. This leaves archive I/O/format errors and missing exact recipe records on their existing error paths. The synthetic fixture tested selection and launch preparation; it did not create a native PSO or measure retail performance.AI assistance: OpenAI Codex traced the code, constructed and ran the controls, and drafted this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:08:12Z.
Review of
5d4e840f(code reading only, not a merge-check; draft, so not built or run) · 1 high, 1 medium, 2 nitsIn short: With
XCL_PREPARE_HISTORY_PRESENT, a graphics recipe whose shaders are missing is now deferred and built on demand, instead of ending the whole launch (exit 2) as on main. Nothing changes by default. The fix has no test of its own, and compute recipes still abort in the same situation.High
buildable_history_records; nothing showsprepare_history_graphicsreturning Ok when a recipe's shaders are missing. When every recipe is deferred the function returns beforePipelines::for_adapter, so a GPU-free regression test is possible.Medium
XCL_PREPARE_HISTORY_PRESENT=N, a missing compute source still aborts the launch (milestone.rs~235 / ~218), and so does an empty shader input set (shaders.rs~3296). If deferral is the intended policy, say why compute stays strict or make them consistent.Nit
done, while the compute path subtracts them fromtotal(milestone.rs~238); the log says "unavailable" butbuildablealso rejects mismatched shader-set keys.smoke.ps1setsXCL_PREPARE=0, so the regression run doesn't reach this path; list that under Not tested.Checked and fine
XCL_PREPARE_HISTORY_PRESENT).Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T16:45:43Z.
Test report of
5d4e840f(not a merge-check: draft)In short: it merges into current main, builds and passes the whole suite (0 failed). My review of this same head is at https://github.com/xcl-dev/xcl/pull/3210#issuecomment-7301457466, and its findings stand; this run adds only what reading couldn't.
b2b1f109d27e746a62ec95b04dd1f9924452e6825d4e840f3293976ec1e55d062802ee6960fd9c73How this was tested
b2b1f109, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.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.