Repository navigation
Conversation
|
Independent review and focused Windows check of head
Small candidate diff shape- capture_meta: ChainWholeMeta,
+ capture_meta: Option<ChainWholeMeta>,
...
- let capture_meta = ChainWholeMeta::new(record, whole, samplers, flags, node, mem_windows, split_wave64);
+ let capture_meta = chain_whole_capture::enabled()
+ .then(|| ChainWholeMeta::new(record, whole, samplers, flags, node, mem_windows, split_wave64));
...
- on_demand(&self.builder.device, &self.capture_meta, reason, already_ready);
+ if let Some(meta) = &self.capture_meta {
+ on_demand(&self.builder.device, meta, reason, already_ready);
+ }
Tested: Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC, DXC 1.8.2502.11, signed D3D12 Agility 1.620.2. AI use: Codex (GPT-6.2 Sol) inspected the exact-head source, ran the focused tests, and drafted this review. I verified the two points against the code before posting. |
…lbacks Split compute shaders normally execute via their dispatch-chain pieces, falling back to `Chain::whole` (and the `.chain.pso` driver-cache namespace) on compute `ExecuteIndirect` or direct dispatches without usable scratch. Used-pipeline history cannot distinguish which shaders triggered that fallback. - Add `crates/xcl/src/hle/d3d12x/real/chain_whole_capture.rs`, gated strictly behind opt-in `XCL_CAPTURE_CHAIN_WHOLE=<path>` (plus optional `XCL_CAPTURE_CHAIN_WHOLE_MAX=<u64>` sequence cutoff). When unset or whitespace-empty, `dispatch_chain::build` skips `ChainWholeMeta::new` (`capture_meta: Option<ChainWholeMeta>`) and capture performs zero extra hashing, cache-key formatting, sampler allocation, I/O, thread spawning, DXGI queries, or locking. - Record first demand to a versioned UTF-8 JSONL sidecar (`schema_version: 1`) on a dedicated background writer thread (`xcl-chain-capture`), strictly outside `Chain::build_whole` and storing replay metadata only: a header line (build/translator source IDs, chain RS ABI version, cutoff, best-effort DXGI adapter/driver version, Agility runtime status/version, DXC version/commit metadata without local paths, and effective 12-field compute translation options including `dxil_no_opt`, `x64_all_masks`, `wave64_spin`, and `recomp_structured`) followed by deduplicated demand lines (`seq`, `elapsed_ms`, `timestamp_unix_ms`, `present_count`, `reason`, `already_ready`, `source_record_hash`, `whole_dxil_hash`, `whole_dxil_len`, `effective_flags`, `node_mask`, `chain_rs_abi_version`, `chain_rs_id`, ordered `static_samplers`, `disk_cache_name`, effective `mem_windows`, and `split_wave64`). - Pass explicit `ChainWholeReason` (`Indirect`, `Bundle`, `MissingRecordingAllocator`, `ScratchUnavailable`) from `bind::execute_indirect` and `dispatch_chain::dispatch` (checking `Bundle` before missing allocator) to `Chain::whole` before readiness check or `build_whole` lock, so first demand is captured even when the whole PSO is already ready; flush on shutdown in `real::end_title`. - Add 12 deterministic unit tests across `chain_whole_capture::tests` (9) and `dispatch_chain::tests` (3) covering off-by-default zero I/O and skipped metadata construction, all four reasons in monotonic sequence order, deduplication by final identity while separating distinct final identities for one source hash, `already_ready` capture, sequence cutoffs including `0`, static-sampler order/comparison hashing, unwritable-path degradation, 12-field `TranslationOptionsMeta` serialization and `XCL_DXIL_NO_OPT` normalization, direct-fallback classification precedence, capturing before `build_whole` is acquired, and skipping `on_demand` when disabled. Part of xcl-dev#2741 Part of xcl-dev#2088 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Tested Setup
Results at
Repeat: the two runs ( Results at Notes from the first run, both answered above by @Decodere:
Not tested: AI use: Claude Code (Claude Opus 5.5) read the diff, ran the builds, the tests and both runs on my machine, matched the sidecars against the logs, and drafted this. Checked by me before posting. |
7587c01 to
3b6609f
Compare
|
Updated in @thehollowedone — Thanks for the review; both points are addressed in
Re-verified on @afpruivo — Huge thanks for testing live demand capture on RTX 3090 (
|
|
Ran the opt-in chain-whole capture unit tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 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 nine pass here, including first-demand ordering, deduplication, the sequence cutoff and the unwritable-path case. These are CPU-side unit tests: they do not exercise the real adapter and write no sidecar to a user path. The thread has an RTX 3090 capture report (afpruivo) and an independent Windows check (thehollowedone); this adds a Blackwell desktop part on driver 32.0.16.2124 with DXC 1.9.2609.5, the toolchain used in my earlier reports in this series. Not tested: a real 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. |
Add an opt-in first-demand capture sidecar for
dispatch_chain::Chain::wholefallbacks (Step 1 of#2741). WhenXCL_CAPTURE_CHAIN_WHOLEis unset or whitespace-empty,dispatch_chain::buildskipsChainWholeMeta::new(capture_meta: Option<ChainWholeMeta>) and capture performs zero extra hashing, cache-key formatting, sampler allocation, I/O, thread spawning, DXGI queries, or locking; when set, each distinct final chain-ABI whole PSO demand is recorded in monotonic first-demand sequence order to a versioned UTF-8 JSONL sidecar strictly outsideChain::build_whole.Part of #2741
Part of #2088
What is in it
crates/xcl/src/hle/d3d12x/real/chain_whole_capture.rs: opt-in capture gated byXCL_CAPTURE_CHAIN_WHOLE=<path>and optionalXCL_CAPTURE_CHAIN_WHOLE_MAX=<u64>sequence cutoff (0= header only; disabled undercfg!(test)so tests never touch process env or user paths). Exposesenabled()(cachedOnceLockcheck) andbuild_meta_if(enabled, make)so disabled split-chain builds never constructChainWholeMeta. Serializes replay metadata only (no shader bytes or local paths) as versioned JSONL (schema_version: 1) on a dedicated background writer thread (xcl-chain-capture):kind: "header"):xcl_version,translator_source_id,direct_dxil_source_id,direct_dxil_translator_version,per_lane_source_id,chain_rs_abi_version(1),sequence_cutoff,captured_at_unix_ms, best-effort DXGIadapter(description, PCI IDs,is_software, UMDdriver_version),agility_runtime(status,version),dxc(dxcompiler/dxilversion/commit metadata without local directory paths), and effective 12-field computetranslation_options(direct_dxil,direct_compact,direct_compact_nest,per_lane,safe_barrier,heap_windows,split_wave64_forced,dispatch_piece_limit, plusdxil_no_optcanonical sorted subset of["cse","dce","merge","phi"]fromXCL_DXIL_NO_OPT,x64_all_masksfromXCL_X64_ALL_MASKS,wave64_spinfromXCL_WAVE64_SPIN, andrecomp_structuredfromXCL_RECOMP_NO_STRUCTURED, with backward-compatible serde defaults).kind: "demand"): 1-based monotonicseq,elapsed_ms,timestamp_unix_ms,present_count,reason,already_ready,source_record_hash,whole_dxil_hash,whole_dxil_len,effective_flags,node_mask,chain_rs_abi_version,chain_rs_id(FNV-1a 64 over ABI version and ordered static samplers), orderedstatic_samplers,disk_cache_name(driver_cache::name_for(..., true)), effectivemem_windows, andsplit_wave64.source_record_hash,whole_dxil_hash,whole_dxil_len,effective_flags,node_mask,chain_rs_abi_version,chain_rs_id) under a leaf mutex with non-blocking channel enqueue so line order matchesseqwithout disk I/O under lock; degrades silently with one warning on I/O errors.crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs: storecapture_meta: Option<ChainWholeMeta>onChain, lazily constructed indispatch_chain::buildonly whenchain_whole_capture::enabled()is true; whenSome, record demand inChain::wholebefore checkingself.whole.get()or acquiringself.build_whole(capturing even when already ready); classify direct dispatch fallback reasons viaclassify_direct_fallback(BundlebeforeMissingRecordingAllocatorbeforeScratchUnavailable).crates/xcl/src/hle/d3d12x/bind.rs: passChainWholeReason::Indirectfromexecute_indirecttodispatch_chain::whole.crates/xcl/src/hle/d3d12x/real.rs: declarechain_whole_capture, pass effectivepso::mem_windows()andwave32_only(this)intodispatch_chain::build, and flush pending capture records inend_titlebefore suspending threads.chain_whole_capture::testsanddispatch_chain::tests):off_by_default_creates_no_file_and_no_io,captures_all_four_reasons_in_monotonic_sequence_order,deduplicates_first_demand_by_final_identity_and_keeps_distinct_identities_separate,records_demand_even_when_whole_pso_is_already_ready,sequence_cutoff_caps_distinct_demands_including_zero,chain_root_signature_identity_tracks_sampler_order_and_comparison,unwritable_target_path_fails_gracefully_without_panicking,disabled_capture_skips_metadata_construction_for_unset_and_empty_paths,translation_options_record_dxil_no_opt_and_extra_compute_switches,classify_direct_fallback_distinguishes_bundle_missing_allocator_and_scratch_unavailable,whole_capture_runs_outside_build_whole_lock, anddisabled_capture_path_skips_metadata_construction_and_on_demand_callback.Tested
rustc 1.100.0, DXC1.9.2609.5, debug (WARP) and release (RTX 4060).hle::d3d12x::real::chain_whole_capture::+hle::d3d12x::real::dispatch_chain::tests::, 12 new + 2 existing,--test-threads=1):XCL_ADAPTER=warp):14 passed, 0 failed, 0 ignored(0skipped;chain_whole_capture9/0/0in0.01 s,dispatch_chain5/0/0in0.52 s).14 passed, 0 failed, 0 ignored(0skipped;chain_whole_capture9/0/0in0.01 s,dispatch_chain5/0/0in0.63 s).hle::d3d12x::real::+hle::d3d12x::bind::,--test-threads=4):80 passed, 0 failed, 0 ignored(0skipped;real72in0.78 s,bind8in0.31 s).cargo clippy --workspace --all-targets:0warnings and0errors inchain_whole_capture.rs, and0new warnings or errors across all added/changed lines indispatch_chain.rs,bind.rs, andreal.rs(3 pre-existingmainclippy::approx_constanterrors remain in untouchedlower_valu.rs,lower_wide.rs, andrecomp/lower.rs).cargo test --release --workspace --no-fail-fast -- --test-threads=4:1447 passed, 0 failed, 47 ignoredacross 37 targets (xcl --lib:1321 passed, 0 failed, 27 ignoredin15.91 s;29SKIPPEDlines whose optional env vars or sample packs were unset).title: 29640639withXCL_CAPTURE_CHAIN_WHOLE,XCL_CAPTURE_CHAIN_WHOLE_MAX=64, andXCL_DIRECT_DXIL=1:1577frames (PresentX 1577),60 60 60presents/2 s,0device removals,0crashes,13969 MBpeak commit (exit: 0x0);end_titlecleanly flushed a 984-byte UTF-8 LF JSONL sidecar containing theschema_version: 1header with live RTX 4060 adapter/driver (32.0.16.2114), DXC (1.9.2609.5), and all 12 effectivetranslation_optionsfields (direct_dxil: true,dxil_no_opt: [],x64_all_masks: false,wave64_spin: true,recomp_structured: true, plus the original 8 fields;0demand lines because this title split0compute programs during the 60 s run).Regression run
Default-flags quiet 60 s
scripts/smoke.ps1runs ontitle: 29640639(XCL_CAPTURE_CHAIN_WHOLEunset):main:
PR:
Not tested
Chain::wholefallbacks (title: 29640639reported0 programs splitduring the 60 s run; demand emission, deduplication, cutoff, all fourChainWholeReasonvalues, disabled-path gating, 12-fieldtranslation_optionscapture, and off-build_whole-lock ordering are verified via deterministic unit/D3D12 tests).#2741Part 2 / Steps 2-4).agility_runtime.status == "loaded").#[ignore]workspace tests and 29SKIPPEDoptional-env/sample-pack tests.AI use
chain_whole_capturesidecar, disabled-path metadata gating, 12-fieldTranslationOptionsMetacapture,ChainWholeReasonplumbing, and 12 unit tests againstorigin/main(b49be183), ran clippy, debug WARP and release RTX 4060 test suites, and quiet 60 s smokes, and drafted this PR description.