Shaders: stabilize prepared cache identities #3447
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3447"
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:43Z.
Replaces unstable prepared-cache identities with deterministic semantic identities so diagnostics, scheduling changes, and implementation-only cache plumbing do not discard compatible native libraries.
Stacked on #3446; only commit
e62a02ffbelongs here.What is in it
Tested
cargo test -p xcl --lib warm_settings -- --test-threads=4: 3 passed, 0 failed.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 Foniass on 2026-11-29T21:01:44Z.
Post-merge review of
e62a02ff(now onmainat1bd9cee1). I read the diff and ran the whole stack merged onto0fe06eb0:cargo test --workspace --no-fail-fast -- --test-threads=4-> 2748 passed, 0 failed, 49 ignored, 31 SKIPPED (no wave64, per-lane form refused, no heap windows, no debug layer). The suite passes, but four changes can let stale DXIL or native libraries be reused. Items 1–3 come from reading the code, not from a reproduction.src/gpu/recomp/dxc.rsleftTRANSLATOR_SOURCES(build.rs:9), but it holds the DXC arguments. These are-HV 2021(dxc.rs:1065) and the-O0/-O1size thresholds. The DXIL file key (cache_key_for_toolchain,dxc.rs:1124) hashes only the crate version, toolchain, profile, entry and source, not the arguments. A change to the DXC flags now invalidates neither the translated cache nor the native libraries. ATRANSLATION_GLUE_REVISION-style constant for the DXC arguments, bumped when they change, would restore the invalidation.src/gpu/recomp/pso.rsleftPREPARATION_LAYOUT_SOURCES(build.rs:60). Its old comment there read "root signatures, translation glue, split pipeline layout". The description promises a narrow pipeline-layout identity, but nothing replaces the file. TheNATIVE_PREPARATION_ABIcomment does not ask for a bump on root-signature changes either.LEGACY_TRANSLATOR_SOURCE_ID = 35a3ab2f5e487481andLEGACY_PIPELINE_LAYOUT_ID = 8aeabcb8e2578671match0fe06eb0; I recomputed both with thesource_hashformula. However,compatible_identity_migration(warm_library.rs:132) treats them as equal to whatever the current identity is. A receipt written by a0fe06eb0-era build that has not been migrated yet is therefore accepted by every later build, even after edits toemit.rs,gfx_records.rsand the other files. Gating the migration on the current new-formula ID equalling the value at this commit would make it expire on the next translator change.warm_settingschanged from a deny list to an allow list (shaders.rs:29). TheXCL_TRACEXassertion was flipped to match (shaders.rs:139). I compared the list with theXCL_variables read undergpu/andhle/d3d12x/real*and found no pipeline-changing switch missing today. A switch added later that is not put on the list will not invalidate the cache, though, so the default is now fail-open.RTX 5070 Ti (driver 32.0.16.2114), Ryzen 7 7800X3D, Windows 11 Pro 26300, Rust 1.100.0 debug. This review was written by Claude Code (Claude Opus 5.5) and checked by @Foniass.