paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RustSmith: Random Differential Compiler Testing for Rust

RustSmith:面向 Rust 的随机差分编译器测试
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 2/10 · 该论文属于 Rust 编译器随机差分测试与程序生成,虽涉及 PL 和测试,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向,匹配度较低。引用 47 inbox
Mayank Sharma, Pingshi Yu, Alastair F. Donaldson
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出首个能为 Rust 编译器做端到端测试的随机程序生成器,支持差分测试并发现历史与未知缺陷。

Rust 编译器测试面临程序需满足所有权、借用与生命周期等复杂类型规则的难题,随机生成有效程序因此困难。本文提出 RustSmith,这是首个用于 Rust 编译器端到端测试的随机程序生成器。它生成符合 Rust 高级类型系统、遵守借用和生命周期规则、并保证具有良定义结果的程序,因而可用于不同编译器或不同优化级别之间的差分测试。作者将 RustSmith 应用于多个版本的官方编译器 rustc,检测出长期潜伏的历史 bug,并在另一实现 mrustc 中发现此前未知的 bug。受控实验还比较了 RustSmith 与 rustc 优化测试套件在语句覆盖和变异覆盖上的效果。

问题
如何随机生成满足 Rust 所有权、借用与生命周期规则且结果良定义的程序,以便对 Rust 编译器进行端到端差分测试。
方法
RustSmith 随机生成合规 Rust 程序,并在不同编译器或优化级别间进行差分测试。
评估
在多个 rustc 版本上检出历史 bug,在 mrustc 中发现未知 bug,并通过受控实验对比语句覆盖和变异覆盖。
原文摘要(Abstract)

We present RustSmith, the first Rust randomised program generator for end-to-end testing of Rust compilers. RustSmith generates programs that conform to the advanced type system of Rust, respecting rules related to borrowing and lifetimes, and that are guaranteed to yield a well-defined result. This makes RustSmith suitable for differential testing between compilers or across optimisation levels. By applying RustSmith to a series of versions of the official Rust compiler, rustc, we show that it can detect insidious historical bugs that evaded detection for some time. We have also used RustSmith to find previously-unknown bugs in an alternative Rust compiler implementation, mrustc. In a controlled experiment, we assess statement and mutation coverage achieved by RustSmith vs. the rustc optimisation test suite.

链接与引用

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

BibTeX
@inproceedings{SharmaYD23,
  title = {RustSmith: Random Differential Compiler Testing for Rust},
  author = {Mayank Sharma and Pingshi Yu and Alastair F. Donaldson},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3604919}
}