Shaders: fail closed when prepared caches differ #3445
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3445"
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-29T18:07:17Z.
Adds a fail-closed mode for prepared pipeline caches so launch cannot silently fall back to expensive preparation when cache identity differs.
What is in it
XCL_PREPARE_CACHE_ONLY=1rejects missing or incompatible prepared caches.xcl cache statusreports saved and current cache compatibility without preparing pipelines.Tested
db569c7d,.\scripts\test.ps1: 2,748 passed, 0 failed, 49 ignored; 29 GPU tests explicitly skipped for unsupported/opt-in hardware paths.Regression run
Not tested
XCL_PREPARE=0, so the run exercised the runtime/JIT path only.dxil.dllpaths.AI use
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-29T18:22:35Z.
On
dbe1ca6163cd3e91dc4e5a41f5fd3dde4c532ba0, the cache-only launch guard rejected a driver blob thatxcl cache statusstill reported as compatible. I extended the existingcold_publish_makes_an_unchanged_corpus_reusablenative fixture. WithXCL_PREPARE_CACHE_ONLY=1, the original 1,396-byte compute library was reused successfully. Then the fixture replaced only that blob with 1,396 zero bytes, keeping the receipt, expected size, corpus and settings fixed.The command's
cache_statusentry point returned 0 and printedpipeline cache: compatibleandcompute library: 1396 bytes, presentfor both files. The same fixture'sprepare_for_launchcorrectly returnedthe prepared native pipeline cache is not reusablefor the replaced file. This is a diagnostic mismatch. If the status command is intended for callers to check launch readiness, it can reuse the existing native-library validation without preparing any PSOs. If it is intended to compare only identity and size, naming that explicitly in the output would distinguish it from launch readiness.cargo test --offline --locked -p xcl --lib -- shaders::warm_library::tests::cold_publish_makes_an_unchanged_corpus_reusable shaders::warm_library::tests::status_names_each_changed_identity --exact --test-threads=1 --nocapture: 2 passed, 0 failed, 0 ignored, 0 skips. RTX 5070 12 GB (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, Rust 1.100.0 debug. This synthetic driver-library fixture does not load a retail title. Codex with GPT-6.2 Sol adapted the fixture and ran the controls.