Skip to content

Call-graph reference: evaluate SCIP on Java as a shared route for several languages #3783

Closed

Description

@squid-protocol

Part of #3772.

Why

SCIP (Sourcegraph's code-index format) has indexers for TypeScript, Java, Go, Python, C# and Rust. A SCIP index records every definition and every reference occurrence, with symbol identity. A call edge follows from a reference occurring inside a function definition's range. One SCIP adapter could therefore cover many languages. #3332 originally proposed scip-java, scip-typescript and scip-go.

Evaluate on Java

  • Setup: run scip-java on google/gson (pinned in tests/import_graph_corpus.json) and write the SCIP → contract adapter.
  • Quality: is a reference the same as a call? Exclude type references, and keep only references in call position.
  • Cost: SCIP indexers need a buildable project with its dependencies installed (Maven or Gradle). That means network access and CI time. Measure both.
  • Cross-check: compare SCIP's TypeScript output on zod against ts_callgraph.js, to learn how far SCIP-derived edges can be trusted.

Decision

Adopt SCIP for the remaining languages, or stay with native per-language tools. Record the decision here.

Activity

  1. added
    enhancement
    testing
    on Sep 26, 2026
  2. squid-protocol commented on Sep 26, 2026

    @squid-protocol
    OwnerAuthor

    Decision: use SCIP where the indexer runs the compiler and records definitions fully; keep a native adapter where it sees more

    The evaluation is in #3838.

    • Java works through SCIP. scip-java 0.12.3 on gson:
    • TypeScript stays on tsc. The cross-check of scip-typescript 0.4.0 against ts_callgraph.js on zod, through the same adapter:
      • 96.5% of SCIP's own edges are in tsc's graph too, so its edges are trustworthy;
      • it covers only 52.4% of tsc's edges;
      • 88% of that gap is callers SCIP has no definition for: member assignments (inst.refine = …), quoted keys, and object-literal methods.
    • Cost:
      • Java: about 45 seconds per gson build once cached. The first fetch of the scip-java jars takes about 25 seconds.
      • Maven Central rate-limits bursts with 429s. MAVEN_FLAGS retries, and CI caches ~/.m2 and the jars.
      • scip-typescript: 33 seconds on zod.
    • For the remaining languages: run the documented compare cross-check whenever a native reference exists. Adopt SCIP where there's none and the indexer records kinds and extents; Go, C# and C/C++ are the next candidates.

    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementtesting

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions