Polyglot Resolution via Inverted Symbol Map

, the call-graph builder in Eulix

PRISM is the part of libeulix that decides, for every call in your code, which function it calls. It works from syntax alone, with no build step and no type checker, so it runs on large repositories that mix languages.

Full name
Polyglot Resolution via Inverted Symbol Map
Part of
libeulix (Rust)
Versions
v2, scope-aware and the default; v1, name-only and fastest
Checked against
go/types, javac, jedi, rust-analyzer, the TypeScript checker and libclang

What PRISM does

A call graph records which function calls which. Eulix uses it to answer caller and callee questions straight from the index, and to pull related code into retrieval.

Getting every edge right usually takes a full type checker for each language, which is slow and often unavailable. PRISM keeps an index from every name to its definitions instead (the inverted symbol map) and resolves each call with a lookup.

How PRISM v2 picks a target

For a call to a name, v2 looks for a definition in this order and stops at the first match:

  1. the same file;
  2. the files that file imports;
  3. the same directory;
  4. the whole project, but only when few definitions share the name.

Methods, and when it declines to guess

For a method call such as self.validate(), v2 starts at the method’s own class and walks up through its parent classes.

When a name is shared by too many definitions to guess responsibly, PRISM draws no edge at all. A missing edge misleads retrieval less than a wrong one.

v1 and v2

PRISM v1 links every call to the first definition with that name. It is the fastest option and uses little memory on very large repositories, at the cost of wrong edges on common names like run or handle. v2 adds scope, imports and class hierarchy, and is the default.

How accurate it is

On eight projects, one per language, 98.6% of the edges PRISM v2 drew were correct, against 54.6% for v1. Each edge was checked against the call sites the language’s own compiler tooling resolves.

Recall is the trade-off: v2 skips calls whose receiver type isn’t written in the source, so Rust and C++ miss more edges than they get wrong.

PRISM documentation

More of Eulix

All Eulix docs