Skip to content

fix(native): persist raw call-site receiver info to DB for this/super dispatch on native path #1326

@carlos-alm

Description

@carlos-alm

Problem

The native orchestrator path does not persist raw call sites (including receiver type: this, super) to the DB after the Rust pipeline completes. As a result, this.method() and super.method() dispatch cannot be resolved through the CHA post-pass (runPostNativeCha) on the native path.

This is a real accuracy gap between the WASM and native engines. On WASM, resolveThisDispatch handles these cases inline in buildFileCallEdges. On native, there is no equivalent because the raw unresolved call site data is not available after the Rust pipeline runs.

Affected tests

In tests/integration/phase-8.5-cha-dispatch.test.ts, the following 4 tests are currently skipped on the native engine:

  • this-dispatch: emits ConcreteWorker.doWork → ConcreteWorker.prepare
  • super-dispatch: emits Lion.speak → Animal.speak
  • CHA transitive: emits runJob → PrintJob.run (3-level hierarchy)
  • CHA transitive: emits runJob → ScanJob.run (3-level hierarchy)

The transitive CHA tests also require the abstract_class_declaration fix in the native binary (v3.11.2 does not include it yet).

Fix paths

  1. Have the Rust extractor persist unresolved call sites with receiver type to the DB (new table or extra column on edges), then use this data in runPostNativeCha to resolve this/super dispatch.
  2. Alternative: run a WASM-based post-pass for this/super sites even on native builds (hybrid approach).

Deferred from PR #1325 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions