Shaders: reuse offline compute PSOs and compact repeated atomic shaders #2361
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2371"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T16:59:07Z.
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
Tested
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-outputwithXCL_HEAP_WINDOWS=1: 7 passed, 0 failed, 0 ignored, 0 skipped for each ofXCL_DIRECT_DXIL=0and1.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
PR head
Not tested
AI use
OpenAI Codex, GPT-6: implementation, test harness, upstream conflict resolution, fixture update, validation and PR description.
upstream-sync referenced this pull request2026-11-25 18:03:20 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:56:18Z.
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):The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.
— Devin
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T19:06:10Z.
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 targetx86_64-pc-windows-gnurun 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 containgpu_:gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfails deterministically, 3/3 solo at--test-threads=1with a cold cache:The disassembled
compute_splitprogram contains threecall 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 testrecorded_split_selects_cached_whole_or_piecespasses 4/4, and thed3d12core.dll + 0x1AB118crash 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.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:43:16Z.
Review: COMMENTED
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:23:16Z.
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 earliera_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfailure is fixed.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by humsterbumster on 2026-11-26T13:57:28Z.
Offline compute pass measured on Linux with the same retail title (1.0.2.1) at
b49be18, this PR merged. One behaviour first, because it silently produces a no-op run.A folder argument finds no shader records for this title. The installed folder has no loose
shaders\directory; the corpus isshaders.rpf(411,695,600 B). Pointing the tool at the installed folder:109 inputs, 0 compiled, 0 made, no error, 292 s and 24.4 GB peak RSS. The 109 are the folder's loose files, not shader records.
Naming the container works.
xcl shaders shaders.rpf --precompile --only cs --pipelines --used-only --split 1is read as an RPF9 package and makes pipelines:pipelines: 1500 made, 0 refusedin 15 min at ~300% CPU / 11.7 GB RSS, driver blobs 4,226 -> 4,402,vkd3d-proton.cache0 -> 283,440 B on exit. That is ~1.7 pipelines/s against 0.23/s in the title's own load, so the offline path is the right lever here.The pass stops at 1,500 with two stack overflows, and then hangs. Twice, at the same count:
after which all 24 threads sit in
futex_do_wait, utime stays frozen for minutes and the GPU is at 0 %; the summary lines never print and the process never exits on its own. Reproduced with 128 MB and with 512 MB pipeline-worker stacks, so it is not one of the namedxcl-pso*threads. This build ofmainalso carries local, uncommitted changes (worker stack size, a huge-compile cgroup gate, driver-blob interning), so I am not claiming it as a defect of this PR - just that 1,500 is where this title's shader set reaches it.Cache plumbing checked (vkd3d-proton 3.2.0,
libs/vkd3d/cache.c):vkd3d-proton.cacheis read at start,.cache.writeappended and merged on clean exit (vkd3d_pipeline_library_disk_cache_merge, cache.c:3173), and a leftover.writeis merged on the next start (cache.c:2968-3024), so the 1,500 made here survive as long as the process exits cleanly.Lane: Arch, kernel 7.3.5, Wine 11 (Proton), vkd3d-proton 3.2.0
ec20719, RTX 5090, Rust 1.100.0,x86_64-pc-windows-gnu, 1080p.