Skip to content

Shaders: reuse offline compute PSOs and compact repeated atomic shaders - #2371

Merged
theaustinayers merged 3 commits into
xcl-dev:mainfrom
bmjask:perf/offline-compute-pipelines
Nov 26, 2026
Merged

theaustinayers merged 3 commits into
xcl-dev:mainfrom
bmjask:perf/offline-compute-pipelines

Conversation

@bmjask

@bmjask bmjask commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Split-eligible compute programs can use an offline whole-pipeline blob at runtime. A missing or rejected blob falls back to building the split pieces. Part of #2088.

What is in it

  • Reuse the cached whole pipeline with its ordinary compute root signature. A fresh-process GPU test covers cache hit, stale blob and miss.
  • Use compact DXIL for repeated split-wave compute blocks with returning buffer atomic adds. Retain the existing table budget per wave.
  • Add opt-in offline timing and GPU output replay for locally supplied shader inputs. Slot reuse and duplicate-phi experiments are test-only.

Tested

  • Head f8f9de65, Windows 11 build 26200, Core i9-12900K, RTX 4090 driver 610.88, Rust 1.100.0.
  • cargo build --locked --workspace; cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output (debug): 1,435 passed, 0 failed, 47 ignored. 25 explicit GPU skip messages across 15 tests, including wave64 and unavailable instruction forms. The bridged-mask barrier regression passed on this head.
  • cargo test --locked -p xcl --test gpu_compute_e2e -- --test-threads=1 --show-output with XCL_HEAP_WINDOWS=1: 7 passed, 0 failed, 0 ignored, 0 skipped for each of XCL_DIRECT_DXIL=0 and 1.
  • Earlier RTX 4090 measurements on fa14dc47: five cold trials per form on each of two recorded shaders. Median driver creation fell from 4.07 s to 0.60 s and from 4.07 s to 0.52 s. Output counters and IDs matched; these measurements predate the rebase.

Regression run
Release, same title, machine and 60-second guest interval, using scripts/smoke.ps1.

Main

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1020 (PresentX 1020)
presents per 2 s (last 3): 47 47 41
device removals: 0
crashes: 0
peak commit: 15910 MB

PR head

xcl-smoke v1
commit: f8f9de654f82aba63dc80451b895ac4e49e691d6
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1266 (PresentX 1266)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16336 MB

Not tested

  • AMD or Intel GPU on this revision. The short smoke establishes startup regression coverage. World-entry performance and cold-compile timing on this head remain unmeasured.

AI use
OpenAI Codex, GPT-6: implementation, test harness, upstream conflict resolution, fixture update, validation and PR description.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

@SlopTart

Copy link
Copy Markdown

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).
One red on this lane, and it is invisible to the usual gpu_ sweep because the test name does not contain gpu_: gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier fails deterministically, 3/3 solo at --test-threads=1 with a cold cache:

panicked at crates/xcl/src/gpu/recomp/lower_dxil.rs:1155:9:
assertion `left == right` failed: group barriers in the program:
  left: 3
 right: 1

The disassembled compute_split program contains three call void @dx.op.barrier(i32 80, i32 9) where the test expects only the one at the start. The barrier count is taken over XCL's own lowering disassembly, so DXC does not compile this step; the run uses the pinned official DXC build the lane normally runs (the same one other checks here pass with). The companion new test recorded_split_selects_cached_whole_or_pieces passes 4/4, and the d3d12core.dll + 0x1AB118 crash site from #2338/#2344/#2349 does not reproduce at this head.

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.

@bmjask bmjask left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No confirmed source-level cache/keying defect found; whole-blob hit/miss/rejection fallback coverage is useful. This draft is not merge-ready: it is dirty/non-mergeable, current Windows build/test and PR-description checks fail, the full suite is not clean, and paired smoke plus AMD/Intel/in-game validation are pending. Please resolve/rebase and provide required evidence before merge.

@bmjask
bmjask marked this pull request as ready for review November 25, 2026 23:48
@bmjask
bmjask force-pushed the perf/offline-compute-pipelines branch from 49aae6c to c6a613f Compare November 25, 2026 23:51
@bmjask
bmjask force-pushed the perf/offline-compute-pipelines branch from c6a613f to f8f9de6 Compare November 25, 2026 23:53
@DavidM1911

Copy link
Copy Markdown
Contributor

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 a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier failure is fixed.

Thanks!

— Devin

@theaustinayers
theaustinayers merged commit b49be18 into xcl-dev:main Nov 26, 2026
2 of 3 checks passed
Jordanmuss99 added a commit to Jordanmuss99/xcl that referenced this pull request Nov 26, 2026
Track official main through PR xcl-dev#2371, including the cached whole compute path and repeated-block lowering. Keep the fork prefetch and DirectStorage changes on the integration branch. The merged release tree passed the Windows workspace suite and the RTX 4070 Ti cached-whole and split fallback checks.
Royalflamejlh pushed a commit to Royalflamejlh/xcl that referenced this pull request Nov 26, 2026
Seven upstream commits. Conflicts in four files: the README keeps both
bullets; dxc.rs keeps the fork's compile_with (a compiler on a private
heap) under upstream's compile_whole and linked form; a dispatch chain's
refusal warning stays, with ComputeBuild::Chain; the split fixture keeps
the fork's optional chain with upstream's timing block inside it.
driver_cache::path is back: upstream's new test calls it.

Software adapter: cargo test --release -p xcl --lib: 1531 passed,
1 failed, 25 ignored; 59 tests that open the hardware GPU not run. The
failure, sparse's flush_parked_does_not_free_or_reuse_tiles_while_unmap_
is_in_flight, passed three times of three run alone (it reads the clock;
a shader build was using the machine). Not run on a title yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants