Repository navigation
Shaders: share verified compute blobs across preparation worker counts - #3086
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I checked the checkpoint failure path at head
After the first failed checkpoint, the dirty count remains at or above the threshold, so every subsequent record serializes and retries while taking the locks. When the writer was restored, an explicit final save succeeded and all keys, including the last, were present on reopen in both arms. This is failure-path amplification, not observed title timing or evidence of data loss in the successful final-save control. A separate next-attempt threshold or backoff could bound retries while keeping unsaved entries dirty and preserving the final save; any change needs to retain recovery semantics. The final replacement failure was injected in the probe, not produced by a real filesystem failure. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the probe; Codex reviewed and prepared this report. |
|
Windows run (listed under Not tested): the whole suite passes. The new test passes 40 of 40, and it catches each part of the change when that part is removed. Tested:
Scratch mutations, 10 runs of each test (
So on Windows the lock holds between two handles in one process, and the replace under it works. Not tested: a launch with and without the change (no title here), a release build. AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch mutations and wrote this report. |
Keep the validated blobs under the native preparation identity. Import previous worker slices, merge concurrent updates under a file lock, and checkpoint successful validations during a long preparation. A checkpoint that fails is tried again after 64 more entries, not on every one: a receipt that cannot be replaced made each later record take the lock and write the whole list again (961 attempts for 1,024 entries in a probe on xcl-dev#3086). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f147360 to
fdbac84
Compare
|
Confirmed and fixed in New test
AI use: Claude Code (Claude Opus 5.5) wrote the fix and the test, ran them and wrote this reply. |
…64 more entries # Conflicts: # crates/xcl/src/shaders/warm_blobs.rs
|
I retested the checkpoint retry fix with a real Windows replacement failure, comparing original Each run seeded one key, then held the existing receipt open with read/write sharing but without delete sharing while recording 1,024 new keys. Under that lock:
Healthy controls were 16 attempts / 209,408 bytes on both revisions. The locked on-disk receipt remained at its seeded key; after closing the handle and explicitly saving, all 1,025 exact keys were present on reopen in both cases. This verifies bounded checkpoint retries and eventual explicit-save recovery under the tested sharing violation. It does not measure retail startup time or other filesystem failure modes. AI use: OpenAI Codex with GPT-6.2 Astra ran the tests; Codex reviewed and prepared this report. |
|
Independent Windows check of #3086 head Tested
Regression run The pair is a runtime regression check, not a measurement of this PR's startup saving: AI use: Codex (GPT-6.2 Sol) ran the builds, suite, parent control and paired smoke, checked the outputs, and drafted this report. |
|
Tested — post-merge verification of the final PR head I reran the pinned CPU test executable for
4 passed, 0 failed, 0 ignored, 0 runtime skips. All four native processes and the harness exited 0. Not tested Simultaneous lock contention, forced write failure, real driver identities, GPU execution, retail launch, performance, and the full workspace suite. AI use T3 Code through the Codex harness ( |
main gained 345 commits since 753e8b1, most of them bmjask's stack (xcl-dev#2959), plus xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086 from this branch. Conflicts, per PR: - xcl-dev#2404 + xcl-dev#2633 (split chained ExecuteIndirect): main's xcl-dev#2959 took both over (ed98461, a05fbc4, 8626d5b: IndirectBuild/IndirectChain on a CBV root, one-command slicer, separate cache namespace). Main's side kept in dispatch_chain.rs, pso.rs (slicer, command signature, chain root), bind.rs (ExecuteIndirect path), device_x.rs (signature traits), pso_async.rs (no background whole build, so no build_waited_on), real.rs (ComputeBuild, driver_cache names) and shaders.rs (blob names). Dropped with them: slab_count, record_slicer, abi_signature_id names, the direct root-CBV constant blocks, list_x::predicated, the split.rs/runner.rs ExecuteIndirect test and the list_x chain-scratch test. Not in main: xcl-dev#2404 ran the pieces before any whole form was built; main runs the whole form (built on the title's thread) until the indirect set is ready. - xcl-dev#2707 (allocator reclaim): main has it (31930d8, 057f463, 8e7b566). alloc_pool.rs is main's, with xcl-dev#867's changes on top; bind.rs takes main's native_backing; xcl-dev#2707's tests and bind::push_uma_for_test go. - xcl-dev#867 + xcl-dev#2477 (Wine vtables and fences), adapted to main's new code: real.rs keeps the in-place patching, UnadoptGuard and FenceProxy beside main's native_queue_* helpers; guards in cl_reset, bind_pipeline_exact, clear_pipeline_exact, reset_pc_allocator, the title ExecuteCommandLists closure and native_queue_execute; Signal/Wait unwrap the title's fence (also in native_queue_signal/wait); list_x guards in reset_reserved_segment and KickoffX's submit closures; create_raw_fence for main's new internal fences in alloc_pool.rs (SubmissionGate), title_textures.rs, present.rs, vram.rs, sparse.rs, cpu_writes.rs; tests as xcl-dev#2477 had them; runner.rs is main's plus submit_list. - xcl-dev#1803 (heap addresses): kept, carried into main's PreparedSplit and PreparedAbiState (prepared_abi_io takes the heaps). - xcl-dev#1368 (NodeMask 0): kept in compute_container, before main's per-node blob names, so names and pipeline use node 0. - xcl-dev#1860, xcl-dev#2082 (cfg.rs, module/opt.rs): cfg.rs is 1567f72's version (xcl-dev#1860 on main's Succs); opt.rs is that plus xcl-dev#2082's arm and test. - xcl-dev#2229 (rodata): kept through main's kernel.rs entry points; translate_entry_rodata loses wave32_only as main dropped per-GPU tables (3cde0cc); pso.rs and coverage.rs call it with main's options (no_remap, split for graphics); recomp Options keeps rodata and no_remap. - xcl-dev#1975: kept in emit.rs and lower_valu.rs; its mesh barrier guard and its test dropped, main's wider guard (2ca9127) covers it; the now-unused lower::has_non_uniform_barrier goes. - xcl-dev#2070 (64 MB stacks): pso_async::WORKER_STACK on main's worker, helper and preload threads; shaders.rs's piece threads on worker_thread. - xcl-dev#2551 (whole forms prebuilt): split_whole_roots(false) is DirectChain, so the precompile builds every split program's whole form; main built it only for programs an earlier run used through ExecuteIndirect. - xcl-dev#688 (dxc.rs imports), xcl-dev#2762 (host.rs log line), xcl-dev#3090 (list_x tests), arch/window-title-commit (present.rs with_commit on main's compiling_text), README.md: both sides. - list_x.rs: main dropped title_textures::list_reset; main's side. - sparse.rs, vram.rs: main's quarantine_tiles_for and per-device retire state, with create_raw_fence. - xcl-dev#3090, xcl-dev#3092 tests: runner::device and Uma::block_len added from nvidia-dev (5 and 12 lines) so the lib tests compile. - xcl-dev#751: its commit is already in main (b84e037, via xcl-dev#2844); it leaves the README table with xcl-dev#2404, xcl-dev#2633, xcl-dev#2707, xcl-dev#2872, xcl-dev#3085 and xcl-dev#3086. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings nvidia-dev's low-VRAM memory model, pipeline preparation and NVIDIA fixes into main, carried on main's submission rework (#2959-#2965, #3086, #3149) and pipeline libraries (#3100). Each of the 33 files that conflicted was 3-way merged from 4577f09 and resolved per hunk by job. Where both sides did one job two ways, one implementation stays and the other's callers use it. RESOLUTIONS.md lists every dropped mechanism with its PR, the replacement and the reason. Kept from main whole: - submission plan, receipts and native queue slots; - retained pipeline generations; - DriverBlobs exact-generation blob cache; - preparation corpus and pipeline libraries; - shared-view epochs and the queue-lifetime registry. Brought in from nvidia-dev: - 16 windows, mirror tiles, lazy sparse, pack pools, texture level pages and the mixed UMA driver window; - the used-only startup preparation and preparation worker processes; - driver-blob keep rules: small-program disk keep, compute threshold, per-adapter file names; - dispatch folding and the split-wave64 LDS order; - late_release holding; - the watch, submit_cost, capture and look_stats diagnostics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launch pass keeps a receipt of the compute blobs it validated on this adapter and driver (
warm_blobs::Verified), so a later launch takes them without validating them again. The receipt's file name hashedXCL_PRECOMPILE_SLICE, the worker'si/count, into its key. A launch with another worker count (another machine, a differentXCL_PREPARE_WORKERS, or the count #2705's fix changes) found none of its receipts and validated every blob again.This keeps one receipt per native identity (
verified-compute-v2-<native>.bin), imports the v1 files of every slice of the same identity once, merges concurrent writers under a lock file before it replaces the receipt, and saves every 64 new entries so an interrupted pass keeps what it validated (a failed save is tried again after 64 more).What is in it
crates/xcl/src/shaders/warm_blobs.rs: the v2 receipt, the v1 import, the locked merge and the checkpoints; a test with two workers opened before either writes, a v1 slice file to import, another device's identity, and the checkpoint a dropped worker leaves.README.md: one line.Tested
x86_64-pc-windows-gnu:cargo test -p xcl --lib warm_blobs -- --test-threads=4atfdbac840: 3 passed, 0 failed, 0 ignored (1408 filtered out), witha_failed_checkpoint_is_tried_again_after_64_more_entriesRegression run
scripts/smoke.ps1needs Windows (see Not tested).Not tested
scripts/smoke.ps1onmainand on this head; a launch with and without it, to count the validations it saves.AI use