Skip to content

javascript: known gaps after the development sweep #465

Description

@swapnilpaliwal-sd

Part of #456.

Known gaps after the development sweep, each countable in the engine's output, each without a rule because the honest answer is "unknown" or because the mechanism is not built yet. Listed so the debt is visible; split into their own issues when picked up.

  • Primitive results are not typed. this.greet().toUpperCase() is ambiguous_unknown, not ambient_terminal: nothing knows greet returns a string. The LIB_MISSED bucket on the corpus is mostly this, string/number/promise methods on the result of a project call.
  • Inner defaults of a destructured parameter (function f({ cb = () => {} })) cannot be attributed to the name they initialise (PD-JS-5).
  • new this.constructor() returns the declaring class's instance, not the receiver's (javascript: a this-return is the receiver at each site, not the declaring class #464 covers return this only).
  • A dynamic registry, new registry.get(name)(...), new Curves[type](...), is a COMPUTED_CALL / computed member with no static target; correct as a dynamic_terminal, listed because it is a real population.
  • A utility that merges its callers. A generic forEach(obj, fn) helper that invokes fn.call(null, obj[i], i) gives every callback's first parameter the union of everything any caller iterated; the result is a SOUND_SUPERSET, occasionally 2–3 wide. Context sensitivity would remove it and is not planned.
  • Getter invocation (obj.value running a getter) is a reserved call kind in the parser with zero rows; no edge is produced and no site exists to be conserved.
  • JSX component calls are not sites in the IR.

Activity

  1. added
    backlog
    engine
    javascript
    on Sep 13, 2026
  2. added
    enhancement
    on Sep 14, 2026
  3. swapnilpaliwal-sd commented on Sep 14, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    The engine landed on main (21864ff, #472). This list stays open as the debt record: since it was written, the inner destructured default (PD-JS-5) is still open, getter invocation now yields the getter's return value (#481) though no site row exists, and everything else here is unchanged. Split an item into its own issue when it is picked up.

  4. JaredHLZhang commented on Sep 14, 2026

    @JaredHLZhang
    Collaborator

    Measurement for the inner defaults of a destructured parameter item (PD-JS-5), at aec7c1d (unchanged for JavaScript paths at 7cb0808), rebuilt with npm run build, solved with --debug.

    The gap does not only lose an edge: when the callers pass exactly one other value, the site is committed as known_edge to that value, and the compiler scores it WRONG. This is the one WRONG in the in-repo torture program today (graph/test/javascript/torture/run.sh, compiler half: EXACT 103 / SUPERSET 8 / WRONG 1 / MISSED 0).

    function inc(x) { return x + 1; }
    function twice(x) { return x * 2; }
    function withDefault(cb = () => 0, { mapper = twice } = {}) { return mapper(cb()); }
    withDefault();                          // runs twice
    withDefault(() => 5, { mapper: inc });  // runs inc

    mapper(…) → known_edge → inc. The compiler names twice; execution runs both. Suggested direction while the default stays unattributed: a binding inside a parameter pattern whose default has no link should not yield known_edge. Emit multi_inferred with an ambiguous_unknown alternative, so the incompleteness is visible. The harness not failing on this WRONG is filed separately as #610.

  5. swapnilpaliwal-sd commented on Sep 15, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Split three items into their own issues, picked up now: #673 (inner defaults of a destructured parameter, PD-JS-5), #674 (primitive results not typed), #675 (new this.constructor()). The dynamic registry, the caller-merging utility and JSX component calls stay listed here.

  6. swapnilpaliwal-sd commented on Sep 15, 2026

    @swapnilpaliwal-sd
    ContributorAuthor

    Status on 2026-09-15 evening. Split and closed since the last note: #674 (primitive results, partly: operator results, Object.keys elements and for..in keys, Object.prototype members are ambient terminals now; #685, #686), #673, #675. The caller-merging utility item now has a concrete, countable instance filed as #695 (webpack's memoize wrappers, 21 MISSED sites) with a per-call-site summary sketched there. Still listed here and unchanged: the dynamic registry (correct as dynamic_terminal) and JSX component calls (parser). Small-project scores at main 6c234ee: mongoose EXACT 2109 MISSED 0, webpack EXACT 9670 MISSED 48 (was 193 this morning), express 88/88, held-out ghost EXACT 1784 MISSED 0 with LIB_MISSED 48 to 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

backlogengineenhancementjavascript

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions