Repository navigation
func_env.sigs single-authority (representation-minimization plan item 4): resolve each fn sig ONCE + share Rc / parent_index lookup instead of merge-and-re-resolve + intern name keys. Resolution-strategy ROOT fix (same class as #5867), ~hundreds MiB. Measure-first, green-by-exec, hand-edit .rs seed - #5893
Merged
Merged
Conversation
…les (plan item 4) Each importing module was re-materializing its transitive-closure signatures: merge_scope_from_imports converted ResolvedFuncSig -> DeclaredFuncSig (fresh allocation per sig), then resolve_func_sigs called collect_parent_resolved_sigs which called declared_to_resolved to convert back (another fresh allocation). Net: two fresh struct allocations per imported sig per module. Fix: merge_scope_from_imports now accumulates imported_sigs as Map<String, ResolvedFuncSig> directly via rc_map_merge over the parent's func_env.signatures (Rc clone — O(1) per sig, no struct allocation). resolve_func_sigs accepts parent_sigs directly, skipping collect_parent_resolved_sigs. InferScopeComponents.func_sigs (DeclaredFuncSig) replaced by imported_sigs (ResolvedFuncSig) — the conversion round-trip is eliminated. Same single-authority move as #5867 (shared InternTable). Payoff: hundreds of MiB — each of the ~608 modules no longer allocates fresh ResolvedFuncSig structs for every transitively-imported function signature. Changes: 04_infer.dag (.dag authority) + 04_sigs.dag + hand-edited .rs seed (v1_compiler_infer.rs, v1_compiler_infer_sigs.rs). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…adow filter Two fixes from claude-opus review: 1. collect_parent_resolved_sigs is now unreferenced (its only call in resolve_func_sigs was replaced by parent_sigs parameter). Delete it from 04_sigs.dag and v1_compiler_infer_sigs.rs. 2. The original collect_parent_resolved_sigs filtered out parent sigs whose names collide with local functions, preserving correct topo- ordering when a local fn shadows an imported one. The new parent_sigs parameter did not apply this filter. Restore the local-shadow filter inline in resolve_func_sigs: parent_sigs_filtered excludes names in local_func_set before seeding topo_resolve_loop, exactly matching the original behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
briansrls
marked this pull request as ready for review
June 28, 2026 14:41
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.
Auto-opened by session-dashboard for session
zesty-wren-856.Pushing to
session/zesty-wren-856advances 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