Stack graphs: Name resolution at scale
Douglas A. Creager, Hendrik van Antwerpen

TL;DR
Stack graphs extend scope graphs to enable scalable, precise name resolution across large codebases like GitHub, using incremental, file-isolated graph construction and a stack-based lookup algorithm for efficient navigation.
Contribution
We introduce stack graphs, a novel graph-based framework for name resolution that scales to millions of repositories and requires no package-specific configuration.
Findings
Supports cross-repository name resolution at scale
Uses file-incremental graph construction for efficiency
Enables precise code navigation without build system dependencies
Abstract
We present stack graphs, an extension of Visser et al.'s scope graphs framework. Stack graphs power Precise Code Navigation at GitHub, allowing users to navigate name binding references both within and across repositories. Like scope graphs, stack graphs encode the name binding information about a program in a graph structure, in which paths represent valid name bindings. Resolving a reference to its definition is then implemented with a simple path-finding search. GitHub hosts millions of repositories, containing petabytes of total code, implemented in hundreds of different programming languages, and receiving thousands of pushes per minute. To support this scale, we ensure that the graph construction and path-finding judgments are file-incremental: for each source file, we create an isolated subgraph without any knowledge of, or visibility into, any other file in the program. This…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Scientific Computing and Data Management · Parallel Computing and Optimization Techniques
