| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…#1506) Three root causes fixed: 1. resolveThisDispatch: prefer same-file method nodes when callerFile is provided. When super-dispatch finds parent class A in multiple files (name collision), only same-file A.m nodes are returned. All three call sites updated to pass relPath. 2. runChaPostPass / runPostNativeCha: exclude already-resolved CHA edges (technique='cha') from BFS expansion. Super-dispatch edges pointing to A.m must not be re-expanded to B.m implementors — that produces false cross-file polymorphic dispatch edges. 3. runPostNativeThisDispatch: extend relFiles to include files with func-prop method definitions (e.g. f.h = function(){this.g()}) that are not in the extends hierarchy. Filters to method nodes whose owner prefix is not a known class name, keeping the added set small. Fixes 6 of 12 jelly-micro parity diffs. Remaining 5 filed as #1538, #1539.
Greptile SummaryThis PR eliminates 6 of 12 remaining jelly-micro parity divergences by addressing three independent root causes: a same-file preference in resolveThisDispatch to suppress cross-fixture false super.m() edges, a CHA double-expansion guard (technique != 'cha') applied consistently to runChaPostPass, runPostNativeCha, and both query sites inside those functions, and a new UNION sub-query in runPostNativeThisDispatch that includes func-prop files in the native post-pass re-parse set.
Confidence Score: 5/5The three fixes are narrowly scoped post-pass additions that do not alter primary parsing or storage paths, making this safe to merge. All changed files touch post-pass logic running after core edge insertion. The CHA double-expansion guard is a well-understood SQL filter applied symmetrically. The same-file preference falls back to previous behaviour when no same-file node exists. The NULL guard in the inner NOT IN sub-select was explicitly added. Remaining observations are speculative edge cases in pathological codebases. cha.ts — the same-file preference applies across all BFS iterations, not just the starting class; worth revisiting if cross-file inheritance combined with class-name collisions appears in real-world projects beyond test fixtures. Important Files Changed
Sequence DiagramsequenceDiagram
participant Native as Native Rust Engine
participant CHA as runPostNativeCha
participant TD as runPostNativeThisDispatch
participant RTD as resolveThisDispatch
Native->>CHA: "edges (kind=calls, technique!=cha)"
Note over CHA: technique!='cha' guard prevents BFS re-expansion
CHA->>CHA: BFS over implementors
CHA-->>Native: "new CHA edges (technique='cha')"
Native->>TD: trigger after CHA
TD->>TD: "relFiles = extends-hierarchy UNION func-prop files"
TD->>TD: WASM re-parse relFiles
TD->>RTD: resolveThisDispatch(..., relPath)
Note over RTD: same-file preference on found nodes
RTD-->>TD: filtered targets
TD-->>Native: "new this/super dispatch edges (technique='cha')"
Reviews (5): Last reviewed commit: "fix: resolve merge conflicts with main" | Re-trigger Greptile |
Sorry, something went wrong.
| AND SUBSTR(n.name, 1, INSTR(n.name, '.') - 1) NOT IN ( | ||
| SELECT name FROM nodes WHERE kind IN ('class', 'struct', 'interface', 'type') | ||
| ) |
There was a problem hiding this comment.
NOT IN with potential NULL names silences the entire UNION branch
The inner subquery SELECT name FROM nodes WHERE kind IN ('class', 'struct', 'interface', 'type') may return rows whose name is NULL (e.g. an anonymous class or a parser-produced node with no identifier). In SQL, x NOT IN (NULL, ...) evaluates to NULL, which is falsy in a WHERE clause, so every outer row is silently rejected. If that happens, the UNION branch emits zero rows and the func-prop feature is completely non-functional — with no error or warning. Adding AND name IS NOT NULL to the inner SELECT prevents this.
| AND SUBSTR(n.name, 1, INSTR(n.name, '.') - 1) NOT IN ( | |
| SELECT name FROM nodes WHERE kind IN ('class', 'struct', 'interface', 'type') | |
| ) | |
| AND SUBSTR(n.name, 1, INSTR(n.name, '.') - 1) NOT IN ( | |
| SELECT name FROM nodes WHERE kind IN ('class', 'struct', 'interface', 'type') AND name IS NOT NULL | |
| ) |
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed — AND name IS NOT NULL is already applied to the inner sub-select (line 802). The guard was added in commit cd5c9875 alongside a comment explaining the SQL NULL semantics (lines 793–794). No anonymous-class node can silently suppress the entire UNION branch.
Sorry, something went wrong.
Codegraph Impact Analysis6 functions changed → 10 callers affected across 5 files
|
Sorry, something went wrong.
|
Addressed both issues:
Note: this PR currently has a content conflict with main (both #1536 and this PR modified native-orchestrator.ts). Conflict resolution is pending. |
Sorry, something went wrong.
Sorry, something went wrong.
docs check acknowledged
docs check acknowledged
…ethod files docs check acknowledged
| Back | FazBrowse Home | New Git URL |
Summary
Fixes 6 of 12 remaining jelly-micro parity divergences from issue #1506. Three root causes addressed:
resolveThisDispatch same-file preference: When super.m() resolves to a parent class that exists under the same name in multiple files (e.g. class A defined in super.js, super2.js, and super4.js), only same-file nodes are returned. All three call sites now pass callerFile (relPath).
CHA double-expansion guard: runChaPostPass and runPostNativeCha now exclude edges with technique='cha' from BFS expansion. A super-dispatch edge (PostMixin.m → A.m) was being re-expanded via CHA implementors to produce false PostMixin.m → B.m edges at CHA_TYPED_DISPATCH_CONFIDENCE=0.8.
Func-prop this-dispatch in native post-pass: runPostNativeThisDispatch was restricted to files in the extends hierarchy. Files with func-prop method definitions like f.h = function(){ this.g(); } (where f is not a class) were excluded. Added a UNION sub-query that includes files where method-node owner prefixes are not known class names, fixing this/this.js:f.h → f.g in the native engine.
Results
Remaining 5 diffs filed as:
Test plan
Closes #1506