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

Manually merged
github merged 3 commits from gh-pr/2371/head into gh-pr/2371/base 2026-11-26 05:29:16 +00:00
Owner

@⁠bmjask on GitHub · 2026-11-25 16:59 UTC · original
bmjask:perf/offline-compute-pipelines → main · +643 −22 · 12 files · 3 commits · merged 2026-11-26 00:48 UTC

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.

**@⁠bmjask** on GitHub · 2026-11-25 16:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2371) `bmjask:perf/offline-compute-pipelines` → `main` · +643 −22 · 12 files · 3 commits · merged 2026-11-26 00:48 UTC 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:13 +00:00
github manually merged commit f8f9de654f into gh-pr/2371/base 2026-11-26 05:29:16 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 18:56 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-25 18:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/2371#issuecomment-7171605327) 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
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 19:06 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).
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.

**@⁠SlopTart** on GitHub · 2026-11-25 19:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2371#issuecomment-7171821637) **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:23 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 a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier failure is fixed.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 00:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2371#issuecomment-7178702198) 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
This discussion has been locked. Commenting is limited to contributors.
No description provided.