Repository navigation
M1 within-walk resolve memo: floor shared-computation memoization - #6008
Conversation
Documents the root (double-paid full-tree compile: 4× subprocess + 2× in-process resolve_entry_graph), two fix axes (M1 within-walk resolve memo + M2 RunnableCompile artifact node), and the four operator decisions needed before any implementation lands. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The original text said the x2 diff was redundant if compile is content-addressed. Corrected: the gate is a load-bearing oracle for known-live non-determinism; content-addressing assumes determinism not proves it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The three gates use different (source_roots, binary) tuples (verified): - DslCompileCleanGate: gunbc compile dsl+src/v2 - EmitDeterminismGate: gunbc compile dsl only (x2 oracle pair) - RegenVerifyGate: regen_stage0 --verify (different binary) No artifact sharing is possible across gates in the current set. M2's value is forward-proofing (future gates declaring the same tuple reuse the RunnableCompile node; duplicates caught by lens), not present-day savings. Displacement table corrected: M1 saves ~35s (resolve memo), M2 saves up to 1x compile when oracle pair collapses after #5941 closes the non-determinism gap. Also: M1 dissolution trigger corrected (M1 is orthogonal to M2, not subsumed by it). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Table row said '×2' (oracle pair survives) but the text below correctly said 4→3 (three distinct tuples remain after oracle pair 2→1). Fix to '×3' throughout. §7 'collapse to 1× total compile' was impossible: even after oracle pair collapses, DslCompileClean + EmitDeterminism×1 + RegenVerify are three distinct-tuple operations and all remain necessary. Corrected to '4→3×'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…05s (not ~35s) Round 4 reviewer finding: Axis B actually has 4 resolve_entry_graph calls per run (Batch 1 DslCompileClean, Batch 2 SharedClaims group, serialized RegenVerify batch, serialized EmitDeterminism batch) — not 2×. M1 eliminates 3 redundant calls → ~105s saved, not ~35s. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cursor review finding: Total compile cost row had ~37s in both M1 columns, inconsistent with the corrected ~105s in the M1 granular table row and prose. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… threads Fixes doc_graph_has_no_orphan_docs CI failure: the new docs/plans file was not reachable from DESIGN.md. Added li to open_threads_blocks() and regenerated DESIGN.md via main_wet. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GREEN: all heavy runnables in the plan declare ResolveScopeShared. RED: a heavy profile with ResolveScopeIsolated fails the lens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…variant When group_batch_units merges a ResolveScopeShared SingleClaim into an existing SharedClaims unit that was created from an Isolated claim first, the group would silently drop the Shared flag and run via run_shared_entry_claims instead of the cross-batch memo path. Fix by ORing use_walk_memo on merge so the memo path wins whenever any member of the group declares ResolveScopeShared. Also document the memo-key invariant: source_roots is constant per run_walk call, so keying the memo by entry alone is safe today; notes what to change if that assumption ever widens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…port clippy error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ippy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ee_resolve heavy_whole_tree_resolve is the single authority (§3). The memo decision follows by law: a whole-tree resolve is deterministic per source_roots, so heavy⟹memoize is always true. Two independent axes with one combination forbidden was validation-where-construction-was-available (DESIGN §5). Removes: type ResolveScope, resolve_scope field on RunnableResourceProfile, resolve_scope_eq, runnable_profile_resolve_scope_valid, and the three schedule walkers (runnable_resolve_scope_valid, batch_all_resolve_scope_valid, schedule_list_all_resolve_scope_valid, schedule_all_runnables_valid_resolve_scope). These dissolve — HeavyIsolated is now unwritable by construction, so the validator and witnesses testing it are unnecessary. claim_executor.rs derives use_walk_memo from profile.heavy_whole_tree_resolve directly (single read site, no gate list). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two changes: 1. executor: at partition time, also move SharedClaims to memo_units if their entry is already in walk_memo (populated by a prior batch's heavy resolve). This eliminates cold re-resolves of the same entry in later batches even when the gate's own profile is non-heavy — achieving the documented 4×→1× resolve count per walk. 2. std_realization_schedule.rs: sync regen'd output (field shorthand vs explicit form in runnable_resource_profile constructor). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Finding 1 fixed in 3f324ce: at partition time in run_walk, any SharedClaims unit whose entry is already in walk_memo (from a prior batch's heavy resolve) is now promoted to memo_units regardless of its own heavy_whole_tree_resolve flag. This achieves the documented 4×→1× — batch-2 light gates sharing floor_gate_witness_entry with batch-1's DslCompileCleanGate now use the cached InterpContext rather than cold-resolving. Finding 2 (heavy_whole_tree_resolve as proxy weaker than explicit model surface): the promotion fix above addresses the specific failure mode cited — a non-heavy gate sharing an entry with a prior heavy gate no longer double-pays; it gets the memo path via the cache-hit promotion. The residual case (a non-heavy gate whose entry was never resolved by any heavy gate across the walk) is genuinely not memoized, which is correct: non-heavy resolves are cheap and M1 doesn't claim to memo them. The regen mismatch (field shorthand vs explicit form) is also fixed in the same commit. — sent from tidy-hawk-120 |
…ry per walk memo_deduplicates_resolve_count: first call assert resolve_nanos > 0 (fresh resolve fires), second call for same entry asserts resolve_nanos == 0 (cache hit, resolve_entry_graph does NOT fire). Goes RED if the memo is bypassed. Discriminating witness for the 4x->1x dedup claim (DESIGN §2). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auto-opened by session-dashboard for session
tidy-hawk-120.Pushing to
session/tidy-hawk-120advances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan