Repository navigation
Conversation
…time `--pipelines` (and startup shader preparation) creates a compute pipeline with the driver's blob of an earlier run. A driver that cannot use the blob may compile from the DXIL and still succeed (xcl-dev#1774); the size check on the returned blob then dropped that pipeline and called CreateComputePipelineState again without the blob, in the same XCL_PIPELINE_THREADS slot (xcl-dev#2939). The create-with-blob decision moves into build_with_blob, which takes the native create as a closure: a successful probe is the pipeline (made, with one create). It counts as reused when its blob has the size handed over, as before; otherwise its own blob replaces the stale one on disk. A refused blob is still compiled again without it, and over the cap is still capped and removed. Over the cap, a stale blob the driver takes is now made and replaced instead of capped: its compile has already happened. Tests: unit tests drive build_with_blob with a fake driver (stale blob taken, same-size blob with other bytes, refused blob under and over the cap, no blob), and a GPU test repeats ettehn's reproducer: the stock pipeline's blob with 16 bytes appended is taken by the driver, made with one native create, and replaced by the driver's own blob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I ran the eight exact Returning |
|
I compared the native compute PSO path on parent
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. |
|
Independent native D3D12 run on exact I also tried a local overlay for the review above: retain the OpenAI Codex (6.2sol) assisted with verification. |
|
amd-win check of
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; AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this. |
|
The Radeon and NVIDIA runs both exercised the accepted padded-blob path. Intel’s behavior is still open. I put the exact |
--pipelinesand 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 sameXCL_PIPELINE_THREADSslot. 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 ofPipelines::make_oneintobuild_with_blob, which takes the native create andGetCachedBlobas closures (the same pattern ascreate_graphics_pso_cachedinreal.rs).make_onekeeps the slot, counters and file handling.build_with_blob_tests(no GPU) drive the helper with a fake driver: stale blob taken (ettehn's 1,418 → 1,402 bytes), same over the cap, akimfomin's same-size/different-bytes control (asserts one create only, leaving the hit rule open for discussion in Shaders: avoid a second compute PSO create after a successful stale-cache probe #2939), the blob handed back, a pipeline without a blob, refused blob under and over the cap, no blob.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 onPipelines) and replaced on disk. It reports SKIPPED when the driver refuses the padded blob.Tested
cargo test -p xcl --lib build_with_blob_tests: 8 passed, 0 failed, 0 ignoredpipeline_cap_testson this head, and the new GPU test onmain+ the counter (to show it fails without the fix): pending, queuedcargo test --workspace -- --test-threads=4: pending, queuedRegression run
scripts/smoke.ps1on a retail game, main 8b957be and this head, both from the same DXIL cache with no driver blobs, so both go through startup pipeline preparationNot tested
real.rs) are unchanged. They count any successful probe as a hit and never replace the stale blob, see Shaders: avoid a second compute PSO create after a successful stale-cache probe #2939 for the proposal.AI use
🤖 Generated with Claude Code