javascript: call-graph engine for the JavaScript front end - #466
Closed
swapnilpaliwal-sd wants to merge 15 commits into
Closed
swapnilpaliwal-sd wants to merge 15 commits into
swapnilpaliwal-sd wants to merge 15 commits into
Conversation
…callee resolution, call chain; tsc oracle and per-site scorer Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…types, member-named call/apply/bind, default-export recovery; oracle restricted to root files, JSX and type-only targets bucketed Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
… exports/module.exports as the module's own surface Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…values called and constructed through their default export, computed-member this, name-matched default-export recovery Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…s, map, typed T[], for..of, patterns and iteration callbacks; typedef aliases; exports-member writes on the module.exports value Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…hains and literals classifies the site; an ambient alternative beside project targets; this.constructor; regression suite with seven cases; README and parser-defects log Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ldens blessed; PD-JS-5 known-missing Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…staged from source; case 08 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e not tracked; this bound at definition sites only Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
10 tasks done
…ambient values Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…fan_capped), as in the other rule sets Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ntity per platform name is a global merge point Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…retired; the anonymous form still needs the modifier Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
swapnilpaliwal-sd
marked this pull request as ready for review
September 14, 2026 01:04
Contributor
Author
|
Superseded by #472, the same engine rebased onto |
swapnilpaliwal-sd
force-pushed
the
main
branch
from
September 14, 2026 07:41
f1827c7 to
febf8b4
Compare
Contributor
Author
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.
Tracking #456. Implements #457, #458, #459, #460, #461, #462, #463, #464, #467; #465 lists what is left.
Draft on purpose: nothing here merges until the engine is code-complete and the held-out evaluation is settled. The branch is the integration point; this PR carries the running evaluation.
What this is
A call-graph engine for the JavaScript front end, under
src/javascript/, with its oracle, scorer, evaluation harness and regression suite undertest/javascript/.JavaScript declares no types, so the engine is a may-analysis over values, not a type lookup: every expression, binding, parameter, property and return carries the set of values it may hold, a function, a class, an instance, a prototype, a module surface, an object literal, an array, or the platform, and a call site resolves through the callee's value. An untyped receiver produces nothing; the site is a declared unknown with its reason attached.
src/javascript/README.mdhas the layer order and the decisions;PARSER-DEFECTS.mdthe six IR gaps the rules work around.How it is measured
checker.getResolvedSignaturefrom ats.Programbuilt withallowJs+checkJsover the project's own files, per site. Sites the compiler types asany(about half) enter no rate. Scoring is per site: EXACT / SOUND_SUPERSET / WRONG / MISSED over compiler-decided client→client sites; platform targets, implicit constructors, JSDoc-type targets and targets outside the IR are bucketed apart.Results (production code, per-site, compiler-decided client→client)
Development corpus, 15 projects, 9,867 decided sites:
Held-out corpus, 4 projects, 9,649 decided sites, validation only, no rule was derived from it:
The generalisation gap is 4.6 points of exact and 1.2 of recall, and it is almost entirely WIDTH on project C: 387 of its 404 non-exact sites are 2-wide sound supersets. WRONG is 8 sites in 9,649.
Project B is the one that did not terminate before #467: the fan cap took it from >40 minutes to 9 seconds with development rates unchanged to three decimals. A second, smaller merge point surfaced after it, a write through a
@param {Object}-typed value landed on the ONE identity every such parameter shares, and is closed the same way (the platform's properties are not tracked).What is deliberately not resolved
Sites the compiler types as
any, 7,319 on the development corpus, 18,272 held-out, enter no rate. Platform targets (LIB_AMBIENT_OK6,040 / 5,561) are classified from the value reached, not the syntax; theLIB_MISSEDresidue (562 / 547) is almost entirely string/number/promise methods on the result of a project call, which nothing here types (#465). A fan wider than--dispatch-capis refused and declared (fan_capped), as in the other rule sets.Regression suite
Eight hand-written cases, edges and compiler adjudication pinned;
--blesscannot bless away a MISSED or WRONG line.test/javascript/run-tests.sh --oracle.