Skip to content

Shaders: offline compute precompile misses nonzero PSO flags #2995

Backlog

Description

@KOLESNiii

xcl shaders --precompile --pipelines builds compute driver blobs with Flags = 0. A translated compute PSO requested with nonzero flags looks under a different disk-cache name, so this offline blob cannot satisfy that lookup. This is a conditional coverage gap; its frequency and driver-side compilation cost have not been measured.

At commit 8b957bec6f82495aec940944c6bf47faa02db590:

  • crates/xcl/src/shaders.rs:1461-1489 passes DXIL and samplers to make_one, without title PSO flags. Lines 1515-1519 default the compute descriptor, including Flags; lines 1521-1526 select its cache path and lines 1571-1578 create and save the blob.
  • crates/xcl/src/hle/d3d12x/real.rs:4419-4433 copies the title descriptor, retains its flags, and looks up the in-memory and disk blobs using those flags. real.rs:4520-4522 includes the flags in the filename. The dispatch-chain builder also carries the title flags into its piece descriptors (crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs:45-46).
  • Consequently, even with identical DXIL and chain mode, a nonzero-flags lookup cannot find the offline zero-flags file. On an otherwise cold cache the runtime must build the relevant PSO itself; the zero-flags blob can still be useful to other matching PSOs or subsequent offline runs. Driver caching and asynchronous compilation may affect the observed cost.

Consider recording the flags as part of a compute pipeline recipe, then precompiling each observed valid flags variant under its matching descriptor and cache key. If offline shader-only inputs cannot provide that information, document the coverage limit. Add a regression that exercises a supported nonzero flag and checks that the runtime finds the corresponding offline artifact. Existing #2453 and PR #2515 cover other offline/runtime descriptor parity issues; #2515 preserves runtime flags but still constructs the offline descriptor from defaults.

Verification was static on Linux; no Windows driver or title run was performed.

Category: pso_pipeline_perf | Verified at commit 8b957be

Activity

  1. ettehn commented on Nov 27, 2026

    @ettehn
    Contributor

    Tested: Reproduced the disk-cache gap on clean main 623d02e465a17497a757a4ce867f482b0a6c8f3b, Windows 11 build 26200, RTX 5070 Ti Laptop / 621.24, and SDK DXC 1.8.2502.11. In three isolated cache directories, the unmodified xcl shaders --precompile --pipelines --windows 4 compiled one synthetic console shader and wrote only its -0.pso. A test-only extension of the existing compute dispatch fixture called the runtime hook with the same shader. Each row ran in a fresh process. The fixture enabled retention for small blobs.

    Runtime step XCL disk hits / rejects / stores
    Flags 0, first 1 / 0 / 0
    Flags 4, first / second 0 / 0 / 1, then 1 / 0 / 0
    Flags 8, first / second 0 / 0 / 1, then 1 / 0 / 0

    All 15 runtime dispatches used the translated whole PSO and matched all 1,536 expected readback words. The same 6,160-byte DXIL produced filenames that differed only in the flags suffix. This measures the XCL disk lookup. It does not measure internal driver compilation time or whether a retail title uses these flags. Split-chain behavior was not tested.

    AI use: OpenAI Codex (GPT-6) wrote and ran the synthetic fixture and drafted this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions