Repository navigation
SymbolIndex / type-env-single-authority — the containment-tree naming authority (dissolves v1 global_bare census, peel guard, sigs walk, and the total-census memory wall). Owned under namespace-migration lane. - #6809
Conversation
Remove the deleted global_bare parameter from compiler_tests profiling harness and its .dag source so fmt and compile stay green. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
Split symbol_index_insert_decl for decl tracking; variant aliases use entry-only insert so global_bare stays byte-identical to the deleted build_global_bare_census population. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Response to review 39316 (variant-alias census broadening) Valid finding on Fix (d2dcac + 6e08d55):
This was also the root cause of the compile-clean failure on review 39318: Agreed — consolidation is coherent; the interim regression above is now repaired. Re: — sent from clever-ram-104 |
|
Response to review 39319 (dead Valid finding — fixed in Removed the unused helper from both authorities:
|
…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>
…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>
…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>
|
Addressed review 39382 in
PR body Test plan section now has the equivalence-receipt commands and results. — sent from clever-ram-104 |
… live_deploy generated artifacts)
…n_wet. Brings in #6824 open-thread rows (wrap-decision, witness-realization, machine-shape) so the design_document emit matches committed DESIGN.md and generated_artifact_drift_gate passes on current main. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Verified review 39419 against current HEAD (
No code changes from this review. CI pending on drift-fix push. — sent from clever-ram-104 |
|
Verified review 39420 against current HEAD ( Confirmed:
— sent from clever-ram-104 |
…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>
Restore main's infer_lookup/env/resolve/sigs and emit after merge conflict resolution; pass source_roots to enable_floor_compile_clean_lazy_install. Co-authored-by: Cursor <cursoragent@cursor.com>
…Var fallback - Register unique Disj variants into global_bare (symbol_index_insert_decl, corpus-ambiguity fail-closed) — was entries-only/qualified per #6809 - ExprVar path consults global_bare census when locals + func_sig miss - Mirrored into stage0 seed - Whole-tree compile-clean residue 4847 -> 1583 (baseline 9310, cumulative -83%) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e dispatch in as the fourth consumer Two updates to the namespace-only resolution design. 7.5 sequencing: SymbolIndex LANDED (#6809, dag/std/symbol_index.dag). The loyal-heron scaling gate this lane was waiting on is discharged; the doc still described it as pending. namespace-only is now a policy layer over a settled, in-tree index. New 10: the fork is three-way, not two. Proven by instrumented probe (reading lookup_resolved_sig's return value directly, because the compiler rejects neither label nor return-type mismatches for this shape, so absent diagnostics carry no information): a module importing twin_sig from twin_p binds twin_q's signature. func_env.parents records WHICH MODULES are imported, never the selective name list, and its order is incidental. So neither typecheck nor runtime honors the import list -- 2.1's dual-representation argument is empirically confirmed and stronger than stated: imports are a DEAD authority, not a redundant working one. Folding dispatch in converts component 1 of the bare-name dispatch fork from 'build a fourth resolver' into 'delete a fork': fn_nodes dissolves rather than being re-keyed, GlobalBareLookupAmbiguous is already the 2.4 typed refusal, and dispatch stays one map hit (on QualifiedName, not a per-call ancestor walk) -- the claim most worth falsifying before implementation. Records why no standalone fix is defensible, and the counted-ledger interim if the flip is not immediate.
…nce census spec (docs only) (#6933) * WIP: collapse the fork * collapse-the-fork: remove exploratory homonym probe fixtures (design review deliverable; repro recipe in report, not landed ahead of design sign-off) * WIP: collapse the fork * WIP: collapse the fork * WIP: collapse the fork * revert stray dag/gunbc contamination: a mid-turn auto-commit captured a conflicted git-stash pop The worktrees share one git stash stack; a concurrent session (deep-wren-620) pushed a stash during a long corpus run, so a pathspec-limited 'stash pop' here popped THEIR entry and left conflict markers in six dag/gunbc/*.dag files, which an auto-commit then captured (ec0afe1). Those files are restored to their origin/main content; the other session's stash entry is intact and untouched. No dag/gunbc change was ever intended by this branch. * WIP: collapse the fork * WIP: collapse the fork * WIP: collapse the fork * add discriminating witness for the application-site contract wall; drop the qualified-dispatch scaffold * restore stray #[cfg(test)] above cross_representation_equality_test (review 39978) * WIP: collapse the fork * WIP: collapse the fork * remove Q1 sigprobe fixtures (inconclusive investigation, not a landable artifact) * WIP: collapse the fork * WIP: collapse the fork * namespace lane: record that the import list is inert, and fold runtime dispatch in as the fourth consumer Two updates to the namespace-only resolution design. 7.5 sequencing: SymbolIndex LANDED (#6809, dag/std/symbol_index.dag). The loyal-heron scaling gate this lane was waiting on is discharged; the doc still described it as pending. namespace-only is now a policy layer over a settled, in-tree index. New 10: the fork is three-way, not two. Proven by instrumented probe (reading lookup_resolved_sig's return value directly, because the compiler rejects neither label nor return-type mismatches for this shape, so absent diagnostics carry no information): a module importing twin_sig from twin_p binds twin_q's signature. func_env.parents records WHICH MODULES are imported, never the selective name list, and its order is incidental. So neither typecheck nor runtime honors the import list -- 2.1's dual-representation argument is empirically confirmed and stronger than stated: imports are a DEAD authority, not a redundant working one. Folding dispatch in converts component 1 of the bare-name dispatch fork from 'build a fourth resolver' into 'delete a fork': fn_nodes dissolves rather than being re-keyed, GlobalBareLookupAmbiguous is already the 2.4 typed refusal, and dispatch stays one map hit (on QualifiedName, not a per-call ancestor walk) -- the claim most worth falsifying before implementation. Records why no standalone fix is defensible, and the counted-ledger interim if the flip is not immediate. * remove Q1 instrumented-probe scaffolding (throwaway investigation; finding recorded in namespace-resolution-design.md 10.1) * namespace lane 10.4: spec the divergence census as the next step (operator-directed) * fix review 40267: wrong SymbolIndex carrier path, and drop the racing consumer ordinal --------- Co-authored-by: Brian Searls <briansearls1@gmail.com>
…uling (#6973) Folds the operator ruling of 2026-07-21 into namespace-resolution-design.md as §13. Semantics are ratified (operator, in-session: "fail loudly" / "full path required at all times + users can alias" / "familiar frontend, very strict/ precise underneath" / "this looks good"); wording is the lane's draft, operator reviews here. The rule: resolve a reference's first segment to the UNIQUE binder on its ancestor chain — zero = loud Unresolved, 2+ = located typed Ambiguous with the full candidate list + fix menu, exactly one = project downward. No nearest-wins; shadowing is a refusal (Elm precedent); refusal at the reference site. Amends §3/§6 ("exactly one nearest" -> "exactly one on the chain; multiple = refusal"). Invariant: no edit elsewhere can silently CHANGE what an existing reference means — only loudly break it. Fallback chains (nearest-wins / global-unique-fallback / first-hit / silent-pick) rejected as a class; uniqueness replaces priority order (Rule 2 on the ancestor chain). Also captures: aliases as ordinary binding nodes (import->alias transmutation, source of truth = the walk's resolved target, #6936 buckets); global_bare dies as a resolution mechanism (migration-oracle only, then delete); builtins bind at root (dissolves the prelude-shaped neither_bound class); the (Y) expected-type filter FLAGGED not ruled (adjacent to the rejected fallback class, needs its own ruling); and sequencing (§10 step-1 in flight #6968; transmutation lands with-or-before the strict flip, never imports-first). Relayed from sunny-wolf-225 (fix governor); gates Phase 1 dispatch. Sibling to the DESIGN.md #6809 gate-discharge doc fix (#6969), kept separate to preserve that PR's approvals. Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…te is discharged (#6969) The namespace-only-resolution open-thread bullet still read "gated on loyal-heron's scaling receipt before any resolver surgery", but namespace-resolution-design.md §7.5 records that gate as DISCHARGED at #6809 ("the lane is no longer blocked on it"). This is a summary-to-authority alignment, not a design change: the open-thread summary was stale relative to its own authority doc, and was mis-gating readers into believing resolver surgery is still blocked on the scaling receipt when the design doc says it is not. Both surfaces updated in lockstep to avoid a §3 dual-representation drift: the DESIGN.md bullet and its mirror in dag/gunbc/design_document.dag (li text) carry the identical correction. Rationale flagged for operator review per sunny-wolf-225's authorization; operator can veto in review if the gate is considered live for other reasons. Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Folds
build_global_bare_censusintoSymbolIndex.global_bare, removing theTypeEnv.global_baredual-representation. The corpus-wide bare-name census now lives on the singleSymbolIndexauthority (built once by the topo prepass), not a second parallel map.Why
§2/§3 single-authority:
SymbolIndexis the qualified-name authority (Rule 1 forbids a second index). The standaloneglobal_barecensus was a dual representation of naming facts. This consolidation lands the settled substrate that thenamespace-only-Yresolver flip sits on (design: SymbolIndex lands first, then namespace-only-Y is a policy layer over it —docs/plans/namespace-resolution-design.md§7.5/§8).Behavior (byte-identical, fail-closed)
The
global_barepopulation is byte-identical to the deleted census — deliberately behavior-preserving:symbol_index_insert_decl/local_binding_for_item);SymbolIndex.entriesbut do NOT enterglobal_bare(unchanged);lookup_binding_by_nameconsultsglobal_bareonly afterstr_bindings/ancestry_str_bindings/intern+bindingsall miss;GlobalBareUniqueBindingresolves;GlobalBareAmbiguousBindingstaysAbsent— fail-closed, never guesses (§5).Load-bearing — needs operator sign-off
Touches
04_env.dag/04_infer.dag/04_resolve.dag(typecheck signatures threadsymbol_indexthroughbuild_type_env/typecheck_module). Per session policy these pipeline stages require operator sign-off before merge.Test plan
Equivalence receipt (byte-identical census population on live floor corpus):
cargo test -p v1-compiler-tests global_bare --release— 6/6 PASS (~48s)global_bare_corpus_census_test::tier2_namespace_homonym_invariants— tier-2 triage invariants hold onSymbolIndex.global_barebuilt bybuild_symbol_index_census(dag/ + src/v2 floor roots)global_bare_corpus_census_test::tier2_census_disposition_snapshot— census leg refuses ABSENT names (shape-coverage gap unchanged)global_bare_corpus_census_test::corpus_census_state_of_failing_names— live census histogram over dag/ corpusglobal_bare_corpus_census_test::corpus_ambiguous_roster— AMBIGUOUS roster emitted from floor source-rootstype_env_scope_chain_test::global_bare_fallback_resolves_when_corpus_wide_unique—lookup_binding_by_nameresolves viasymbol_index.global_barewhen corpus-wide uniquetype_env_scope_chain_test::global_bare_fallback_stays_absent_when_corpus_wide_ambiguous— ambiguous staysAbsent(fail-closed)Resolver / type-env unit tests:
cargo test -p v1-compiler-tests type_env_scope_chain --release— 13/13 PASS (~1.2s) — import-chain scaling, str_bindings index, RC identity, local shadowing (all on updatedbuild_type_env/symbol_indexthreading)Self-host (no reconcile escape hatch):
regen_stage0 --verify— PASS (regen_divergence_count=0; fresh emit matches committed stage0 without post-process overwrite)cargo test -p v1-compiler emitted_compiler_tests_has_no_stale_global_bare_arg --release— 1/1 PASS (~29s) — freshcompile_stage0emit ofcompiler_tests.rsdoes not carry the removedglobal_bareargumentCI:
build— PASS (post-merge with origin/main @ Link the effect-namespace-grants design doc (fix main-red doc-orphan wall) #6821 orphan-doc fix)ci— pending on93fa7a92bReview fixes landed (
93fa7a92b):reconcile_compiler_tests_generated_sourcesilent overwrite; emit is clean by executiondoc_graph_orphan_inventory_for_ci_debugtest; restoredreachable_set_flags_orphan_node#[test]Body filled by quiet-gull-833 (namespace-migration lane owner) to unblock review — #6809 is the critical-path substrate for finishing the migration. Test plan section completed by clever-ram-104 (owner).