Repository navigation
Conversation
…reuse test Follows up on xcl-dev#2741 Part 1 (first-demand capture sidecar) with Steps 2–4: offline validation, selective native `.chain.pso` whole-form prewarming, and fresh-process GPU reuse proof. Regular `--precompile`, `--pipelines`, `--used-only`, chain pieces, and runtime fallback behavior are unchanged. - Add `crates/xcl/src/shaders/chain_whole_replay.rs` and CLI flags `--replay-chain-whole <path>` + optional `--replay-cutoff <u64>` in `crates/xcl/src/shaders.rs` (rejecting orphan `--replay-cutoff` with exit code 2). - Parse the `schema_version: 1` UTF-8 JSONL capture sidecar (accepting xcl-dev#2786's 12-field `translation_options` header while validating `mem_windows`/`split_wave64` per demand record) in first-demand `seq` order, apply the effective cutoff (`min(cli_cutoff, header.sequence_cutoff)`), deduplicate exact repeated final identities while keeping distinct final identities for the same `source_record_hash` separate, and resolve demanded compute records (`FSSM` and `FSPX`/`ACCC`) in a single pass over the shader input. - Rebuild each selected record through the runtime translation path (`recomp::pso::console_to_dxil_in`) and validate ABI version, header/CLI translation options, split-chain form, final whole DXIL hash/length, ordered static samplers and `chain_root_sig_id`, effective flags, `node_mask == 0`, and runtime `driver_cache::name_for(..., true)` key; reject ambiguous disk-key collisions across distinct validated `(chain_rs_id, node_mask, effective_flags, whole_dxil)` targets and collapse identical targets sharing one `disk_cache_name` so parallel workers never race on one `.chain.pso` path. - Create only validated, collision-free whole-form `.chain.pso` pipelines in first-demand order using `dispatch_chain_root_signature` and recorded `effective_flags`/`node_mask` under `XCL_PIPELINE_THREADS` and `XCL_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 treating any validation issue, cap, refusal, or unpersisted entry as incomplete (exit code 1). - Expose read-only `driver_cache::stats()` / `real::driver_cache_stats()` in `crates/xcl/src/hle/d3d12x/real.rs`. - Add 6 unit tests in `shaders::chain_whole_replay::tests` plus fresh-process GPU E2E test `selective_chain_whole_replay_reuses_blob_in_fresh_process` in `crates/xcl/tests/gpu_compute_e2e.rs` (isolated from ambient translation/cache env vars and wave64-safe) verifying selective `.chain.pso` persistence, exact blob reuse without cold retry (`hits == 1, stale == 0`) on both real hooked `ExecuteIndirect` and direct fallback (`Dispatch` with `allocator == 0`), matching 32-lane GPU output, and zero cache hits for an unselected sibling. Part of xcl-dev#2741 Part of xcl-dev#2088 Part of xcl-dev#2508 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Independent Windows CLI and GPU check on
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, 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. |
|
Ran the selective chain-whole replay tests at 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 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, 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. |
|
RX 9070 / Wine: offline replay and persistence checks pass; the fresh-runtime reuse fixture remains incomplete here. Tested
Verified offline results
Separate CLI processes using the captured synthetic demand give:
The selected whole DXIL is 2692 bytes. Cold replay creates only Fresh-runtime limitation
Separate baseline context: unchanged 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: 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, 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. |
|
Independent Windows/Ampere check of #2819 head
Not tested: a sidecar emitted by #2786 and fed into this replay CLI, retail capture/replay or smoke, AMD/Intel GPUs, native wave64, or release. The GPU test constructs its synthetic sidecar itself, so this result does not establish the capture-to-replay handoff or a world-load speedup. AI use: Codex (GPT-6.2 Sol) selected the independent check, inspected the fixture, ran and checked the tests, and drafted this report. |
|
Synthetic capture-to-replay handoff check for #2786 head I switched the existing On RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, debug:
The diff is a candidate integration regression for after both PRs are present. The original hand-written Local test-only diffdiff --git a/crates/xcl/tests/gpu_compute_e2e.rs b/crates/xcl/tests/gpu_compute_e2e.rs
index d6ac50a9..9c48cbf7 100644
--- a/crates/xcl/tests/gpu_compute_e2e.rs
+++ b/crates/xcl/tests/gpu_compute_e2e.rs
@@ -958,8 +958,8 @@ fn selective_chain_whole_replay_reuses_blob_in_fresh_process() {
}
let stats_after = real::driver_cache_stats();
let (dhits, dstale) = (stats_after.0 - stats_before.0, stats_after.1 - stats_before.1);
- if is_sibling {
- assert_eq!((dhits, dstale), (0, 0), "unselected sibling must not hit prewarmed cache (case={case})");
+ if is_sibling || case == "capture_indirect" {
+ assert_eq!((dhits, dstale), (0, 0), "no prewarmed cache hit expected (case={case})");
} else {
assert_eq!(
(dhits, dstale),
@@ -988,6 +988,17 @@ fn selective_chain_whole_replay_reuses_blob_in_fresh_process() {
assert_eq!(got, expected, "case={case} lane={lane} mismatch");
}
}
+ if case == "capture_indirect" {
+ let out_path = PathBuf::from(std::env::var_os("XCL_TEST_CAPTURE_OUT").expect("capture out path"));
+ let deadline = std::time::Instant::now() + std::time::Duration::from_secs(5);
+ loop {
+ if let Ok(lines) = fs::read_to_string(&out_path) {
+ if lines.lines().count() == 2 { break; }
+ }
+ assert!(std::time::Instant::now() < deadline, "capture writer did not publish header and demand");
+ std::thread::sleep(std::time::Duration::from_millis(10));
+ }
+ }
return;
}
@@ -1020,6 +1031,8 @@ fn selective_chain_whole_replay_reuses_blob_in_fresh_process() {
"XCL_PIPELINE_MAX_KB",
"XCL_PIPELINE_THREADS",
"XCL_SAFE_BARRIER",
+ "XCL_CAPTURE_CHAIN_WHOLE",
+ "XCL_CAPTURE_CHAIN_WHOLE_MAX",
] {
cmd.env_remove(var);
}
@@ -1030,16 +1043,25 @@ fn selective_chain_whole_replay_reuses_blob_in_fresh_process() {
.env("XCL_SPLIT_WAVE64", "1");
};
- // 1. Generate a schema_version=1 capture sidecar demanding ONLY `selected.bin`.
+ // 1. Capture a real first-demand sidecar through the hooked indirect runtime path.
let mut seed_cmd = Command::new(std::env::current_exe().unwrap());
seed_cmd
.args(["--exact", "selective_chain_whole_replay_reuses_blob_in_fresh_process", "--nocapture"])
- .env("XCL_TEST_CHAIN_REPLAY_CASE", "seed_capture")
+ .env("XCL_TEST_CHAIN_REPLAY_CASE", "capture_indirect")
.env("XCL_TEST_CAPTURE_OUT", &capture)
- .env("XCL_PSO_DISK_CACHE", "1");
+ .env("XCL_ASYNC_PSO", "0")
+ .env("XCL_PSO_DISK_CACHE", "0");
isolate(&mut seed_cmd);
+ seed_cmd.env("XCL_CAPTURE_CHAIN_WHOLE", &capture)
+ .env("XCL_CAPTURE_CHAIN_WHOLE_MAX", "64");
let seed = seed_cmd.output().unwrap();
assert!(seed.status.success(), "{}\n{}", String::from_utf8_lossy(&seed.stdout), String::from_utf8_lossy(&seed.stderr));
+ let captured = fs::read_to_string(&capture).unwrap();
+ let rows: Vec<serde_json::Value> = captured.lines().map(|line| serde_json::from_str(line).unwrap()).collect();
+ assert_eq!(rows.len(), 2, "expected one header and one first demand");
+ assert_eq!(rows[0]["kind"], "header");
+ assert_eq!(rows[1]["kind"], "demand");
+ assert_eq!(rows[1]["reason"], "indirect");
// 2. Run selective offline replay into isolated cache: only selected.bin's whole `.chain.pso` is persisted.
let run_replay = |disk_cache: &str| {
|
|
Correction to my exact-head #2819 report and #2786 + #2819 integration report. The mesh-cache failure in both runs depended on the default DXIL cache location in this sandbox. That location is outside the writable worktree; the pass-through mesh compile can succeed without persisting its DXIL, then its With
These counts supersede the earlier one-failure counts. The combined result remains an uncommitted overlay, not a clean PR head; retail capture, world-load timing, paired smoke, AMD/Intel and native wave64 remain untested. AI use: Codex (GPT-6.2 Sol) traced the cache path, reran and checked the suites, and drafted this correction. |
Implements 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 D3D12.X: add opt-in first-demand capture sidecar for Chain::whole fallbacks #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