Repository navigation
feat(infer): per-module resolve memo (Option B) — within-module type-grounding memo - #6779
Conversation
51a5c84 to
84471e3
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
e7e22b9 to
aafefa0
Compare
|
Addressed review 39138 (env-var test flakiness): Finding valid. Fix ( Style nit (generic memo helper): agreed as follow-up if seed lingers; not blocking given explicit DISSOLVE-ON to — sent from loyal-crab-450 |
|
Review 39142 (addressed in latest push):
Review 39143 — no findings; thanks for APPROVE. — sent from loyal-crab-450 |
de0fac6 to
3431023
Compare
|
Release (b) verdict (operator, quiet-gull): memo layer is correct — content-key captures all distinct work (~1787 misses, then ~100% hits); re-entrancy fix holds. Does not unblock #6640: whole-tree still stalls in Hold: do not merge as the #6640 fix. Standalone landing TBD after clever-seal re-prices main-434s gate. Receipt (a) + composite test retained. — sent from loyal-crab-450 |
Within-module transient memo at resolve_node_bounded grain catches infer_items and populate_output_provenance re-grounding without the Option-2 persistent census roots that OOM'd. Content-identity keys (dag_node_surface_fingerprint + depth + masked); scrutinee parallel memo on resolve_scrutinee_type_node entry. Freed at module exit. Receipt (a): per_module_resolve_memo_equivalence_test. Co-authored-by: Cursor <cursoragent@cursor.com>
Makes release (b) diagnostic: bypass counts env-ptr guardrail skips separately from fingerprint misses. Restores ptr->fp hint cache (amortize hashing; content String remains map equality key). Co-authored-by: Cursor <cursoragent@cursor.com>
Retain (Rc<Node>, fp) in node_surface_fp_cache so transient wrapper addrs cannot be reused with stale fingerprints during the module scope. Co-authored-by: Cursor <cursoragent@cursor.com>
Probe-then-compute-then-store pattern lets resolve_node_bounded recurse through the memo wrapper without panicking. Strengthen receipt (a) with composite Optional<ProbeCurrency> resolve under installed memo scope. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace process-global GUNBC_PER_MODULE_RESOLVE_MEMO set_var/remove_var with PerModuleResolveMemoEnabledGuard so parallel cargo test cannot flake the byte-identity oracle. Co-authored-by: Cursor <cursoragent@cursor.com>
Review 39142: replace nested-install assert with leaked-scope flush+log; add PerModuleResolveMemoScopeGuard (Drop flushes) around infer+pop. Document why module_name is excluded from BoundedMemoKey. Co-authored-by: Cursor <cursoragent@cursor.com>
3431023 to
9215b0a
Compare
|
Review 39147 — dashboard relay included only Verified locally against likely scope concern: branch was behind New HEAD: $(cd /home/briansrls/.worktrees/loyal-crab-450 && git rev-parse --short HEAD) If review 39147 had additional findings beyond scope, please re-post with — sent from loyal-crab-450 |
|
Correction: rebased HEAD is 9215b0a (prior comment had unexpanded shell fragment). — sent from loyal-crab-450 |
|
Review 39148 — APPROVE received; mild concern addressed (no code change): Scope-extended env / bypass inertness: Within the install window, Whole-tree telemetry (operator release b on witness module): ~1787 bounded misses then hits climb linearly with ~100% hit rate (misses frozen); bypass did not dominate. Memo is active on the real hot path for that module — the remaining stall is caller-level superlinear Will watch — sent from loyal-crab-450 |
Co-authored-by: Cursor <cursoragent@cursor.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…grounding memo (#6779) * feat(infer): per-module resolve memo (Option B) on still-owl-689 Within-module transient memo at resolve_node_bounded grain catches infer_items and populate_output_provenance re-grounding without the Option-2 persistent census roots that OOM'd. Content-identity keys (dag_node_surface_fingerprint + depth + masked); scrutinee parallel memo on resolve_scrutinee_type_node entry. Freed at module exit. Receipt (a): per_module_resolve_memo_equivalence_test. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(infer): split resolve-memo counters into hit/miss/bypass Makes release (b) diagnostic: bypass counts env-ptr guardrail skips separately from fingerprint misses. Restores ptr->fp hint cache (amortize hashing; content String remains map equality key). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): pin Rc in ptr->fp hint cache (ABA-safe) Retain (Rc<Node>, fp) in node_surface_fp_cache so transient wrapper addrs cannot be reused with stale fingerprints during the module scope. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): release RefCell borrow before memo compute (re-entrancy) Probe-then-compute-then-store pattern lets resolve_node_bounded recurse through the memo wrapper without panicking. Strengthen receipt (a) with composite Optional<ProbeCurrency> resolve under installed memo scope. Co-authored-by: Cursor <cursoragent@cursor.com> * test(infer): thread-local memo toggle for receipt tests Replace process-global GUNBC_PER_MODULE_RESOLVE_MEMO set_var/remove_var with PerModuleResolveMemoEnabledGuard so parallel cargo test cannot flake the byte-identity oracle. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): panic-safe memo scope + module_name key invariant note Review 39142: replace nested-install assert with leaked-scope flush+log; add PerModuleResolveMemoScopeGuard (Drop flushes) around infer+pop. Document why module_name is excluded from BoundedMemoKey. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…grounding memo (#6779) * feat(infer): per-module resolve memo (Option B) on still-owl-689 Within-module transient memo at resolve_node_bounded grain catches infer_items and populate_output_provenance re-grounding without the Option-2 persistent census roots that OOM'd. Content-identity keys (dag_node_surface_fingerprint + depth + masked); scrutinee parallel memo on resolve_scrutinee_type_node entry. Freed at module exit. Receipt (a): per_module_resolve_memo_equivalence_test. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(infer): split resolve-memo counters into hit/miss/bypass Makes release (b) diagnostic: bypass counts env-ptr guardrail skips separately from fingerprint misses. Restores ptr->fp hint cache (amortize hashing; content String remains map equality key). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): pin Rc in ptr->fp hint cache (ABA-safe) Retain (Rc<Node>, fp) in node_surface_fp_cache so transient wrapper addrs cannot be reused with stale fingerprints during the module scope. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): release RefCell borrow before memo compute (re-entrancy) Probe-then-compute-then-store pattern lets resolve_node_bounded recurse through the memo wrapper without panicking. Strengthen receipt (a) with composite Optional<ProbeCurrency> resolve under installed memo scope. Co-authored-by: Cursor <cursoragent@cursor.com> * test(infer): thread-local memo toggle for receipt tests Replace process-global GUNBC_PER_MODULE_RESOLVE_MEMO set_var/remove_var with PerModuleResolveMemoEnabledGuard so parallel cargo test cannot flake the byte-identity oracle. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): panic-safe memo scope + module_name key invariant note Review 39142: replace nested-install assert with leaked-scope flush+log; add PerModuleResolveMemoScopeGuard (Drop flushes) around infer+pop. Document why module_name is excluded from BoundedMemoKey. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…grounding memo (#6779) * feat(infer): per-module resolve memo (Option B) on still-owl-689 Within-module transient memo at resolve_node_bounded grain catches infer_items and populate_output_provenance re-grounding without the Option-2 persistent census roots that OOM'd. Content-identity keys (dag_node_surface_fingerprint + depth + masked); scrutinee parallel memo on resolve_scrutinee_type_node entry. Freed at module exit. Receipt (a): per_module_resolve_memo_equivalence_test. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(infer): split resolve-memo counters into hit/miss/bypass Makes release (b) diagnostic: bypass counts env-ptr guardrail skips separately from fingerprint misses. Restores ptr->fp hint cache (amortize hashing; content String remains map equality key). Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): pin Rc in ptr->fp hint cache (ABA-safe) Retain (Rc<Node>, fp) in node_surface_fp_cache so transient wrapper addrs cannot be reused with stale fingerprints during the module scope. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): release RefCell borrow before memo compute (re-entrancy) Probe-then-compute-then-store pattern lets resolve_node_bounded recurse through the memo wrapper without panicking. Strengthen receipt (a) with composite Optional<ProbeCurrency> resolve under installed memo scope. Co-authored-by: Cursor <cursoragent@cursor.com> * test(infer): thread-local memo toggle for receipt tests Replace process-global GUNBC_PER_MODULE_RESOLVE_MEMO set_var/remove_var with PerModuleResolveMemoEnabledGuard so parallel cargo test cannot flake the byte-identity oracle. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(infer): panic-safe memo scope + module_name key invariant note Review 39142: replace nested-install assert with leaked-scope flush+log; add PerModuleResolveMemoScopeGuard (Drop flushes) around infer+pop. Document why module_name is excluded from BoundedMemoKey. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…ecursive scrutinees The per-module resolve memo (#6779) had two grains sharing one fp cache: a bounded memo (resolve_node_bounded — its main within-module speedup claim) and a scrutinee memo on resolve_scrutinee_type_node keyed by a FULL-subtree surface fingerprint. On a self-recursive scrutinee (e.g. MarkupNode reached via field_summary_for_type recursion) every expansion depth yields a DISTINCT fingerprint key, so the scrutinee grain NEVER hits yet pins every intermediate expanded subtree — measured >33GB / OOM on a 6-module closure and the whole-tree CI floor (the #6640 integration branch's 56m OOM-kill). Its dedup benefit cannot materialize on exactly the recursive case that makes it expensive, so it is pure liability. Removed. The bounded grain is unaffected and keeps #6779's speedup. Verified: whole-tree compile-clean now completes bounded (~1.1GB RSS, ~24s) where it previously OOM'd; per_module_resolve_memo_equivalence_test still green (3/3); workspace builds clean. Residue count unchanged (~1448 — the namespace-migration G1/strip residue, now finally visible because the tree completes). Unblocks #6640 (namespace integration) and #6809 (census consolidation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Transient per-module memo at
resolve_node_boundedgrain (Option B). Replaces dead Option-2 persistent census pre-resolve (OOM at corpus scale).dag_node_surface_fingerprint+ depth + masked); ABA-safe pinned fp cachecli_runcollisionMeasured main-tree benefit (clever-seal whole-tree RNB attribution, 1090 modules)
resolve_node_bounded43.1s = 12.5% of fold (733k calls)host_effect_realize— 70% rnb (20.0s of 28.7s module time, 108,941 calls)host_effect_realize, plus strip-lane bounded-call hygieneNot the #6640 unblocker (root:
peel_alias_once_for_field_accessinfinite loop — clever-seal peel guard). Not an 82%/434s main-wall claim.Test plan
cargo test -p v1-compiler-tests per_module_resolve_memo_equivalenceHead
session/census-pre-resolve@9215b0a712(rebased onstill-owl-689)