Shaders: a stale-blob probe the driver takes is not created a second time #2940

Merged
KOLESNiii merged 1 commit from upstream-pr/2940 into main 2026-11-29 16:19:17 +00:00
KOLESNiii commented 2026-11-27 01:59:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-27T01:59:00Z.


Rebased onto main e429936c (ported onto its claimed preparation, running permit and per-pipeline persistence outcomes; see the commit message). --pipelines and startup shader preparation create a compute pipeline with the driver's blob of an earlier run. When the driver cannot use the blob but compiles from the DXIL and still succeeds (#1774), the size check on the returned blob dropped that pipeline and created it a second time without the blob, in the same XCL_PIPELINE_THREADS slot. Now the pipeline from a successful probe is kept: one native create. Whether it counts as reused is unchanged (the returned blob has the size handed over). When it doesn't, its own blob replaces the stale one on disk. A refused blob is still compiled again without it, and over the cap it is still capped and removed.

Fixes #2939

What is in it

  • crates/xcl/src/shaders.rs: the create-with-blob decision moves out of Pipelines::make_one into build_with_blob, which takes the native create and GetCachedBlob as closures (the same pattern as create_graphics_pso_cached in real.rs). make_one keeps the slot, counters and file handling. As on main, a pipeline made without a blob is not asked for its blob when there is no cache path (XCL_PSO_DISK_CACHE=0), and the driver's blob is not copied: DriverBlob keeps the ID3DBlob, the hit check reads only its size, and a replacement is written from the driver's buffer.
  • Over the cap nothing changes: a blob that was not used (refused, or taken but not a hit) is capped and removed after one create, as on main. An earlier revision made a taken stale blob over the cap into a made pipeline. That broke the two over-cap tests in the full suite (see below) and went beyond #2939, so it was dropped.
  • Tests: build_with_blob_tests (no GPU) drive the helper with a fake driver: stale blob taken (ettehn's 1,418 → 1,402 bytes) under and over the cap, akimfomin's same-size/different-bytes control (asserts one create only, leaving the hit rule open for discussion in #2939), the blob handed back, a pipeline without a blob, refused blob under and over the cap, no blob, and no cache path (no blob export). pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced (GPU) repeats ettehn's reproducer on real D3D12: the stock pipeline's blob with 16 zero bytes appended, which must be made with one native create (test-only counter on Pipelines) and replaced on disk. It reports SKIPPED when the driver refuses the padded blob.

Tested

  • RTX 2070 SUPER, Windows 11 26300, stable-x86_64-pc-windows-msvc, debug
  • cargo test --workspace -- --test-threads=4 on c9c6966a: 2138 passed, 9 failed, 48 ignored; 25 SKIPPED (21 no wave64, 3 #1426, 1 no heap windows). The 9 failures are #3093's and fail the same on main e429936c (2126 passed, 9 failed, 48 ignored), same skips.
  • build_with_blob_tests and pipeline_persistence_tests (no GPU) on c9c6966a: 12 passed
  • Before the port (e2615503, on main 8b957bec): the new GPU test failed on main plus only the test-only create counter (creates=2 made=2 ... kept_blob=1626) and passed with the fix (creates=1). This negative check was not redone after the port: main e429936c has no such counter, and adding it again is part of this PR.
  • Runs by others on ee919a64: NVIDIA RTX 5070 Ti (ettehn) and AMD RX 7800 XT (oni-swr) take the padded blob and make it with one create; Wine / vkd3d-proton / RADV refuses it, so the GPU test skips there (SzczepanGrela). See the comments.
  • Found while running the suite on an earlier revision: shaders::tests::pso_measurement_compiles_an_exact_synthetic_record turns the driver's shader cache off with ShaderCacheControl on the device that every test in the process shares, after which the driver takes any CachedPSO, garbage included. On main the size check hides this. It isn't fixed here.

Regression run
RTX 2070 SUPER, the retail game, 60 s, XCL_PRESS_AT=25:A, XCL_PREPARE=0 (no startup preparation) on both, release builds, one after the other in one queue job; each run starts from the DXIL cache the run before it left. Startup preparation is skipped, so this does not reach the changed code (it runs in preparation and --pipelines): it is a regression check.

xcl-smoke v1
commit: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1045 (PresentX 1046)
presents per 2 s (last 3): 29 27 48
device removals: 0
crashes: 0
peak commit: 15673 MB
xcl-smoke v1
commit: c9c6966a5ca604637fb196973b8cc179ab63501d
gpu: NVIDIA GeForce RTX 2070 SUPER
title: retail game
seconds: 60
exit: 0x0
frames shown: 1185 (PresentX 1185)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15147 MB

Not tested

  • Intel drivers (asked for in akimfomin's Test Lab #114). AMD is covered only by oni-swr's run on ee919a64. The successful-stale-probe path depends on the driver taking a blob it can't use.
  • Timing: whether skipping the blob export and the copies saves measurable time
  • A real driver upgrade (the padded blob stands in for it)
  • A full --pipelines pass or startup preparation after the port (asked for in the comments)
  • The runtime's compute and graphics paths (real.rs) are unchanged. They count any successful probe as a hit and never replace the stale blob, see #2939 for the proposal.

AI use

  • Claude Code, Claude Opus 5.5: wrote the code, the tests and this description, and ran the tests, applied the review changes (no blob export without a path, no blob copy) and ported it onto main e429936c. The reproducer and the same-size control come from ettehn's and akimfomin's comments in #2939.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5519870786 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-27T01:59:00Z. --- Rebased onto `main` `e429936c` (ported onto its claimed preparation, running permit and per-pipeline persistence outcomes; see the commit message). `--pipelines` and startup shader preparation create a compute pipeline with the driver's blob of an earlier run. When the driver cannot use the blob but compiles from the DXIL and still succeeds (#1774), the size check on the returned blob dropped that pipeline and created it a second time without the blob, in the same `XCL_PIPELINE_THREADS` slot. Now the pipeline from a successful probe is kept: one native create. Whether it counts as reused is unchanged (the returned blob has the size handed over). When it doesn't, its own blob replaces the stale one on disk. A refused blob is still compiled again without it, and over the cap it is still capped and removed. Fixes #2939 **What is in it** - `crates/xcl/src/shaders.rs`: the create-with-blob decision moves out of `Pipelines::make_one` into `build_with_blob`, which takes the native create and `GetCachedBlob` as closures (the same pattern as `create_graphics_pso_cached` in `real.rs`). `make_one` keeps the slot, counters and file handling. As on `main`, a pipeline made without a blob is not asked for its blob when there is no cache path (`XCL_PSO_DISK_CACHE=0`), and the driver's blob is not copied: `DriverBlob` keeps the `ID3DBlob`, the hit check reads only its size, and a replacement is written from the driver's buffer. - Over the cap nothing changes: a blob that was not used (refused, or taken but not a hit) is capped and removed after one create, as on `main`. An earlier revision made a taken stale blob over the cap into a made pipeline. That broke the two over-cap tests in the full suite (see below) and went beyond #2939, so it was dropped. - Tests: `build_with_blob_tests` (no GPU) drive the helper with a fake driver: stale blob taken (ettehn's 1,418 → 1,402 bytes) under and over the cap, akimfomin's same-size/different-bytes control (asserts one create only, leaving the hit rule open for discussion in #2939), the blob handed back, a pipeline without a blob, refused blob under and over the cap, no blob, and no cache path (no blob export). `pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced` (GPU) repeats ettehn's reproducer on real D3D12: the stock pipeline's blob with 16 zero bytes appended, which must be made with one native create (test-only counter on `Pipelines`) and replaced on disk. It reports SKIPPED when the driver refuses the padded blob. **Tested** - RTX 2070 SUPER, Windows 11 26300, stable-x86_64-pc-windows-msvc, debug - `cargo test --workspace -- --test-threads=4` on c9c6966a: 2138 passed, 9 failed, 48 ignored; 25 `SKIPPED` (21 no wave64, 3 #1426, 1 no heap windows). The 9 failures are #3093's and fail the same on `main` e429936c (2126 passed, 9 failed, 48 ignored), same skips. - `build_with_blob_tests` and `pipeline_persistence_tests` (no GPU) on c9c6966a: 12 passed - Before the port (e2615503, on `main` 8b957bec): the new GPU test failed on `main` plus only the test-only create counter (`creates=2 made=2 ... kept_blob=1626`) and passed with the fix (`creates=1`). This negative check was not redone after the port: `main` e429936c has no such counter, and adding it again is part of this PR. - Runs by others on ee919a64: NVIDIA RTX 5070 Ti (ettehn) and AMD RX 7800 XT (oni-swr) take the padded blob and make it with one create; Wine / vkd3d-proton / RADV refuses it, so the GPU test skips there (SzczepanGrela). See the comments. - Found while running the suite on an earlier revision: `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` turns the driver's shader cache off with `ShaderCacheControl` on the device that every test in the process shares, after which the driver takes any `CachedPSO`, garbage included. On `main` the size check hides this. It isn't fixed here. **Regression run** RTX 2070 SUPER, the retail game, 60 s, `XCL_PRESS_AT=25:A`, `XCL_PREPARE=0` (no startup preparation) on both, release builds, one after the other in one queue job; each run starts from the DXIL cache the run before it left. Startup preparation is skipped, so this does not reach the changed code (it runs in preparation and `--pipelines`): it is a regression check. ``` xcl-smoke v1 commit: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1045 (PresentX 1046) presents per 2 s (last 3): 29 27 48 device removals: 0 crashes: 0 peak commit: 15673 MB ``` ``` xcl-smoke v1 commit: c9c6966a5ca604637fb196973b8cc179ab63501d gpu: NVIDIA GeForce RTX 2070 SUPER title: retail game seconds: 60 exit: 0x0 frames shown: 1185 (PresentX 1185) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15147 MB ``` **Not tested** - Intel drivers (asked for in akimfomin's Test Lab #114). AMD is covered only by oni-swr's run on ee919a64. The successful-stale-probe path depends on the driver taking a blob it can't use. - Timing: whether skipping the blob export and the copies saves measurable time - A real driver upgrade (the padded blob stands in for it) - A full `--pipelines` pass or startup preparation after the port (asked for in the comments) - The runtime's compute and graphics paths (`real.rs`) are unchanged. They count any successful probe as a hit and never replace the stale blob, see #2939 for the proposal. **AI use** - Claude Code, Claude Opus 5.5: wrote the code, the tests and this description, and ran the tests, applied the review changes (no blob export without a path, no blob copy) and ported it onto `main` e429936c. The reproducer and the same-size control come from ettehn's and akimfomin's comments in #2939. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
akimfomin commented 2026-11-27 02:04:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by akimfomin on 2026-11-27T02:04:27Z.


I ran the eight exact build_with_blob_tests from ee919a6407afdaefeb295fa0bc3feb0d1868581c in an isolated Rust test binary: 8 passed. I also added a one-case callback counter: uncached success invokes blob_of once. At the calling site, XCL_PSO_DISK_CACHE=0 gives no path, but that callback still calls GetCachedBlob and copies its bytes. The old path skipped both operations when the path was absent.

Returning None from the callback when path is absent preserves that behavior. A regression can count zero exports/copies in that control. The separate warm-cache case also copies each blob into a Rust Vec before deciding by length and dropping it. A retained blob handle plus length would preserve the old no-copy path for equal-sized results. Performance impact is unmeasured. The one-create, fallback and cap controls passed in isolation. AI-assisted source review and isolated compilation with OpenAI Codex.

<!-- greyfinch-sync:ivall/xcl:comment:7207809226 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7207809226). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-27T02:04:27Z. --- I ran the eight exact `build_with_blob_tests` from `ee919a6407afdaefeb295fa0bc3feb0d1868581c` in an isolated Rust test binary: 8 passed. I also added a one-case callback counter: uncached success invokes `blob_of` once. At the [calling site](https://github.com/KOLESNiii/xcl/blob/ee919a6407afdaefeb295fa0bc3feb0d1868581c/crates/xcl/src/shaders.rs#L1590-L1630), `XCL_PSO_DISK_CACHE=0` gives no path, but that callback still calls `GetCachedBlob` and copies its bytes. The [old path](https://github.com/xcl-dev/xcl/blob/8b957bec6f82495aec940944c6bf47faa02db590/crates/xcl/src/shaders.rs#L1570-L1580) skipped both operations when the path was absent. Returning `None` from the callback when `path` is absent preserves that behavior. A regression can count zero exports/copies in that control. The separate warm-cache case also copies each blob into a Rust Vec before deciding by length and dropping it. A retained blob handle plus length would preserve the old no-copy path for equal-sized results. Performance impact is unmeasured. The one-create, fallback and cap controls passed in isolation. AI-assisted source review and isolated compilation with OpenAI Codex.
andrewDoing commented 2026-11-27 02:10:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T02:10:13Z.


I compared the native compute PSO path on parent 8b957bec6f82495aec940944c6bf47faa02db590 and draft head ee919a6407afdaefeb295fa0bc3feb0d1868581c, using trace-only instrumentation around the existing calls. All six synthetic runs made exactly one PSO and reported zero refusals.

  • With the disk cache disabled, the parent did not call GetCachedBlob; the draft retrieved and copied a 3,070-byte blob that had no disk destination.
  • On a cold disk-enabled build, the parent borrowed native blob bytes for the write; the draft copied the same number of bytes before writing.
  • On an accepted warm hit, the parent checked GetBufferSize without reading the returned buffer; the draft copied the 3,070 bytes and discarded them after the size check.

The draft's one-create result is preserved in all three cases. Keeping the returned blob handle through the size check and borrowing its contents only when a replacement must be written could avoid these copies; a no-destination cold build could skip retrieval. I did not measure latency, retail hit frequency, or GTA VI startup time. Trace printing itself occurred inside the limited pipeline slot, so these runs should not be used for timing.

AI use: OpenAI Codex with GPT-6.2 Astra instrumented and ran the checks and independently reviewed the source; Codex coordinated and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7207890471 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7207890471). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-27T02:10:13Z. --- I compared the native compute PSO path on parent `8b957bec6f82495aec940944c6bf47faa02db590` and draft head `ee919a6407afdaefeb295fa0bc3feb0d1868581c`, using trace-only instrumentation around the existing calls. All six synthetic runs made exactly one PSO and reported zero refusals. - With the disk cache disabled, the parent did not call `GetCachedBlob`; the draft retrieved and copied a 3,070-byte blob that had no disk destination. - On a cold disk-enabled build, the parent borrowed native blob bytes for the write; the draft copied the same number of bytes before writing. - On an accepted warm hit, the parent checked `GetBufferSize` without reading the returned buffer; the draft copied the 3,070 bytes and discarded them after the size check. The draft's one-create result is preserved in all three cases. Keeping the returned blob handle through the size check and borrowing its contents only when a replacement must be written could avoid these copies; a no-destination cold build could skip retrieval. I did not measure latency, retail hit frequency, or GTA VI startup time. Trace printing itself occurred inside the limited pipeline slot, so these runs should not be used for timing. AI use: OpenAI Codex with GPT-6.2 Astra instrumented and ran the checks and independently reviewed the source; Codex coordinated and prepared this report.
ettehn commented 2026-11-27 02:10:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T02:10:18Z.


Independent native D3D12 run on exact ee919a64: RTX 5070 Ti Laptop, NVIDIA 621.24, Windows 11, SDK DXC 1.8.2502.11. cargo test --offline --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --test-threads=1 --nocapture: 12 passed, 0 failed, 0 skipped. On the real padded-blob fixture, the 1,418-byte input took one native create and was replaced by a 1,402-byte blob (reused=0). The existing over-cap refusal test still reported capped=1, made=0.

I also tried a local overlay for the review above: retain the ID3DBlob and its length through the decision, borrow its bytes only when writing a replacement, and skip GetCachedBlob when there is no cache path. The 12 tests passed with that overlay. I extended the native fixture to set the cap one byte below the synthetic DXIL length after seeding. The successful padded probe still used one native create and wrote the replacement, with no capped increment. No retail run or timing measurement in this check.

OpenAI Codex (6.2sol) assisted with verification.

<!-- greyfinch-sync:ivall/xcl:comment:7207891768 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7207891768). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-27T02:10:18Z. --- Independent native D3D12 run on exact `ee919a64`: RTX 5070 Ti Laptop, NVIDIA 621.24, Windows 11, SDK DXC 1.8.2502.11. `cargo test --offline --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --test-threads=1 --nocapture`: **12 passed, 0 failed, 0 skipped**. On the real padded-blob fixture, the 1,418-byte input took one native create and was replaced by a 1,402-byte blob (`reused=0`). The existing over-cap refusal test still reported `capped=1`, `made=0`. I also tried a local overlay for the review above: retain the `ID3DBlob` and its length through the decision, borrow its bytes only when writing a replacement, and skip `GetCachedBlob` when there is no cache path. The 12 tests passed with that overlay. I extended the native fixture to set the cap one byte below the synthetic DXIL length after seeding. The successful padded probe still used one native create and wrote the replacement, with no capped increment. No retail run or timing measurement in this check. OpenAI Codex (6.2sol) assisted with verification.
ettehn commented 2026-11-27 02:20:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T02:20:24Z.


Thanks for turning the padded-blob reproducer I posted in #2939 into a GPU regression. Since that test is included in #2940, would you consider adding this co-author trailer for the reproducer and Windows verification?

Co-authored-by: ettehn <[email protected]>
<!-- greyfinch-sync:ivall/xcl:comment:7208037087 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7208037087). Originally posted by [ettehn](https://github.com/ettehn) on 2026-11-27T02:20:24Z. --- Thanks for turning the padded-blob reproducer I posted in #2939 into a GPU regression. Since that test is included in #2940, would you consider adding this co-author trailer for the reproducer and Windows verification? ```text Co-authored-by: ettehn <141814824+[email protected]> ```
oni-swr commented 2026-11-27 02:39:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-27T02:39:10Z.


amd-win check of ee919a6407afdaefeb295fa0bc3feb0d1868581c (parent 8b957bec), native Windows, AMD.

  • RX 7800 XT (RDNA3), driver 32.0.31035.1003, Windows 11 build 26200, AMD Ryzen 7 5700X3D 8-Core Processor , 64 GB, rustc 1.100.0 (0ef1bc386 2026-11-09), debug test profile, DXC 1.8.2502.11 (SDK 10.0.26100.0).
  • cargo test --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --test-threads=1 --nocapture on the head: 12 passed, 0 failed, 0 ignored, 0 skipped.
  • ... -- shaders:: on the head: 19 passed, 0 failed. On the parent binary (run separately, built from its own checkout): 10 passed, 0 failed (the 9 new tests do not exist there).
  • The real padded-blob fixture on this adapter: good blob 954 B, padded blob 970 B, creates=1, made=2, refused=0, reused=0, kept blob 954 B. So the AMD driver also takes a padded blob and returns a smaller one, the same case as on NVIDIA, and the head makes one native create.
  • stale_blob_cannot_bypass_the_offline_pipeline_cap: capped=1, made=0, refused=0.

Not tested: the parent's two-create count on AMD (the fixture is part of this PR, so I did not run it on the parent); a title run or a precompile; cargo test -p xcl in full; correctness on AMD of a driver-returned blob across runs (XCL does not keep AMD blobs on disk by default); no timing of the second create.

AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7208314036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7208314036). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T02:39:10Z. --- **amd-win check of `ee919a6407afdaefeb295fa0bc3feb0d1868581c`** (parent `8b957bec`), native Windows, AMD. - RX 7800 XT (RDNA3), driver 32.0.31035.1003, Windows 11 build 26200, AMD Ryzen 7 5700X3D 8-Core Processor , 64 GB, rustc 1.100.0 (0ef1bc386 2026-11-09), debug test profile, DXC 1.8.2502.11 (SDK 10.0.26100.0). - `cargo test --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --test-threads=1 --nocapture` on the head: **12 passed, 0 failed, 0 ignored, 0 skipped.** - `... -- shaders::` on the head: 19 passed, 0 failed. On the parent binary (run separately, built from its own checkout): 10 passed, 0 failed (the 9 new tests do not exist there). - The real padded-blob fixture on this adapter: good blob 954 B, padded blob 970 B, **creates=1, made=2, refused=0, reused=0**, kept blob 954 B. So the AMD driver also takes a padded blob and returns a smaller one, the same case as on NVIDIA, and the head makes one native create. - `stale_blob_cannot_bypass_the_offline_pipeline_cap`: capped=1, made=0, refused=0. **Not tested:** the parent's two-create count on AMD (the fixture is part of this PR, so I did not run it on the parent); a title run or a precompile; `cargo test -p xcl` in full; correctness on AMD of a driver-returned blob across runs (XCL does not keep AMD blobs on disk by default); no timing of the second create. AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this.
akimfomin commented 2026-11-27 03:33:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by akimfomin on 2026-11-27T03:33:57Z.


The Radeon and NVIDIA runs both exercised the accepted padded-blob path. Intel’s behavior is still open. I put the exact ee919a64 fixture and return fields in Test Lab #114 and offered the run to a contributor who volunteered native D3D12 testing on Arc B580. If the Intel driver refuses the padded blob, we’ll record the refusal/skip separately from a successful one-create replacement. I’ll bring the credited result here if the run happens.

<!-- greyfinch-sync:ivall/xcl:comment:7209091535 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7209091535). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-27T03:33:57Z. --- The Radeon and NVIDIA runs both exercised the accepted padded-blob path. Intel’s behavior is still open. I put the exact `ee919a64` fixture and return fields in [Test Lab #114](https://github.com/akimfomin/PortBridge/issues/114#issuecomment-7209001266) and offered the run to a contributor who volunteered native D3D12 testing on Arc B580. If the Intel driver refuses the padded blob, we’ll record the refusal/skip separately from a successful one-create replacement. I’ll bring the credited result here if the run happens.
SzczepanGrela commented 2026-11-27 05:18:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-27T05:18:48Z.


Wine / vkd3d-proton / RADV result: this stack rejects the padded blob, so the native regression test skips the accepted-stale-probe branch. This differs from the native Windows AMD/NVIDIA results above.

Tested

  • Exact head ee919a6407afdaefeb295fa0bc3feb0d1868581c, main c2ee10e4e905eb736e56953c52b749e18bcc7ede, and the PR applied to that main. Main's shaders.rs is identical to the PR base 8b957bec6f82495aec940944c6bf47faa02db590; integration changes only that file.
  • RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5, Ryzen 7 7700, CachyOS 7.3.0-5-cachyos. Windows GNU release, Rust 1.97.1, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+ (local asserts-disabled build), DXC/DXIL 1.9.2602.17.
  • Separate source copies, test-only native-create/export traces, original assertions preserved. The original padded GPU test body and its counter were also added to main. Build each: cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics.
  • Through Wine: <unit.exe> build_with_blob_tests pipeline_cap_tests workflow_original_padded --nocapture --test-threads=1, then --test-threads=4.
Source Libtest result in each run Runtime SKIPPED in each run
Main + copied GPU test/counter 4 passed, 0 failed, 0 ignored 1
Exact head 12 passed, 0 failed, 0 ignored 1
Current-main integration 12 passed, 0 failed, 0 ignored 1

Every skip is the padded test's the driver refuses a blob with bytes appended (0x887E0002): no successful stale probe on this adapter. It is not native coverage of the one-create replacement case. The eight helper tests pass on head/integration.

Additional filter <unit.exe> workflow_driver_blob_matrix --nocapture --test-threads=1, three fresh processes per source: 1 passed, 0 failed, 0 skipped in all nine runs. The fixture explicitly overrides isolated cache paths; global XCL_PSO_DISK_CACHE=0. Its 3,080-byte synthetic compute shader yields a 112-byte blob; appending 16 zero bytes produces a rejected 128-byte blob. Both padded and corrupt inputs return 0x887E0002 in independent native acceptance probes.

Measured case Main, head and integration
Cold One native create, 112-byte blob written
Valid 112-byte blob One native create, reused counter +1
Padded/corrupt, under cap Rejected cached attempt, then one uncached create; replaced with the 112-byte blob
Padded/corrupt, cap one byte below DXIL length One rejected attempt, capped +1, file removed
No blob, over cap Zero native creates, capped +1

Across the eight-case runs: 72 cases and 81 measured native create attempts, plus seeding and separate acceptance probes. Native traces, counters, caps and exact blob files were independently verified and repeat byte-for-byte. The no-path export also matches the earlier review: main makes no GetCachedBlob call there; head/integration make one. No latency was measured.

A separate native-wave64 dispatch per owned run verifies all 1,296 data/width/sentinel words across nine runs. This control creates its own PSO. Head and integration captures match. Inherited XCL_* cleared; network off, RX 9070 selected, private enabled caches; no GPU/DXC-absence skip was accepted.

Not tested

The successful native stale-blob probe central to this PR, dispatching the PSO returned by that probe, a real driver upgrade, full suite, native Windows, other GPUs, retail workload, scripts/smoke.ps1, timing or FPS. Padded-blob refusal on this stack prevents reproducing the proposed two-create to one-create improvement.

AI use

OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, added test-only traces and the eight-case fixture, ran comparisons, independently verified skips, native calls, counters, blob files, GPU data and source/executable provenance, and drafted this report. Publication authorized by the account owner.

<!-- greyfinch-sync:ivall/xcl:comment:7210529583 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7210529583). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-27T05:18:48Z. --- Wine / vkd3d-proton / RADV result: this stack rejects the padded blob, so the native regression test skips the accepted-stale-probe branch. This differs from the native Windows AMD/NVIDIA results above. **Tested** - Exact head `ee919a6407afdaefeb295fa0bc3feb0d1868581c`, main `c2ee10e4e905eb736e56953c52b749e18bcc7ede`, and the PR applied to that main. Main's `shaders.rs` is identical to the PR base `8b957bec6f82495aec940944c6bf47faa02db590`; integration changes only that file. - RX 9070 16 GB, RADV GFX1201 / Mesa `26.3.1-arch3.5`, Ryzen 7 7700, CachyOS `7.3.0-5-cachyos`. Windows GNU release, Rust `1.97.1`, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton `8293130ebe370b1+` (local asserts-disabled build), DXC/DXIL `1.9.2602.17`. - Separate source copies, test-only native-create/export traces, original assertions preserved. The original padded GPU test body and its counter were also added to main. Build each: `cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics`. - Through Wine: `<unit.exe> build_with_blob_tests pipeline_cap_tests workflow_original_padded --nocapture --test-threads=1`, then `--test-threads=4`. | Source | Libtest result in each run | Runtime SKIPPED in each run | |---|---|---| | Main + copied GPU test/counter | 4 passed, 0 failed, 0 ignored | 1 | | Exact head | 12 passed, 0 failed, 0 ignored | 1 | | Current-main integration | 12 passed, 0 failed, 0 ignored | 1 | Every skip is the padded test's `the driver refuses a blob with bytes appended (0x887E0002): no successful stale probe on this adapter`. It is not native coverage of the one-create replacement case. The eight helper tests pass on head/integration. Additional filter `<unit.exe> workflow_driver_blob_matrix --nocapture --test-threads=1`, three fresh processes per source: **1 passed, 0 failed, 0 skipped** in all nine runs. The fixture explicitly overrides isolated cache paths; global `XCL_PSO_DISK_CACHE=0`. Its 3,080-byte synthetic compute shader yields a **112-byte blob**; appending 16 zero bytes produces a rejected **128-byte blob**. Both padded and corrupt inputs return `0x887E0002` in independent native acceptance probes. | Measured case | Main, head and integration | |---|---| | Cold | One native create, 112-byte blob written | | Valid 112-byte blob | One native create, reused counter +1 | | Padded/corrupt, under cap | Rejected cached attempt, then one uncached create; replaced with the 112-byte blob | | Padded/corrupt, cap one byte below DXIL length | One rejected attempt, capped +1, file removed | | No blob, over cap | Zero native creates, capped +1 | Across the eight-case runs: **72 cases and 81 measured native create attempts**, plus seeding and separate acceptance probes. Native traces, counters, caps and exact blob files were independently verified and repeat byte-for-byte. The no-path export also matches the earlier review: main makes no `GetCachedBlob` call there; head/integration make one. No latency was measured. A separate native-wave64 dispatch per owned run verifies all **1,296 data/width/sentinel words** across nine runs. This control creates its own PSO. Head and integration captures match. Inherited `XCL_*` cleared; network off, RX 9070 selected, private enabled caches; no GPU/DXC-absence skip was accepted. **Not tested** The successful native stale-blob probe central to this PR, dispatching the PSO returned by that probe, a real driver upgrade, full suite, native Windows, other GPUs, retail workload, `scripts/smoke.ps1`, timing or FPS. Padded-blob refusal on this stack prevents reproducing the proposed two-create to one-create improvement. **AI use** OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, added test-only traces and the eight-case fixture, ran comparisons, independently verified skips, native calls, counters, blob files, GPU data and source/executable provenance, and drafted this report. Publication authorized by the account owner.
KOLESNiii commented 2026-11-27 10:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-27T10:09:12Z.


Thanks all. Pushed e2615503 (one commit, squashed):

  • No blob export without a cache path (akimfomin, andrewDoing, SzczepanGrela): build_with_blob takes keep (path.is_some()). With XCL_PSO_DISK_CACHE=0, a pipeline made without a blob is not asked for its blob, as on main. New unit test without_a_path_a_pipeline_made_without_a_blob_is_not_asked_for_its_blob counts zero exports there. Its counterpart with a path counts one.
  • No copy of the driver's blob (akimfomin, andrewDoing, ettehn): build_with_blob is generic over the blob. In make_one it is a DriverBlob holding the ID3DBlob, read in place: the hit check reads only its size, and a replacement is written from the driver's buffer. This is the overlay ettehn tried. Performance impact is still unmeasured.
  • Co-author (ettehn): added Co-authored-by: ettehn for the padded-blob reproducer and the Windows verification.

Hardware results so far, linked from the description: native one-create replacement seen on NVIDIA (ettehn, RTX 5070 Ti; mine on ee919a64, RTX 2070 SUPER: creates=1, main 2) and AMD RDNA3 (oni-swr, RX 7800 XT). Wine / vkd3d-proton / RADV refuses the padded blob, so the GPU test skips there and the refused path is what runs (SzczepanGrela). Intel is open (akimfomin's Test Lab #114).

Tested on e2615503: RTX 2070 SUPER, Windows 11 26300, debug. cargo test -p xcl --lib build_with_blob_tests: 11 passed, 0 failed, 0 ignored. The GPU tests (pipeline_cap_tests), the full suite and the smoke run on this head are queued; the description will get the results.

AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7215537634 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7215537634). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-27T10:09:12Z. --- Thanks all. Pushed `e2615503` (one commit, squashed): - **No blob export without a cache path** (akimfomin, andrewDoing, SzczepanGrela): `build_with_blob` takes `keep` (`path.is_some()`). With `XCL_PSO_DISK_CACHE=0`, a pipeline made without a blob is not asked for its blob, as on `main`. New unit test `without_a_path_a_pipeline_made_without_a_blob_is_not_asked_for_its_blob` counts zero exports there. Its counterpart with a path counts one. - **No copy of the driver's blob** (akimfomin, andrewDoing, ettehn): `build_with_blob` is generic over the blob. In `make_one` it is a `DriverBlob` holding the `ID3DBlob`, read in place: the hit check reads only its size, and a replacement is written from the driver's buffer. This is the overlay ettehn tried. Performance impact is still unmeasured. - **Co-author** (ettehn): added `Co-authored-by: ettehn` for the padded-blob reproducer and the Windows verification. Hardware results so far, linked from the description: native one-create replacement seen on NVIDIA (ettehn, RTX 5070 Ti; mine on `ee919a64`, RTX 2070 SUPER: `creates=1`, `main` 2) and AMD RDNA3 (oni-swr, RX 7800 XT). Wine / vkd3d-proton / RADV refuses the padded blob, so the GPU test skips there and the refused path is what runs (SzczepanGrela). Intel is open (akimfomin's Test Lab #114). **Tested** on `e2615503`: RTX 2070 SUPER, Windows 11 26300, debug. `cargo test -p xcl --lib build_with_blob_tests`: 11 passed, 0 failed, 0 ignored. The GPU tests (`pipeline_cap_tests`), the full suite and the smoke run on this head are queued; the description will get the results. AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and wrote this reply.
LocranKing commented 2026-11-27 13:59:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-27T13:59:44Z.


Tested PR #2940 (e2615503) on Windows 11 with an NVIDIA GeForce RTX 3060 Ti (8 GB, driver 32.0.16.2140, Ryzen 5 5500, 32 GB RAM, Windows 11 Build 26300).

Unit & GPU tests

  • cargo test --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --nocapture on e2615503:
    • 15 passed, 0 failed
    • All 11 build_with_blob_tests unit tests (a_stale_blob_the_driver_takes_is_one_create_and_replaced, a_stale_blob_over_the_cap_the_driver_takes_is_capped_after_one_create, a_returned_blob_of_the_same_size_but_other_bytes_is_one_create, the_blob_the_driver_hands_back_is_a_hit_and_not_written_again, etc.) passed.
    • All 4 pipeline_cap_tests passed, including the live GPU test a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced:
      adapter=NVIDIA GeForce RTX 3060 Ti good_blob=1450 padded_blob=1466 creates=1 made=2 refused=0 reused=0 kept_blob=1450
  • cargo test --locked -p xcl --lib -- shaders::tests --nocapture:
    • 7 passed, 0 failed (pso_measurement_compiles_an_exact_synthetic_record skipped: Windows Developer Mode disabled 0x887A002D).
<!-- greyfinch-sync:ivall/xcl:comment:7220200017 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7220200017). Originally posted by [LocranKing](https://github.com/LocranKing) on 2026-11-27T13:59:44Z. --- Tested PR #2940 (`e2615503`) on Windows 11 with an NVIDIA GeForce RTX 3060 Ti (8 GB, driver `32.0.16.2140`, Ryzen 5 5500, 32 GB RAM, Windows 11 Build 26300). ### Unit & GPU tests - `cargo test --locked -p xcl --lib -- build_with_blob_tests pipeline_cap_tests --nocapture` on `e2615503`: - **15 passed, 0 failed** - All 11 `build_with_blob_tests` unit tests (`a_stale_blob_the_driver_takes_is_one_create_and_replaced`, `a_stale_blob_over_the_cap_the_driver_takes_is_capped_after_one_create`, `a_returned_blob_of_the_same_size_but_other_bytes_is_one_create`, `the_blob_the_driver_hands_back_is_a_hit_and_not_written_again`, etc.) passed. - All 4 `pipeline_cap_tests` passed, including the live GPU test `a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced`: `adapter=NVIDIA GeForce RTX 3060 Ti good_blob=1450 padded_blob=1466 creates=1 made=2 refused=0 reused=0 kept_blob=1450` - `cargo test --locked -p xcl --lib -- shaders::tests --nocapture`: - **7 passed, 0 failed** (`pso_measurement_compiles_an_exact_synthetic_record` skipped: Windows Developer Mode disabled `0x887A002D`).
JJAutoCompare commented 2026-11-28 00:36:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T00:36:45Z.


Tested

Clean e26155031dabcc8755830cd1d642b435e4d985f0 on native Windows 11 25H2 (26200.9974), Ryzen 7 3800X, Intel Arc A770 (PCI 8086:56a0, driver 32.0.101.9175), DXC/DXIL 1.9.2602.17, Rust 1.100.1 MSVC debug. I reran the pinned stock libtest with <libtest.exe> --exact <test> --nocapture --test-threads=1.

  • Arc, with XCL_ADAPTER=A770 under the shared GPU lock, ran shaders::pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced. The A770 driver accepted the 2,179-byte padded blob. The stale-cache path made one native create and replaced it with a 2,163-byte blob. The fixture logged creates=1 made=2 refused=0 reused=0 kept_blob=2163. made=2 includes the seed. Native and lock-wrapper exits were 0.
  • CPU controls under shaders::build_with_blob_tests covered without_a_path_a_pipeline_made_without_a_blob_is_not_asked_for_its_blob, a_stale_blob_the_driver_takes_is_one_create_and_replaced, and a_refused_blob_is_compiled_again_without_it.

Total 4 passed, 0 failed, 0 ignored, 0 runtime skips.

Not tested

Dispatch of the returned PSO, startup timing, an actual driver upgrade, other Intel drivers or adapters, retail smoke, or the full suite.

AI use

T3 Code through the Codex harness (gpt-6.2-sol) verified the executable and adapter, ran the existing tests and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7231050434 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7231050434). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-28T00:36:45Z. --- **Tested** Clean `e26155031dabcc8755830cd1d642b435e4d985f0` on native Windows 11 25H2 (26200.9974), Ryzen 7 3800X, Intel Arc A770 (PCI `8086:56a0`, driver `32.0.101.9175`), DXC/DXIL `1.9.2602.17`, Rust `1.100.1` MSVC debug. I reran the pinned stock libtest with `<libtest.exe> --exact <test> --nocapture --test-threads=1`. - Arc, with `XCL_ADAPTER=A770` under the shared GPU lock, ran `shaders::pipeline_cap_tests::a_stale_blob_the_driver_takes_is_made_with_one_create_and_replaced`. The A770 driver accepted the 2,179-byte padded blob. The stale-cache path made **one** native create and replaced it with a 2,163-byte blob. The fixture logged `creates=1 made=2 refused=0 reused=0 kept_blob=2163`. `made=2` includes the seed. Native and lock-wrapper exits were 0. - CPU controls under `shaders::build_with_blob_tests` covered `without_a_path_a_pipeline_made_without_a_blob_is_not_asked_for_its_blob`, `a_stale_blob_the_driver_takes_is_one_create_and_replaced`, and `a_refused_blob_is_compiled_again_without_it`. Total **4 passed, 0 failed, 0 ignored, 0 runtime skips**. **Not tested** Dispatch of the returned PSO, startup timing, an actual driver upgrade, other Intel drivers or adapters, retail smoke, or the full suite. **AI use** T3 Code through the Codex harness (`gpt-6.2-sol`) verified the executable and adapter, ran the existing tests and wrote this report.
KOLESNiii commented 2026-11-28 13:24:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T13:24:28Z.


Help wanted: a full --pipelines pass on a retail title's shader pack (several hours here, so I am asking rather than tying up my machine).

c9c6966a ports this PR onto main e429936c (claimed preparation, running permit, per-pipeline persistence outcomes). On my RTX 2070 SUPER (debug) the whole suite gives 2138 passed, 9 failed, 48 ignored, 25 SKIPPED; the 9 are #3093's and fail the same on main e429936c; my smoke runs skip startup preparation (XCL_PREPARE=0), so they do not reach the changed code, and a full pass takes hours here.

If you have a title's shader pack, please run the offline pass (the same pipeline creation as startup preparation) twice on main e429936c and twice on c9c6966a, each pair from its own empty XCL_DXIL_CACHE:

$env:XCL_DXIL_CACHE = '<empty folder>'   # one fresh folder per build
xcl shaders '<pack>' --precompile --only cs --pipelines   # 1st pass: cold; 2nd pass: warm

and post, for each pass, the summary lines it prints (pipelines made on the GPU / refused, loaded from the driver cache, fresh GPU pipeline creations with the driver-blob persistence counts, time), plus GPU, driver and commit. The interesting case is a warm pass after a driver update (stale blobs the driver takes): there this PR makes each such pipeline with one create instead of two.

— Claude Code (Claude Opus 5.5), on behalf of the PR author

<!-- greyfinch-sync:ivall/xcl:comment:7239913505 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7239913505). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T13:24:28Z. --- **Help wanted: a full `--pipelines` pass on a retail title's shader pack** (several hours here, so I am asking rather than tying up my machine). `c9c6966a` ports this PR onto `main` `e429936c` (claimed preparation, running permit, per-pipeline persistence outcomes). On my RTX 2070 SUPER (debug) the whole suite gives 2138 passed, 9 failed, 48 ignored, 25 SKIPPED; the 9 are #3093's and fail the same on `main` `e429936c`; my smoke runs skip startup preparation (`XCL_PREPARE=0`), so they do not reach the changed code, and a full pass takes hours here. If you have a title's shader pack, please run the offline pass (the same pipeline creation as startup preparation) twice on `main` `e429936c` and twice on `c9c6966a`, each pair from its own empty `XCL_DXIL_CACHE`: ```powershell $env:XCL_DXIL_CACHE = '<empty folder>' # one fresh folder per build xcl shaders '<pack>' --precompile --only cs --pipelines # 1st pass: cold; 2nd pass: warm ``` and post, for each pass, the summary lines it prints (pipelines made on the GPU / refused, loaded from the driver cache, fresh GPU pipeline creations with the driver-blob persistence counts, time), plus GPU, driver and commit. The interesting case is a warm pass after a driver update (stale blobs the driver takes): there this PR makes each such pipeline with one create instead of two. — Claude Code (Claude Opus 5.5), on behalf of the PR author
bmjask commented 2026-11-29 14:50:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T14:50:18Z.


Current-main audit (2026-11-29): salvage/rebase; good cache-safe focused fix.

I read the full build_with_blob refactor and its tests. Keeping the successfully created PSO when a stale blob is accepted-but-recompiled removes a genuinely redundant native create, without changing DXIL, root signatures, descriptors, or cache naming. The helper retains the previous over-cap behavior and handles refused blobs separately. Native NVIDIA/AMD/Intel evidence is present in the thread.

This head is stale relative to current preparation/pipeline-library work and its PR-description check is red, so it needs a current-main rebase and refreshed required checks. Keep it as the one focused stale-probe fix rather than folding it into broader cache work.

Cache impact: safe for existing PSO identities; it changes reuse/persistence behavior, not the key. Disposition: rebase and merge candidate.

Review assisted by Codex; exact model name was not exposed in this session. I did not rerun the GPU fixture.

<!-- greyfinch-sync:ivall/xcl:comment:7257615271 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2940#issuecomment-7257615271). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-29T14:50:18Z. --- **Current-main audit (2026-11-29): salvage/rebase; good cache-safe focused fix.** I read the full `build_with_blob` refactor and its tests. Keeping the successfully created PSO when a stale blob is accepted-but-recompiled removes a genuinely redundant native create, without changing DXIL, root signatures, descriptors, or cache naming. The helper retains the previous over-cap behavior and handles refused blobs separately. Native NVIDIA/AMD/Intel evidence is present in the thread. This head is stale relative to current preparation/pipeline-library work and its PR-description check is red, so it needs a current-main rebase and refreshed required checks. Keep it as the one focused stale-probe fix rather than folding it into broader cache work. Cache impact: **safe for existing PSO identities**; it changes reuse/persistence behavior, not the key. Disposition: rebase and merge candidate. Review assisted by Codex; exact model name was not exposed in this session. I did not rerun the GPU fixture.
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!2940
No description provided.