Repository navigation
fix(kernel): port upstream's remaining JS binding/ambient resolution debt + explore fixes - #585
Merged
Merged
Conversation
…esolution debt Three pre-existing resolver suites go green: - js-receiver-binding-scope (colbymchenry#2589): a bound receiver whose binding says nothing falls through to the name strategies — an unannotated parameter (`(root)`, `{ root }: { root: any }`) or a `new C()` whose C is no class. Annotated params (`store: any`) and typed/call-result declarations stay terminal under the claim model. Strategy 3 now also filters React lifecycle methods on Component-derived classes for non-this receivers. - dynamic-import-binding (colbymchenry#2491): isOutOfRepoBinding + innerScopeShadows — the narrowest in-scope import binding (block-scoped dynamic rows win over file-wide statics) decides the name's module; when it's outside the repo only same-file declarations nested in a function still shadow it. - ambient-module-imports: the resolveOne ambient gate — a declaration inside `declare module 'x'` is reached only through an import of `x`, never by bare name from a file that reaches no `x`. Also in the batch: MEMBER_TYPE_NON_TYPES verbatim (Java `permits`/`throws`), and a `fn_ref` outcome channel so paren-less Pascal method pointers keep their fnRef edge metadata. Precision: vite 8/8, svelte 1/1, jq clean; golden dumps unchanged.
…long covering-test ranges - name-substring-index: the fork (#258) made result order explicit — (length, kind, rowid) — and reshaped idx_nodes_kind for it. Keep upstream's memoized substring index but order its hits by that contract instead of simulating whichever plan SQLite picked; the plan-detection machinery goes with it. - explore-source-ranges/tools: a covering test longer than WHOLE_TEST_MAX_LINES emitted its whole span and truncated before the requested call+assertion. Long callbacks now emit their header plus the statement ranges, and sourceMinimums reserves every no-nodeId range of a covering test, not just the first.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The Go receiver path re-ran the same ancestor scans at the same site: go_written_qualifier and resolve_go_cross_package each shadow-checked the import root with a full local_at walk; go_asserted_local_type ran twice per ref (once in go_asserted_member, again inside go_named_local_written); and go_named_local_written repeated the local_declaration_in ancestor walk go_local_declaration_at had just done for the same name+site. - resolve_go_cross_package skips its is_shadowed_import when go_ref_qualifier already proved the receiver is the written qualifier - go_local_decl_memo (keyed file+name+site byte) shares the local_decl_at walk — its value keeps the target identifier's byte range so go_named_local_written re-derives the node instead of re-walking - go_asserted_type_memo dedupes the asserted-type scan kernel-prof on the gin corpus, calls|go nonbare refs: ~261 -> ~206 ms (-21%), bound_receiver_claim 208 -> ~165 ms. Precision identical (8417 edges, 3/3 held); golden dumps and all 459 Go tests green.
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.
Summary
Ports upstream resolution behavior into the kernel for the failure batches that #582's landing exposed, plus one perf fix found while profiling:
root.render()links to a class component's render() when root is declared outside colbymchenry/codegraph#2589): an uninformative bound receiver — an unannotated parameter or anew C()whoseCbinds no class — now falls through to the name strategies instead of staying terminal.js_param_unannotatedchecksname:at the binding's own position so{ root }: { root: any }falls through whilestore: anystill claims (fork claim model preserved).untyped_local_call_typekeepsconst r = createRoot(el)typed. Strategy 3 gains theis_react_lifecycle_methodfilter forrender/lifecycle methods onextends (React.)?(Pure)?Componentclasses.js_out_of_repo_binding— the narrowest in-scopeimport-kind binding row (block-scopedawait import/requirebindings win over file-wide statics) decides the name's module. When bound out-of-repo,inner_scope_shadowskeeps only same-file declarations nested inside a function/method as candidates; non-callsrefs get the early-null gate.declare module 'x'is reached only through an import ofx(ambient_specifier_of+reaches_ambient_module), fixinghtml.ts's out-of-repo re-export linkingtypings/vscode.d.ts.MEMBER_TYPE_NON_TYPESported verbatim (addspermits,throws, ~30 keywords) sopermits Circle, Squareno longer types receivers.fn_refoutcome channel so paren-less Pascal method pointers keepfnRef: trueedge metadata.(length, kind, rowid)order instead of simulating SQLite's plan (plan-detection machinery removed); covering tests longer thanWHOLE_TEST_MAX_LINESemit header + statement ranges so requested source reaches the evidence.resolve_go_cross_packagenow reuses the qualifier's shadow check, and two memos sharelocal_decl_at/go_asserted_local_typeresults per (file, name, site). kernel-prof on gin: calls|go nonbare ~261 → ~206 ms (−21%).ui-packagefailure locally — a straypnpm installoverlay had installed svelte 5.57.3 vs the locked 5.56.10 (only_childskew);npm cirestored the locked layout. No code change.Test plan
fnm exec+ cargo on PATH)README rows checked
No README table rows move: these ports make the fork match upstream behavior, and no quoted numbers change. The upstream merge-point claim is unchanged (still through
69af19ac); the new upstream behavior rows these ports close were already claimed as merged debt items. The gin perf delta is per-ref kernel time, not an index-wall-clock row the README quotes.