Shaders: add selective --replay-chain-whole validation, warming, and reuse test #2819
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2819
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2819"
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?
@Decodere on GitHub · 2026-11-26 14:26 UTC · original
Decodere:feat-chain-whole-replay→main· +1902 −2 · 4 files · 1 commits · openImplements Steps 2–4 of #2741: selective offline validation and native
.chain.psowhole-form prewarming (xcl shaders <input> --replay-chain-whole <capture.jsonl> [--replay-cutoff <N>]), plus a fresh-process real-GPU E2E reuse proof across hookedExecuteIndirectand direct fallback (Dispatchwithout recording allocator). Regular--precompile,--pipelines,--used-only, chain pieces, and runtime fallback behavior are unchanged. Targetsmainindependently and merges cleanly with #2786 in either order (disjoint hunks incrates/xcl/src/hle/d3d12x/real.rs).Part of #2741
Part of #2088
Part of #2508
What is in it
crates/xcl/src/shaders/chain_whole_replay.rs(new):schema_version: 1UTF-8 JSONL parser accepting #2786's 12-fieldtranslation_optionsheader (validatingmem_windowsandsplit_wave64per demand record), ordered first-demand records, exactmin(cli_cutoff, header.sequence_cutoff)selection, and exact FNV-1a 64chain_root_sig_iddigest over ordered static samplers.source_record_hashseparate, resolving demanded compute records (FSSMandFSPX/ACCC) in a single pass over the shader input.recomp::pso::console_to_dxil_in, validates ABI version, header/CLI translation options, split-chain eligibility, final whole DXIL hash/length, ordered static samplers andchain_root_sig_id,effective_flags,node_mask == 0, and runtimedriver_cache::name_for(..., true)key; rejects disk-key collisions across distinct validated(chain_rs_id, node_mask, effective_flags, whole_dxil)targets asAmbiguousDiskKeyand collapses identical whole build targets sharing adisk_cache_nameto one first-demand entry so parallel workers never race on one.chain.psofile..chain.psoentries in first-demand order viadispatch_chain_root_signatureand recordedeffective_flags/node_maskunderXCL_PIPELINE_THREADSandXCL_PIPELINE_MAX_KB, reporting distinct native build/persistence outcomes (created_with_supplied_blob,created_fresh,rejected_and_cold_retried,persisted,blob_unavailable,write_failed,cache_disabled,capped,refused) and returning exit code1whenever any validation issue, cap, refusal, or unpersisted entry leaves replay incomplete.--replay-cutoffexit2), goldenchain_root_sig_iddigests, strict JSONL parser rejection, cutoff/dedup/multi-identity planning, validation and disk-key collision rejection, and incomplete-exit accounting when persistence is capped or disabled.crates/xcl/src/shaders.rs:mod chain_whole_replay;, adds--replay-chain-whole <path>and--replay-cutoff <u64>(rejecting orphan--replay-cutoffwith exit code2), tracks explicit--windows, allows single-file inputs for--replay-chain-whole, and dispatches tochain_whole_replay::run(...)without modifyingPipelinesorprecompile.crates/xcl/src/hle/d3d12x/real.rs:driver_cache::stats() -> (u64, u64, u64)and#[doc(hidden)] pub fn driver_cache_stats() -> (u64, u64, u64)returning(hits, stale_rejections, stored).crates/xcl/tests/gpu_compute_e2e.rs:selective_chain_whole_replay_reuses_blob_in_fresh_process: verifies disabled disk cache returns exit1and writes nothing, cold selective replay writes exactly 1.chain.psoblob for the demanded shader only (not an unselected sibling, split pieces, or.pso), warm replay hits the supplied blob, and 3 fresh Windows child processes prove exact reuse (hits == 1, stale == 0) plus matching 32-lane GPU output on hookedExecuteIndirectand direct fallback (Dispatchwithallocator == 0) while the unselected sibling records(hits == 0, stale == 0).Tested
rustc 1.100.0, debug + releasecargo clippy --all-targets -- -A clippy::approx_constant: 0 new warnings or errors across all 4 modified files (note: plaincargo clippy --all-targetsexits 101 due to 3 pre-existingclippy::approx_constanterrors in untouchedlower_valu.rs,lower_wide.rs, andrecomp/lower.rs)XCL_WARP=1 cargo test -p xcl --lib -- shaders::chain_whole_replay:: --nocapture(debug WARP): 6 passed, 0 failed, 0 ignoredcargo test --release -p xcl --lib -- shaders:: --test-threads=4 --nocapture: 16 passed, 0 failed, 0 ignoredcargo test --release -p xcl --test gpu_compute_e2e -- --test-threads=1 --nocapture: 8 passed, 0 failed, 0 ignored (1 runtime skip:heap_window_out_of_memory_falls_back_to_the_switch_formwithoutXCL_HEAP_WINDOWS=1;selective_chain_whole_replay_reuses_blob_in_fresh_processpassed all 3 fresh child processes)cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1442 passed, 0 failed, 47 ignored across 37 workspace test targets (SKIPPED GPU tests/subcases: wave64-only GPU tests on 32-lane RTX 4060, 3 per-lane wave32 driver-refused subcases,heap_window_out_of_memory_falls_back_to_the_switch_formwithoutXCL_HEAP_WINDOWS=1,pso_measurement_compiles_an_exact_synthetic_recordwithout Windows Developer Mode, and 3 debug-layer tests withoutd3d12SDKLayers.dll)Regression run
main:
PR:
Not tested
XCL_HEAP_WINDOWS=1, and D3D12 debug layer (d3d12SDKLayers.dllnot installed on this host)AI use
--replay-chain-wholeparser/validator/prewarmer,driver_cache::stats()reader, unit tests, and fresh-process GPU E2E reuse test@ettehn on GitHub · 2026-11-26 14:32 UTC · original
Independent Windows CLI and GPU check on
fd317b9c3124f01f305be9263d46017a14dedd2b. The only local change was two extra cases in the existing synthetic integration fixture. Both ran before the driver cache existed.--replay-cutoff 0exited 0 withselected 0,dropped_by_cutoff 1, andcomplete: true. It did not create a driver-cache directory.whole_dxil_hashto a different well-formed value exited 1 withwhole_dxil_mismatch,validated 0,created_fresh 0,persisted 0, andcomplete: false. The driver-cache directory still did not exist.Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop 12 GB (621.24), Rust 1.97.1 MSVC debug, DXC 1.8.2502.11,
XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64.Integration 1 passed and unit tests 6 passed, no failures, ignored tests, or reported skips. The run used synthetic shaders. It did not cover a retail capture, heap-window mode, or the full workspace suite.
OpenAI Codex assisted with the two extra cases and verification.
@Aniseto on GitHub · 2026-11-26 14:49 UTC · original
Ran the selective chain-whole replay tests at
fd317b9:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All six parser/validator/collision unit tests pass, and the fresh-process GPU test also passes here: one
.chain.psoblob reused by three child processes with matching 32-lane GPU output on the RTX 5070 Ti.What this adds: the author tested an RTX 4060 8 GB (Ada). This is a Blackwell 16 GB host with the same DXC version; the thread has no report from another machine.
Not tested: a retail capture sidecar, a paired 60 s smoke run, the full workspace suite, AMD and Intel GPUs, wave64 hosts,
XCL_HEAP_WINDOWS=1, D3D12 debug layer, Wine, release profile, title data.AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@SzczepanGrela on GitHub · 2026-11-26 15:21 UTC · original
RX 9070 / Wine: offline replay and persistence checks pass; the fresh-runtime reuse fixture remains incomplete here.
Tested
fd317b9c3124f01f305be9263d46017a14dedd2bagainst mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.XCL_NETWORK=0, enabled private caches. Replay usesXCL_DIRECT_DXIL=1, split instruction limit 12,XCL_SPLIT_WAVE64=1,XCL_UMA_WINDOWS=4, and the upstream fixture's two synthetic compute records.Verified offline results
shaders::chain_whole_replay::: 6 passed / 0 failed / 0 ignored, both one and four test threads. Existingshaders::pipeline_cap_tests::: 3/0/0 on both main and head, at both thread counts; its GPU dispatch control reads 42.Separate CLI processes using the captured synthetic demand give:
whole_dxil_mismatch, validated 0, no native build/blobThe selected whole DXIL is 2692 bytes. Cold replay creates only
6bf9827cb92b8a85-a84-0.chain.pso, 112 bytes. Filename and SHA-256 match across cold/warm; corrupt-cache repair restores a valid 112-byte blob. Main rejects the new replay option with exit 2, as expected.Fresh-runtime limitation
selective_chain_whole_replay_reuses_blob_in_fresh_processreports 0 passed / 1 failed / 0 ignored in both the instrumented fixture and a separately built, unmodified exact-head fixture. In the logged run, disabled/cold/warm replay completes with the expected outcomes, then the firstindirectchild exits-1073741819(0xc0000005) before the cache-stat/readback checkpoint. Its actual device matches RX 9070 PCI1002:7550, LUID00000000:000003ef. The unmodified fixture also fails its firstindirectchild; it does not print that child's exit code.Separate baseline context: unchanged
console_wave64_compute_through_the_pso_hook_dispatch_and_read_backfails on both main and head withdispatch: Invalid parameter (0x80070057). The cause of the new child's termination is unestablished. Itsdirect_fallbackandunselected_siblingcases are not reached, so runtime reuse and GPU output for this fixture remain unverified.The instrumented tree changes only test observability: child output/counters/readbacks, device-LUID assertion, and preservation of caller-selected private artifacts. Original assertions and production sources remain unchanged. All source bytes were reconstructed and checked; the separate exact-head control has no overlays. Raw summaries, CLI counters, stored input/capture/blob bytes and executable hashes were independently verified. No runtime capability skips or ignored tests in these selections.
Build:
cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --test gpu_compute_e2e --no-run. Exact integration filter as above,--nocapture --test-threads=1. CLI:xcl.exe shaders <synthetic-input> --replay-chain-whole <capture.jsonl> --windows 4 --split 1, with--replay-cutoff 0for the cutoff case.Not tested
Successful runtime reuse/readback for the new fixture on this host, native Wave64 guest execution, heap-window mode, native static-sampler cases, retail captures or title workload,
scripts/smoke.ps1, full suite, native Windows, other GPUs, performance or FPS.AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the complete diff, added test observability, ran the tests and exact-head control, independently verified the bounded results, and drafted this report. Publication authorized by the account owner.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.