Shaders: import exact PSOs from prior libraries #3100

Merged
bmjask merged 1 commit from upstream-pr/3100 into main 2026-11-28 15:37:54 +00:00
bmjask commented 2026-11-28 05:26:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T05:26:23Z.


A semantic receipt change currently discards the previous native pipeline library even when many exact PSOs remain compatible. This makes an otherwise safe cache invalidation rebuild every recipe.

What is in it

  • Opens the previous graphics or compute pipeline library as an opportunistic import source during preparation.
  • Loads only the current content-addressed name with the current descriptor and root signature; D3D12 rejection, missing entries, unsupported libraries and corrupt files fall through to normal compilation.
  • Copies accepted compute, graphics and mesh/stream PSOs into the replacement library.
  • Keeps imports parallel, with synchronization only for colliding names.
  • Documents the migration behavior.

Tested

Commit 2de72223 on Windows 11, NVIDIA GeForce RTX 4090, DXC 1.9.2602.17, Rust stable MSVC, debug build:

  • cargo test -p xcl --lib pipeline_library -- --test-threads=4: 6 passed, 0 failed, 0 ignored; no skips.
  • cargo test -p xcl --lib warm_library -- --test-threads=4: 4 passed, 0 failed, 0 ignored; no skips.
  • cargo test --workspace -- --test-threads=4: 1,999 passed, 7 failed, 28 ignored; 25 reported GPU skips. Each failure reproduced individually on clean main e13d6250; none is in a file changed by this PR. This is not reported as a clean suite. Issue #3093 and draft PRs #3150 / #3157 cover six of the inherited failures; direct_msaa_loads_precede_get_dimensions is the seventh.

Fresh-process synthetic migration at pre-rebase commit 363e4ff3, Windows 11, NVIDIA GeForce RTX 5070 / driver 616.92:

  • Process A seeded 128 distinct compute PSOs.
  • Process B imported 96 exact PSOs and built 32 new PSOs.
  • Process C reopened all 128 replacement PSOs without builds.
  • All assertions passed without skips; this did not cover guest execution or a real title corpus.

Regression run

Not run. This remains a draft until the required clean main/head smoke blocks are available.

Not tested

  • Required clean full workspace suite after the inherited main failures are fixed.
  • Required main/head title smoke comparison.
  • Release build at rebased commit 2de72223.
  • Large-corpus migration timing and imported-entry count.
  • AMD and Intel adapters.

AI use

Codex with GPT-5 implemented the change, tests and documentation; rebased it, ran the commands above, and reviewed the production logic. A reviewer-agent pass identified and prompted fixes for global load serialization, migration coverage, descriptor-mismatch coverage, unique import counting, and a cross-module test race.

<!-- greyfinch-sync:ivall/xcl:issue:5537043908 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3100). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-28T05:26:23Z. --- A semantic receipt change currently discards the previous native pipeline library even when many exact PSOs remain compatible. This makes an otherwise safe cache invalidation rebuild every recipe. **What is in it** - Opens the previous graphics or compute pipeline library as an opportunistic import source during preparation. - Loads only the current content-addressed name with the current descriptor and root signature; D3D12 rejection, missing entries, unsupported libraries and corrupt files fall through to normal compilation. - Copies accepted compute, graphics and mesh/stream PSOs into the replacement library. - Keeps imports parallel, with synchronization only for colliding names. - Documents the migration behavior. **Tested** Commit `2de72223` on Windows 11, NVIDIA GeForce RTX 4090, DXC 1.9.2602.17, Rust stable MSVC, debug build: - `cargo test -p xcl --lib pipeline_library -- --test-threads=4`: 6 passed, 0 failed, 0 ignored; no skips. - `cargo test -p xcl --lib warm_library -- --test-threads=4`: 4 passed, 0 failed, 0 ignored; no skips. - `cargo test --workspace -- --test-threads=4`: 1,999 passed, 7 failed, 28 ignored; 25 reported GPU skips. Each failure reproduced individually on clean `main` `e13d6250`; none is in a file changed by this PR. This is not reported as a clean suite. Issue #3093 and draft PRs #3150 / #3157 cover six of the inherited failures; `direct_msaa_loads_precede_get_dimensions` is the seventh. Fresh-process synthetic migration at pre-rebase commit `363e4ff3`, Windows 11, NVIDIA GeForce RTX 5070 / driver 616.92: - Process A seeded 128 distinct compute PSOs. - Process B imported 96 exact PSOs and built 32 new PSOs. - Process C reopened all 128 replacement PSOs without builds. - All assertions passed without skips; this did not cover guest execution or a real title corpus. **Regression run** Not run. This remains a draft until the required clean main/head smoke blocks are available. **Not tested** - Required clean full workspace suite after the inherited `main` failures are fixed. - Required main/head title smoke comparison. - Release build at rebased commit `2de72223`. - Large-corpus migration timing and imported-entry count. - AMD and Intel adapters. **AI use** Codex with GPT-5 implemented the change, tests and documentation; rebased it, ran the commands above, and reviewed the production logic. A reviewer-agent pass identified and prompted fixes for global load serialization, migration coverage, descriptor-mismatch coverage, unique import counting, and a cross-module test race.
andrewDoing commented 2026-11-28 05:41:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T05:41:56Z.


I checked migration across fresh processes on RTX 5070 / NVIDIA 616.92 at head 363e4ff36b599c4b481a94532cb9f20f788c0c5b, with a test-only fixture using production begin, load_compute, store, finish, and NativeLibrary::open.

  • Process A seeded 128 distinct content-addressed compute programs.
  • Process B requested 96 of those plus 32 new programs. Per-entry hit/miss assertions passed; the production log reported 96 exact imports, and 32 were built.
  • Process C reopened all 128 replacement PSOs by hash and descriptor without builds.

All three fresh processes passed without skips. The two disk files were each 67,208 bytes. This checks a bounded synthetic mixed corpus and persistence, not guest execution, shader dispatch, a real title corpus, concurrent workers, or throughput.

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

<!-- greyfinch-sync:ivall/xcl:comment:7234829654 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3100#issuecomment-7234829654). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-28T05:41:56Z. --- I checked migration across fresh processes on RTX 5070 / NVIDIA 616.92 at head `363e4ff36b599c4b481a94532cb9f20f788c0c5b`, with a test-only fixture using production `begin`, `load_compute`, `store`, `finish`, and `NativeLibrary::open`. - Process A seeded 128 distinct content-addressed compute programs. - Process B requested 96 of those plus 32 new programs. Per-entry hit/miss assertions passed; the production log reported **96 exact imports**, and 32 were built. - Process C reopened all 128 replacement PSOs by hash and descriptor without builds. All three fresh processes passed without skips. The two disk files were each 67,208 bytes. This checks a bounded synthetic mixed corpus and persistence, not guest execution, shader dispatch, a real title corpus, concurrent workers, or throughput. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the checks; Codex reviewed and prepared this report.
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!3100
No description provided.