Shaders: keep cache activation failures off the null renderer #3467
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3467"
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-29T22:27:03Z.
A prepared pipeline library can pass receipt and size checks but still be rejected when the runtime D3D12 device opens it. Since #3448, that cache activation error propagated as real-device initialization failure and selected the null renderer.
This follow-up keeps the real renderer active and falls back to runtime/JIT pipeline creation during a normal launch.
XCL_PREPARE_CACHE_ONLY=1remains fail-closed and stops before guest entry. The change does not alter pipeline descriptors, shader translation, receipt identities, or cache keys.What is in it
pipeline_library.rs: separates prepared-library opening from activation policy and records strict startup failures.d3d12x/host.rs: keeps normal launches on the real renderer and stops strict launches before guest entry.Tested
cargo test -p xcl --lib "shaders::pipeline_library::tests" -- --test-threads=1: 8 passed, 0 failed, 0 ignored.cargo test -p xcl --lib warm_library -- --test-threads=4: 10 passed, 0 failed, 0 ignored..\scripts\test.ps1: 2,778 passed, 0 failed, 49 ignored. GPU skips: 8 no-wave64 aggregate plus 15 reported feature/instruction skips (no heap windows, no GPU_UPLOAD heaps, no dxil.dll, wave64 and unsupported per-lane forms).Regression run
Base:
Head:
Not tested
AI use
Codex with GPT-5 reviewed the regression, implemented the fix and tests, and ran the reported verification.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:27:35Z.
merge-check
base:
d0832e614fhead:
a26adcd7fbmerge: clean
build: ok
tests: 2892 passed, 0 failed, 51 ignored; 28 skipped, the same as on main
review: 2 high, 1 medium, 2 nits (below)
performance: 60 s smoke run: 1516 → 1445 frames (95 % of main), peak commit 18133 → 17187 MB, no device removal, no crash. No cost on a launch whose cache is accepted
title run: not run
verdict: not yet: 2 high findings (below): no test fails without the fix, and a rejected cache is likely rejected again on every later launch
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: It only changes a launch where a staged pipeline cache passes its checks and the device then rejects it. On main,
activate(&device)?ininit_with_remap(real.rs~1025) turns that into a device failure and the null renderer; with this PR the title keeps the real device and builds pipelines as it runs, andXCL_PREPARE_CACHE_ONLY=1stops the launch instead. The suite and smoke run are clean, but nothing tests the fix, and a rejected cache likely stays rejected.High
activation_failure_continues_normally_and_stops_cache_only_launcheschecks the two-lineif stricthelper, andcorrupt_ready_bytes_are_rejected_by_the_runtime_deviceshows corrupt bytes are rejected, which main already does. Restoring the?inreal.rswould keep both green. A test ofactivateitself (rejection → no startup error,ACTIVEunset) would cover it.Medium
preparation_driver_identity(..).unwrap()panics instead of callingskip_testwhere the identity can't be read.Nit
uma_driver.rs.Checked and fine
STARTUP_ERRORis set once.HOST_MODEis set and before the game loads.warm_library.rsonly follows the new signature.How this was tested
d0832e61, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on maind0832e61and on this merge (81d0a87d); 60 presents per 2 s in both. The smoke run has no staged cache (smoke setsXCL_PREPARE=0), so it does not reach the changed branch.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.