paperbot · PL 论文追踪

全部论文 待读 收藏

P2 An Interactive Debugger for Rust Trait Errors

面向 Rust trait 错误的交互式调试器
PLDI 9(PLDI)2025匹配度 2/10 · 该论文研究 Rust trait 类型推断失败的可视化调试工具,属于类型系统与开发者工具方向;但用户画像的核心是 LLM/Agent 与静态分析、浮点程序分析、贝叶斯程序分析的交叉,本文不涉及静态分析、LLM/Agent、浮点或贝叶斯方法,因此匹配度低。引用 1 inbox
Gavin Gray, Will Crichton, Shriram Krishnamurthi
crossref: 2026-09-10

AI 速览

一句话:Argus 将 Rust trait 推断失败的搜索树交互式可视化,按不同调试目标提供多视图,显著提升错误定位效率。

在支持类型类(trait)的语言中,类型推断失败时的编译器诊断往往晦涩甚至无用,因为推断过程中引入了复杂的搜索。Argus 将 trait 推断的搜索树交互式可视化,帮助程序员调试推断失败。其核心洞察是摒弃“一刀切”的诊断模式,针对不同调试目标(如定位冲突的 impl、追踪 obligation 的来源)提供不同视图;并通过界面默认值与启发式提升调试效率,例如默认不显示类型的完整路径、按预期修复复杂度对 obligation 排序。作者在真实 Rust 程序上开展 N=25 的用户研究,结果显示使用 Argus 的被试正确定位的故障数量是不使用时的 2.2 倍,定位速度提升 3.3 倍。

问题
类型类(如 Rust trait)推断失败时,编译器诊断信息往往难以理解、无助于定位问题,因为推断包含复杂的搜索过程。
方法
把诊断从“一刀切”改为多视图交互:Argus 可视化 trait 推断的搜索树,为不同调试目标提供不同视图,并用界面默认值与启发式(隐藏类型全路径、按修复复杂度排序 obligation)提升效率。
评估
以 N=25 的被试在真实 Rust 程序中调试类型推断失败的用户研究进行评估,使用 Argus 的被试正确定位的故障数达 2.2 倍,定位速度快 3.3 倍。
原文摘要(Abstract)

Compiler diagnostics for type inference failures are notoriously bad, and type classes only make the problem worse. By introducing a complex search process during inference, type classes can lead to wholly inscrutable or useless errors. We describe a system, Argus , for interactively visualizing type class inferences to help programmers debug inference failures, applied specifically to Rust’s trait system. The core insight of Argus is to avoid the traditional model of compiler diagnostics as one-size-fits-all, instead providing the programmer with different views on the search tree corresponding to different debugging goals. Argus carefully uses defaults to improve debugging productivity, including interface design (e.g., not showing full paths of types by default) and heuristics (e.g., sorting obligations based on the expected complexity of fixing them). We evaluated Argus in a user study where N = 25 participants debugged type inference failures in realistic Rust programs, finding that participants using Argus correctly localized 2.2× as many faults and localized 3.3× faster compared to not using Argus .

链接与引用

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

BibTeX
@article{paperbot3075,
  title = {An Interactive Debugger for Rust Trait Errors},
  author = {Gavin Gray and Will Crichton and Shriram Krishnamurthi},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729302}
}