Shaders: validate prepared libraries on the runtime device #3448
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3448"
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:56Z.
Validates and opens prepared native pipeline libraries on the runtime D3D12 device, eliminating the temporary preparation device and duplicate library-open work on warm launch.
Stacked on #3447; only commit
7599439bbelongs here.What is in it
Tested
cargo test -p xcl --lib warm_library -- --test-threads=4: 10 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 andrewDoing on 2026-11-29T19:09:01Z.
On
7599439b3cf23356315f2d653aedf7de1df4a02c, the runtime device rejected a same-size corrupt prepared compute library, but cache-only startup reached the null backend instead of returning a launch error. I used the synthetic native library fromcold_publish_makes_an_unchanged_corpus_reusableand tested two fresh processes withXCL_PREPARE_CACHE_ONLY=1.cache_statusprepare_for_launchbackend_before_guestThe corrupt case logged
Pipeline library: runtime compute activation failedwith0x80070057. The real device backend correctly rejected the bytes.backend_with_remaphandled that like a device-init failure and selected Null. The caller inhost.rsdiscards the result ofbackend_before_guest. This is the next stage of the #3445 status discrepancy. It would help to propagate the activation error to the host in cache-only mode. For ordinary launches, an invalid prepared blob can be treated as a cache miss while keeping the real D3D12 device.cargo test --offline --locked -p xcl --lib -- shaders::warm_library::tests::cold_publish_makes_an_unchanged_corpus_reusable --exact --test-threads=1 --nocapture: one pass per process, zero skips. RTX 5070 12 GB (616.92), Ryzen 7 5700X3D, Windows 11 26300.10075, Rust 1.100.0, debug. The fixture calls the production preparation and backend entry points directly. No guest or retail title was launched. Codex with GPT-6.2 Sol adapted and ran the fixture.I tested a companion commit that preserves the original activation error through the host startup check. A valid cache kept the Real backend in cache-only mode, the same-size corrupt cache returned the
0x80070057activation error in cache-only mode, and an ordinary launch with that corrupt cache kept the Real backend without an active prepared library. All three fresh-process checks passed with zero skips. The 16 focused tests fromcargo test --offline --locked -p xcl --lib -- shaders::warm_library:: shaders::pipeline_library:: --test-threads=1 --nocapturealso passed with zero skips. The companion addresses startup behavior. The status command still reports receipt identity and size.