Shaders: --pipelines blobs are made as a title's run asks for them #2515

Open
github-bot wants to merge 3 commits from github-bot/gh-2515 into main AGit
Owner

@⁠oni-swr on GitHub · 2026-11-25 21:17 UTC · original
oni-swr:t3/xcl-fix-2453-precompile-pso → main · +179 −74 · 5 files · 3 commits · draft

xcl shaders --precompile --pipelines blobs could be rejected on the first title run, then deleted and rebuilt. The offline pass and runtime now share the translated compute descriptor, key the driver cache by static samplers, and enable device layers before creating the device. Fixes #2453. Part of #1833 and #1269.

#1368 and #1420 are still open and overlap the node-mask and static-sampler fixes. The rebase on b49be183 preserves #2371's cached whole-pipeline lookup before dispatch-chain construction.

What is in it

  • hle/d3d12x/real.rs and shaders.rs share a compute descriptor with node mask 0. Runtime descriptors preserve the title's flags.
  • real.rs, real/dispatch_chain.rs, real/two_pass_identity.rs, and shaders.rs include static samplers in driver cache keys for whole pipelines, dispatch-chain pieces, and the two-pass compute pass. Sampler-free blobs keep their existing filenames. The cache replay test uses the sampler-aware key, and README.md documents which blobs can rebuild.
  • real.rs and shaders.rs use the same debug-layer and DRED setup before device creation.

Tested

  • Head f655cfdac728967c57f233f34eac3b8fec1907c4 on an AMD Ryzen 7 5700X3D, Windows build 26200.9974, rustc 1.100.0 (MSVC), debug. CPU only, with XCL_ADAPTER=NONE_CPU_ONLY and XCL_SAMPLE_* unset.
  • cargo build --workspace -j 4 and cargo test --workspace --no-run -j 4 passed.
  • cargo test -p xcl --lib -j 4 -- translated_compute_desc driver_cache compute_blob two_pass_identity shaders:: a_chains_scratch_is_bounded --skip recorded_split_selects_cached_whole_or_pieces --skip stale_blob_cannot_bypass_the_offline_pipeline_cap --skip split_compute_program_prebuilds_and_caches_chain_pieces --skip pso_measurement_compiles_an_exact_synthetic_record --skip retail_pack_sample --test-threads=4: 18 passed, 0 failed, 0 ignored, 0 runtime skips. The command excluded three GPU tests and two sample-dependent tests.

Regression run

  • Pending scripts/smoke.ps1 -Game <folder> on main and this exact PR head, using the same title and duration. Draft pending GPU evidence.

Not tested

  • Full GPU-backed workspace suite, real-driver cache reuse and retry behavior, debug-layer or DRED behavior on hardware, and title smoke runs. The offline CLI uses environment variables for its device settings because it does not load a title's xcl.toml.

AI use

  • Claude Code (Claude Opus 5.5) wrote and tested the original changes.
  • Codex (gpt-6.2-sol) resolved the rebase conflicts, updated the cache replay test and README, ran the CPU checks reported here, and updated this description.
**@⁠oni-swr** on GitHub · 2026-11-25 21:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2515) `oni-swr:t3/xcl-fix-2453-precompile-pso` → `main` · +179 −74 · 5 files · 3 commits · draft `xcl shaders --precompile --pipelines` blobs could be rejected on the first title run, then deleted and rebuilt. The offline pass and runtime now share the translated compute descriptor, key the driver cache by static samplers, and enable device layers before creating the device. Fixes #2453. Part of #1833 and #1269. #1368 and #1420 are still open and overlap the node-mask and static-sampler fixes. The rebase on `b49be183` preserves #2371's cached whole-pipeline lookup before dispatch-chain construction. **What is in it** - `hle/d3d12x/real.rs` and `shaders.rs` share a compute descriptor with node mask 0. Runtime descriptors preserve the title's flags. - `real.rs`, `real/dispatch_chain.rs`, `real/two_pass_identity.rs`, and `shaders.rs` include static samplers in driver cache keys for whole pipelines, dispatch-chain pieces, and the two-pass compute pass. Sampler-free blobs keep their existing filenames. The cache replay test uses the sampler-aware key, and `README.md` documents which blobs can rebuild. - `real.rs` and `shaders.rs` use the same debug-layer and DRED setup before device creation. **Tested** - Head `f655cfdac728967c57f233f34eac3b8fec1907c4` on an AMD Ryzen 7 5700X3D, Windows build 26200.9974, rustc 1.100.0 (MSVC), debug. CPU only, with `XCL_ADAPTER=NONE_CPU_ONLY` and `XCL_SAMPLE_*` unset. - `cargo build --workspace -j 4` and `cargo test --workspace --no-run -j 4` passed. - `cargo test -p xcl --lib -j 4 -- translated_compute_desc driver_cache compute_blob two_pass_identity shaders:: a_chains_scratch_is_bounded --skip recorded_split_selects_cached_whole_or_pieces --skip stale_blob_cannot_bypass_the_offline_pipeline_cap --skip split_compute_program_prebuilds_and_caches_chain_pieces --skip pso_measurement_compiles_an_exact_synthetic_record --skip retail_pack_sample --test-threads=4`: 18 passed, 0 failed, 0 ignored, 0 runtime skips. The command excluded three GPU tests and two sample-dependent tests. **Regression run** - Pending `scripts/smoke.ps1 -Game <folder>` on main and this exact PR head, using the same title and duration. Draft pending GPU evidence. **Not tested** - Full GPU-backed workspace suite, real-driver cache reuse and retry behavior, debug-layer or DRED behavior on hardware, and title smoke runs. The offline CLI uses environment variables for its device settings because it does not load a title's `xcl.toml`. **AI use** - Claude Code (Claude Opus 5.5) wrote and tested the original changes. - Codex (gpt-6.2-sol) resolved the rebase conflicts, updated the cache replay test and README, ran the CPU checks reported here, and updated this description.
`xcl shaders --pipelines` makes each compute pipeline with NodeMask 0;
a title's run copied the title's description, so a title that passes
NodeMask 1 handed the driver a description the offline blob was not
made for. The blob's file name has only the DXIL and the flags, so both
forms share one file: the run refuses the offline blob ("compute retry"),
deletes it and writes its own, which the next offline pass refuses in
turn (#2453; vkd3d-proton's refusal is measured in #1368).

translated_compute_desc builds the description for both sides: the
DXIL, its root signature, no blob, NodeMask 0 (XCL drives one adapter,
where 0 and 1 are the same node) and the title's flags, which are in
the blob's file name. compute_container and Pipelines::make_one both
use it; make_one no longer owns the root signature through the
description, so its three explicit drops go.

Part of #2453.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A compute program's static samplers live only in its root signature:
the programs of two S# sets can translate to one DXIL, and the blob
file name (DXIL hash, length, flags) was the same for both. Whichever
ran second was handed the other's blob, the driver refused it
("compute retry"), and the file was deleted and written again - in a
title's run and in `xcl shaders --pipelines` alike (#2453).

driver_cache::name_for / path_for take the samplers and add an FNV
digest of them (two_pass_identity's samplers_hash_into, as the two-pass
compute key does) as `-s<hash>`. A program without static samplers
keeps its old file name, so its blobs of earlier runs still apply.
compute_container gets the samplers from its callers (the single
translated pipeline, the dispatch chain's pieces), and the compute pass
of two-pass pipelines uses them too. The in-memory blob key already
differs by root signature.

Part of #2453.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assisted-by: Codex (gpt-6.2-sol)
`xcl shaders --precompile --pipelines` made its device without the
layers a title's run turns on: XCL_D3D12_DEBUG / d3d12_debug and
XCL_DRED were ignored. With the debug layer asked for, the layer came
on later, when precompile's capability queries started the GPU test
runner (runner::init enables it before its own device), and enabling
the debug layer after a device is made removes that device - the one
the pass was making its pipelines on (#2453).

enable_device_layers is the debug layer / DRED setup of real::init,
moved into a function; init and Pipelines::new call it before they
make their device. The debug layer goes on once per process
(agility::enable_debug_layer), so the runner's later call does nothing.

Part of #2453.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:32:37 +00:00
Author
Owner

@⁠KDenKC on GitHub · 2026-11-25 21:19 UTC · original

An NVIDIA data point for the "compute retry on run 1" part. This is from main, not from this PR's head: on an RTX 5090 (driver 621.24, Windows 11 26200) the --precompile --only cs --pipelines blobs aren't refused on the title's first run.

I checked the logs of the title runs that came right after a precompile, with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1, release. driver_cache::note(false, …) logs a driver blob kept on disk was refused … at the first refusal of any size, so it is the line to look for:

tree, run … kept on disk was refused … compute pipelines made from the driver's blob of an earlier run (last power of two logged)
2898511, first run after the precompile (menus only) 0 2
2898511, second run (to the world, 600 s) 0 512
2898511 + #2404, first run after its precompile (600 s) 0 2048

So on this driver the title's NodeMask, its static samplers and the missing device layers offline don't make the driver refuse the offline blobs. What #2453 describes may be AMD-specific (or specific to a driver), and the RX 7800 XT check you planned is the one that can show the fix. I haven't run this PR's head. On NVIDIA, I'd expect it to show only that programs with static samplers get their blobs made once more under the new names.

AI use: Claude Code (Claude Opus 5.5) read the run logs and the driver_cache code, and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-25 21:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2515#issuecomment-7174913409) An NVIDIA data point for the "`compute retry` on run 1" part. This is from `main`, not from this PR's head: **on an RTX 5090 (driver 621.24, Windows 11 26200) the `--precompile --only cs --pipelines` blobs aren't refused on the title's first run.** I checked the logs of the title runs that came right after a precompile, with `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1`, release. `driver_cache::note(false, …)` logs `a driver blob kept on disk was refused …` at the first refusal of any size, so it is the line to look for: | tree, run | `… kept on disk was refused` | `… compute pipelines made from the driver's blob of an earlier run` (last power of two logged) | |---|---|---| | `2898511`, first run after the precompile (menus only) | 0 | 2 | | `2898511`, second run (to the world, 600 s) | 0 | 512 | | `2898511` + #2404, first run after its precompile (600 s) | 0 | 2048 | So on this driver the title's `NodeMask`, its static samplers and the missing device layers offline don't make the driver refuse the offline blobs. What #2453 describes may be AMD-specific (or specific to a driver), and the RX 7800 XT check you planned is the one that can show the fix. I haven't run this PR's head. On NVIDIA, I'd expect it to show only that programs with static samplers get their blobs made once more under the new names. AI use: Claude Code (Claude Opus 5.5) read the run logs and the `driver_cache` code, and wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 21:32 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 21:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2515#issuecomment-7175204422) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 22:33 UTC · original

Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of a_titles_pipeline_is_described_to_the_driver_as_the_offline_pass_describes_it and one_dxil_under_other_static_samplers_is_another_file: 2 passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 22:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2515#issuecomment-7176503251) **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `a_titles_pipeline_is_described_to_the_driver_as_the_offline_pass_describes_it` and `one_dxil_under_other_static_samplers_is_another_file`: 2 passed. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 01:36 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 01:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2515#issuecomment-7179945228) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2515/head:github-bot/gh-2515'
git switch 'github-bot/gh-2515'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2515'
git switch 'github-bot/gh-2515'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2515'
git switch 'github-bot/gh-2515'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2515'
git switch 'main'
git merge --squash 'github-bot/gh-2515'
git switch 'main'
git merge --ff-only 'github-bot/gh-2515'
git switch 'main'
git merge 'github-bot/gh-2515'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.