gw#587: prove-produces-the-mint — self-mint captures the executor's real warmup; publish only after the proof passes#343
Merged
Conversation
…eal warmup, publishes only after the proof passes The 0.39.2 self-mint minted via compile_cache.mint_artifact -> _warm_call (the producer single-stage synthetic warm loop) BEFORE the warmup proof ran. Live forensics: the resulting cell differed from the known-good forge cell in 20/490 FX graph keys (xnumel=14080 vs 8160 — broadcast vs per-token modulation, the gw#586 defect class resurfacing inside self-mint); the proof correctly failed closed (cache_hits=0) and the worker refused to serve. Fix inverts mint-then-prove into prove-produces-the-mint: - compile_cache.begin_fleet_mint: arm cold (guarded) into a fresh capture dir, NO synthetic warm call. The executor's real warmup — the endpoint's own serving code — performs the only compile the mint sees. - compile_cache.finish_fleet_mint: pack the capture a PASSED proof populated; called only from the proof loop. - fleet_cells: enable_compiled returns a PendingSelfMint (key/ref known from static axes for the th#910 self-attested fence); finalize_self_mint packs + advertises the real digest + publishes ONLY after the proof certifies a successful compiled call; abandon_self_mint discards uncertified captures. Same-key sibling pipes share one capture (union family cell); publish-before-proof window closed. - executor: proof loop treats a pending mint's successful compiled call (calls>0) as the proof — there is nothing on disk to HIT against; delivered cells keep requiring real cache hits. Unproven pending mints are abandoned, mandatory lanes fail closed exactly as before. Synthesized warmups accept the cold-mint signature via cold_proof_ids. Unchanged: cell_key computation, cell_selection_bug receipt, delivered- cell (store-served) proof semantics, PR #338 STORE_SERVED_BOOT_COMPILED alarm (delivered-only), cozy-local local_cells (local-store mint). Revert-turns-red both directions over the real Executor rig: (a) a passing self-mint boot publishes exactly the proven capture bytes (digest of published tar == advertised digest; publish strictly after warmup) — verified red against the reverted proof loop; (b) an unproven capture fails closed, advertises nothing, publishes nothing, and is discarded.
PaulFidika
marked this pull request as ready for review
July 20, 2026 07:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect (live-found, byte-level forensics)
The 0.39.2 self-mint minted via
compile_cache.mint_artifact->_warm_call— the old PRODUCER single-stage synthetic warm loop — BEFORE the warmup proof ran. The resulting cell differed from the known-good forge cell in 20/490 FX graph keys (same kernels, xnumel=14080 vs 8160: broadcast vs per-token modulation — the gw#586 defect class resurfacing INSIDE the self-mint). The new warmup proof correctly caught it and failed closed (compile_cell_failed ... cache_hits=0, cache_misses=8); the worker refused to serve. Evidence:~/cozy/samples/selfmint-proof/{selfmint,forge}-meta.json.Fix: invert mint-then-prove into prove-produces-the-mint
The published artifact is now BYTE-DERIVED from the same execution the proof observed. There is no second code path that re-creates serving's execution — the parity treadmill (gw#586, gw#577, and this defect) is structurally closed on the fleet path.
compile_cache.begin_fleet_mint(pipe, cfg, capture): latch inductor at a fresh capture dir + arm the declared targets cold (GUARDED). No synthetic warm call. The executor's real warmup — the endpoint's own serving code — performs the only compile the mint ever sees.compile_cache.finish_fleet_mint(...): pack the capture a PASSED proof populated. Called only from the proof loop.fleet_cells.enable_compiledMISS returns aPendingSelfMint: cell key/ref computed from static axes (cell_key.compute, the one brain — unchanged) so the th#910 self-attested fence ref is advertisable at arm time; digest empty until finalize.calls>0) IS its proof — a fresh capture has nothing on disk to HIT against; requiring a hit would fail every honest self-mint by construction. Delivered (store-served) cells keep requiring real cache hits — their proof semantics are untouched. Proven pending mints are finalized (pack -> advertise real blake3 digest -> background publish); everything else is abandoned (never packed, never published) and mandatory lanes fail closed exactly as today. This also closes the publish-before-proof window.TORCHINDUCTOR_CACHE_DIRper process).warmup()) accept the cold-mint signature viacold_proof_ids.Invariants held
CompiledLaneUnavailableexactly as today.cell_keycomputation untouched;cell_selection_bugreceipt untouched; PR gw#587: runtime assertion — store-served boot must pay ~0 compile time #338'sSTORE_SERVED_BOOT_COMPILEDalarm stays delivered-only.local_cells) untouched — local-store mint, never the fleet publish route.Tests (outcome-level, real Executor rig)
Revert-turns-red both directions:
test_pending_self_mint_boot_packs_and_publishes_only_the_proven_capture— publish strictly AFTER warmup; published tar bytes contain the graphs the warmup compiled; advertised digest == blake3 of the published bytes. Verified RED against a reverted proof loop, GREEN restored.test_pending_self_mint_unproven_fails_closed_and_never_publishes— fail closed, zero publish (pytest.fail sentinel), capture discarded.Plus
test_fleet_cells.pyrewritten to the two-phase flow (pending-without-pack, finalize-packs-proven-capture w/ published-bytes digest check, abandon-never-publishes, same-key sibling join, publish-refusal non-fatal). 90 targeted tests green; mypy 125 files clean; ruff clean.Part of the gw#587 self-mint wave (th#910). Ships as gen-worker 0.39.3.
🤖 Generated with Claude Code