paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Beyond Nominality: Faster Rapid Type Analysis in the Presence of Structural Subtyping

超越名义性:结构子类型下更快的快速类型分析(RTA)
OOPSLA 10(OOPSLA2)2026匹配度 3/10 · 论文研究的是结构子类型语言(Go)中 RTA 调用图构建的加速与工业落地,属于静态分析/程序分析方向,但未涉及机器学习系统、Agentic 程序、LLM 改进静态分析、浮点程序分析或贝叶斯程序分析等用户核心交叉方向。其工业部署和并行加速思路对静态分析工程有参考价值,但距离研究画像的核心问题较远。引用 1 inbox
Elton Pinto, Milind Chabbi
crossref: 2026-10-02

AI 速览

一句话:提出 Kumo,用方法索引与并行化加速结构子类型语言中的 RTA 调用图构建,Uber Go 服务中位加速 116×。

RTA 在名义子类型下可常数时间判定“具体类型 C 是否实现接口 I”,但结构子类型(如 Go)中子类型关系隐式,需比较方法集合。RTA 增量发现类型,朴素做法将新类型与已发现类型两两比较,导致 O(|C|×|I|) 次 implements 检查,拖慢大型程序调用图构建。本文提出 Kumo:利用“匹配类型至少共享一个方法名”这一必要条件构建方法索引,将检查限制在少量候选;并并行化 RTA 的不动点迭代,以事件排序与细粒度同步保证正确性和可扩展性。在 Uber 969 个 Go 服务上,64 worker 下相对标准库 RTA 中位加速超 116×、峰值 268×,最昂贵图构建步骤从 40 分钟降至 15 秒内,已用于 Uber CI。

问题
RTA 的核心子类型查询——具体类型 C 是否实现接口 I——在名义子类型下可常数时间解决,但在结构子类型(如 Go)下子类型关系隐式,需比较方法集合;RTA 增量发现类型的朴素做法需 O(|C|×|I|) 次 implements 检查,拖慢大型程序调用图构建。
方法
Kumo 采用两种技术:一是利用结构子类型的必要条件(匹配类型至少共享一个方法名)构建专用方法索引,将每次 implements 检查限制在少量候选类型,使检查次数实践中接近线性;二是并行化 RTA 的不动点迭代,通过微妙的事件排序保证正确性,并用细粒度同步实现可扩展性。
评估
在 Uber 的 969 个 Go 服务工业语料上与 Go 标准库未修改的 RTA 对比;使用 64 个 worker 时中位加速超过 116×、峰值达 268×,大规模程序上最昂贵的图构建步骤从 40 分钟降至 15 秒以内;Kumo 已部署于 Uber 的 CI 系统,对每次代码 diff 运行。
原文摘要(Abstract)

Rapid Type Analysis (RTA) is an important algorithm used in constructing whole-program call graphs. RTA occupies a special middle ground between precision and speed, making it an algorithm of choice for many industry-scale downstream program analysis tasks. RTA’s core subtyping query, which asks whether a concrete type 𝐶 implements an interface 𝐼, is cheap under nominal subtyping: the implements relation is syntactically expressed and hence resolved in constant time. Under structural subtyping, however, the hierarchy is implicit and must be computed by comparing method sets. RTA discovers types incrementally during its fixed-point iteration, and the naive approach checks each newly discovered concrete type (interface type) against all known interface types (concrete types) so far. The resulting analysis performs a number of “implements” calls equal to the product of the total number of concrete (|𝐶|) and interface (|𝐼|) types (𝑂(|𝐶|×|𝐼|)). For large programs in languages with structural subtyping, such as Go, the RTA algorithm is less effective at rapidly finding these relationships, slowing call graph construction. We present Kumo, an improvement to the RTA algorithm that addresses its weaknesses in structurally typed languages. With Kumo, we solve the aforementioned problem with two techniques: first, we reduce the work overhead of discovering subtypes using a purpose-built method index technique, and second, we efficiently parallelize the algorithm to achieve high speedups. The method index exploits a necessary condition of structural subtyping—matching types must share at least one method name—to restrict each implements check to a small set of plausible candidates, reducing the check count to near-linear in practice. The parallelization exploits the fixed-point iteration of RTA while guaranteeing correctness via a subtle event ordering; fine-grained synchronization ensures scalability. We evaluate Kumo on an industrial corpus of 969 Go services at Uber. Relative to Go’s unmodified standard-library RTA, Kumo achieves a median speedup exceeding 116×with peaks reaching 268×, using 64 workers. Kumo is being used in Uber’s CI systems on every code diff, and the speedups translate to reducing the most expensive graph construction step from 40 minutes to under 15 seconds using 64 parallel workers on large programs. While evaluated on Go, the technique applies to any language with structural subtyping.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot12129,
  title = {Beyond Nominality: Faster Rapid Type Analysis in the Presence of Structural Subtyping},
  author = {Elton Pinto and Milind Chabbi},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA2},
  year = {2026},
  doi = {10.1145/3839455}
}