用于严格测试的Skeleton程序枚举
Skeletal Program Enumeration for Rigorous Compiler Testing
摘要:
一个程序可以被看作是一个由标识符V(变量名)的集合参数化的语法结构P(语法骨架)。本文介绍了骨架程序枚举(SPE)问题:给定一个固定的语法骨架P和一组变量V,枚举一组程序P,展示P中所有可能的变量使用模式。(1)具有不同变量使用模式的程序表现出不同的控制和数据依赖信息,并有助于利用不同的编译器优化和压力测试编译器;(2)大多数真正的编译器错误都是通过小测试揭示的(即,small-sized P)-这种“小范围”的观察为实际的编译器验证打开了SPE;(3)SPE是详尽的w.r.t.一个给定的语法框架和变量集,从而可以提供一个保证的水平,是从所有现有的编译器测试技术缺席。SPE的关键挑战是如何消除w.r.t.中大量的等价程序。$α$ -转换。我们的主要技术贡献是一种新的算法计算规范(和最小)的所有非$α$等效程序。我们已经实现了我们的SPE技术,并使用来自GCC的测试套件的语法骨架进行评估。我们对GCC和Clang的测试结果非常有希望。在不到六个月的时间里,我们的方法已经导致了217个确认的错误报告,其中104个已经被修复,并且大多数都是长期潜伏的错误,尽管之前已经进行了大量的自动测试两个编译器(例如,Csmith和EMI)。结果还表明,我们的算法枚举非$α$等效程序提供了六个数量级的减少,使处理GCC测试套件在一个月内。
英文摘要:
A program can be viewed as a syntactic structure P (syntactic skeleton) parameterized by a collection of the identifiers V (variable names). This paper introduces the skeletal program enumeration (SPE) problem: Given a fixed syntactic skeleton P and a set of variables V , enumerate a set of programs P exhibiting all possible variable usage patterns within P. It proposes an effective realization of SPE for systematic, rigorous compiler testing by leveraging three important observations: (1) Programs with different variable usage patterns exhibit diverse control- and data-dependence information, and help exploit different compiler optimizations and stress-test compilers; (2) most real compiler bugs were revealed by small tests (i.e., small-sized P) --- this "small-scope" observation opens up SPE for practical compiler validation; and (3) SPE is exhaustive w.r.t. a given syntactic skeleton and variable set, and thus can offer a level of guarantee that is absent from all existing compiler testing techniques. The key challenge of SPE is how to eliminate the enormous amount of equivalent programs w.r.t. $α$-conversion. Our main technical contribution is a novel algorithm for computing the canonical (and smallest) set of all non-$α$-equivalent programs. We have realized our SPE technique and evaluated it using syntactic skeletons derived from GCC's testsuite. Our evaluation results on testing GCC and Clang are extremely promising. In less than six months, our approach has led to 217 confirmed bug reports, 104 of which have already been fixed, and the majority are long latent bugs despite the extensive prior efforts of automatically testing both compilers (e.g., Csmith and EMI). The results also show that our algorithm for enumerating non-$α$-equivalent programs provides six orders of magnitude reduction, enabling processing the GCC test-suite in under a month.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。