Shaders: defer unavailable graphics history #3210

Open
bmjask wants to merge 1 commit from upstream-pr/3210 into main
bmjask commented 2026-11-28 20:09:01 +00:00 (Migrated from github.com)

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

  • 5d4e840f filters exact graphics history to recipes whose shader sources are available, logs deferred recipes, and adds regression coverage for mixed buildable/unavailable history.

Tested

  • Windows 11 Pro 10.0.26200; Intel Core i9-12900K; NVIDIA GeForce RTX 4090, driver 610.88; rustc 1.100.0; debug tests and release smoke build.
  • cargo test -p xcl --lib a_graphics_record_is_built_only_with_its_own_shaders -- --test-threads=1: 1 passed, 0 failed, 0 ignored.
  • Local combined head be90e827 (this change on #3213 c5980984), cargo build --workspace then cargo test --workspace -- --test-threads=4: 2,594 passed, 0 failed, 49 ignored; 28 capability skips reported.
  • Real history replay through present 256: one unavailable recipe deferred, two exact graphics recipes confirmed in 8.4 seconds; 453 frames in the following 20 seconds, 0 crashes, 0 device removals, 14779 MB peak commit.

Regression run

Main:

xcl-smoke v1
commit: 765b2c5bfff6754e8c9886a73e188a86aca3c64c
gpu: NVIDIA GeForce RTX 4090
title: local-regression
seconds: 10
exit: 0x0
frames shown: 86 (PresentX 86)
presents per 2 s (last 3): 0 22 57
device removals: 0
crashes: 0
peak commit: 8702 MB

This PR:

xcl-smoke v1
commit: 5d4e840f3293976ec1e55d062802ee6960fd9c73
gpu: NVIDIA GeForce RTX 4090
title: local-regression
seconds: 10
exit: 0x0
frames shown: 117 (PresentX 117)
presents per 2 s (last 3): 1 52 55
device removals: 0
crashes: 0
peak commit: 9604 MB

Not tested

  • AMD GPUs.
  • The whole suite on the remote head alone: merged main contains the stale assertion corrected by #3213. The combined head passed the whole suite and this PR remains draft until #3213 lands.

AI use

  • Codex, GPT-5 diagnosed the replay failure, implemented and reviewed the fix, and ran the tests and smoke checks.
<!-- greyfinch-sync:ivall/xcl:issue:5544125827 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3210). Originally posted by [bmjask](https://github.com/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** - `5d4e840f` filters exact graphics history to recipes whose shader sources are available, logs deferred recipes, and adds regression coverage for mixed buildable/unavailable history. **Tested** - Windows 11 Pro 10.0.26200; Intel Core i9-12900K; NVIDIA GeForce RTX 4090, driver 610.88; rustc 1.100.0; debug tests and release smoke build. - `cargo test -p xcl --lib a_graphics_record_is_built_only_with_its_own_shaders -- --test-threads=1`: 1 passed, 0 failed, 0 ignored. - Local combined head `be90e827` (this change on #3213 `c5980984`), `cargo build --workspace` then `cargo test --workspace -- --test-threads=4`: 2,594 passed, 0 failed, 49 ignored; 28 capability skips reported. - Real history replay through present 256: one unavailable recipe deferred, two exact graphics recipes confirmed in 8.4 seconds; 453 frames in the following 20 seconds, 0 crashes, 0 device removals, 14779 MB peak commit. **Regression run** Main: ``` xcl-smoke v1 commit: 765b2c5bfff6754e8c9886a73e188a86aca3c64c gpu: NVIDIA GeForce RTX 4090 title: local-regression seconds: 10 exit: 0x0 frames shown: 86 (PresentX 86) presents per 2 s (last 3): 0 22 57 device removals: 0 crashes: 0 peak commit: 8702 MB ``` This PR: ``` xcl-smoke v1 commit: 5d4e840f3293976ec1e55d062802ee6960fd9c73 gpu: NVIDIA GeForce RTX 4090 title: local-regression seconds: 10 exit: 0x0 frames shown: 117 (PresentX 117) presents per 2 s (last 3): 1 52 55 device removals: 0 crashes: 0 peak commit: 9604 MB ``` **Not tested** - AMD GPUs. - The whole suite on the remote head alone: merged main contains the stale assertion corrected by #3213. The combined head passed the whole suite and this PR remains draft until #3213 lands. **AI use** - Codex, GPT-5 diagnosed the replay failure, implemented and reviewed the fix, and ran the tests and smoke checks.
oni-swr commented 2026-11-28 21:46:19 +00:00 (Migrated from github.com)

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 765b2c5b and 5d4e840f (the PR head is one commit on that base).

Setup. One 75 s run of main 5b711248 with XCL_PSO_MANIFEST=1 recorded 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 with XCL_PREPARE_HISTORY_PRESENT=1024 (default 15 s budget) and XCL_RUN_SECONDS=55. One run per arm.

765b2c5b 765b2c5b + #3210
compute history 3 of 3 confirmed 3 of 3 confirmed
exact graphics history refused: "1 exact graphics history recipes have missing or mismatched shaders" 8 prepared, 1 deferred ("shaders are unavailable")
preparation ends at 4.6 s 2.6 s wall, 0.0 s over budget, slowest call 0.8 s
title exit code 2, no presents exit 0, 1460 presents in the 55 s run, first present window ends about 7.0 s after process start
device removal / crash none none

The 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.

<!-- greyfinch-sync:ivall/xcl:comment:7246259468 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3210#issuecomment-7246259468). Originally posted by [oni-swr](https://github.com/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 `765b2c5b` and `5d4e840f` (the PR head is one commit on that base). **Setup.** One 75 s run of main `5b711248` with `XCL_PSO_MANIFEST=1` recorded 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 with `XCL_PREPARE_HISTORY_PRESENT=1024` (default 15 s budget) and `XCL_RUN_SECONDS=55`. One run per arm. | | `765b2c5b` | `765b2c5b` + #3210 | |---|---|---| | compute history | 3 of 3 confirmed | 3 of 3 confirmed | | exact graphics history | refused: "1 exact graphics history recipes have missing or mismatched shaders" | 8 prepared, 1 deferred ("shaders are unavailable") | | preparation | ends at 4.6 s | 2.6 s wall, 0.0 s over budget, slowest call 0.8 s | | title | exit code 2, no presents | exit 0, 1460 presents in the 55 s run, first present window ends about 7.0 s after process start | | device removal / crash | none | none | The 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.
andrewDoing commented 2026-11-28 22:06:35 +00:00 (Migrated from github.com)

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 production prepare_for_launch with an isolated on-disk manifest through Present 1, one framed legacy graphics recipe, no compute keys, and no native library to reuse.

  • Empty shaders/, no shaders.rpf: returned No shader records are available for history preparation.
  • Same manifest and history, plus one unrelated .dxbc file: 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 returned unmatched 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.

<!-- greyfinch-sync:ivall/xcl:comment:7246501995 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3210#issuecomment-7246501995). Originally posted by [andrewDoing](https://github.com/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 production `prepare_for_launch` with an isolated on-disk manifest through Present 1, one framed legacy graphics recipe, no compute keys, and no native library to reuse. * Empty `shaders/`, no `shaders.rpf`: returned `No shader records are available for history preparation`. * Same manifest and history, plus one unrelated `.dxbc` file: 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 returned `unmatched 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.
Foniass commented 2026-12-01 05:08:12 +00:00 (Migrated from github.com)

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 nits

In 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

  1. The fix itself isn't tested. The new assertion covers only buildable_history_records; nothing shows prepare_history_graphics returning Ok when a recipe's shaders are missing. When every recipe is deferred the function returns before Pipelines::for_adapter, so a GPU-free regression test is possible.

Medium

  1. The rule is now uneven. With 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

  1. Counting and log wording. Deferred recipes are added to done, while the compute path subtracts them from total (milestone.rs ~238); the log says "unavailable" but buildable also rejects mismatched shader-set keys.
  2. Stale notes in the description. #3213 has merged, so the "Blocked on #3213" note is stale and the suite should be rerun on this head alone. smoke.ps1 sets XCL_PREPARE=0, so the regression run doesn't reach this path; list that under Not tested.
Checked and fine
  • Nothing changes by default (only with XCL_PREPARE_HISTORY_PRESENT).
  • The helper keeps manifest order and the recipe-id pairing.
  • Driver failures on buildable recipes still abort.
  • A cancel during the shader scan is still turned into an error by the caller.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7301457466 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3210#issuecomment-7301457466). Originally posted by [Foniass](https://github.com/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 nits **In 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 1. **The fix itself isn't tested.** The new assertion covers only `buildable_history_records`; nothing shows `prepare_history_graphics` returning Ok when a recipe's shaders are missing. When every recipe is deferred the function returns before `Pipelines::for_adapter`, so a GPU-free regression test is possible. #### Medium 2. **The rule is now uneven.** With `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 3. **Counting and log wording.** Deferred recipes are added to `done`, while the compute path subtracts them from `total` (`milestone.rs` ~238); the log says "unavailable" but `buildable` also rejects mismatched shader-set keys. 4. **Stale notes in the description.** #3213 has merged, so the "Blocked on #3213" note is stale and the suite should be rerun on this head alone. `smoke.ps1` sets `XCL_PREPARE=0`, so the regression run doesn't reach this path; list that under Not tested. <details><summary>Checked and fine</summary> - Nothing changes by default (only with `XCL_PREPARE_HISTORY_PRESENT`). - The helper keeps manifest order and the recipe-id pairing. - Driver failures on buildable recipes still abort. - A cancel during the shader scan is still turned into an error by the caller. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Foniass commented 2026-12-01 16:45:43 +00:00 (Migrated from github.com)

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.

base main b2b1f109d27e746a62ec95b04dd1f9924452e682
head 5d4e840f3293976ec1e55d062802ee6960fd9c73
merge clean
build ok
tests 2902 passed, 0 failed, 51 ignored; 28 skipped, the same as on main
performance no smoke run
hardware RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300
How this was tested
  • Merged onto main b2b1f109, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7318177652 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3210#issuecomment-7318177652). Originally posted by [Foniass](https://github.com/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. | | | |---|---| | base | main `b2b1f109d27e746a62ec95b04dd1f9924452e682` | | head | `5d4e840f3293976ec1e55d062802ee6960fd9c73` | | merge | clean | | build | ok | | tests | 2902 passed, 0 failed, 51 ignored; 28 skipped, the same as on main | | performance | no smoke run | | hardware | RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 | <details><summary>How this was tested</summary> - Merged onto main `b2b1f109`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3210:upstream-pr/3210'
git switch 'upstream-pr/3210'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3210'
git switch 'upstream-pr/3210'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3210'
git switch 'upstream-pr/3210'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3210'
git switch 'main'
git merge --squash 'upstream-pr/3210'
git switch 'main'
git merge --ff-only 'upstream-pr/3210'
git switch 'main'
git merge 'upstream-pr/3210'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3210
No description provided.