Compiler technologies in deep learning and domain-specific hardware acceleration are increasingly adopting extensible compiler frameworks such as Multi-Level Intermediate Representation (MLIR) to facilitate more efficient development. With MLIR, compiler developers can easily define their own custom IRs in the form of MLIR dialects. However, the diversity and rapid evolution of such custom IRs make it impractical to manually write a custom test generator for each dialect. To address this problem, we design a new test generator called SYNTHFUZZ that combines grammar-based fuzzing with custom mutation synthesis. The key essence of SYNTHFUZZ is two fold: (1) It automatically infers parameterized context-dependent custom mutations from existing test cases. (2) It then concretizes the mutation's content depending on the target context and reduces the chance of inserting invalid edits by performing k-ancestor and pre(post)fix matching. SYNTHFUZZ obviates the need to manually define custom mutation operators for each dialect. We compare SYNTHFUZZ to three baselines: Grammarinator, MLIRSmith, and NeuRI. We conduct this comprehensive comparison on four different MLIR projects. Each project defines a new set of MLIR dialects where manually writing a custom test generator would take weeks of effort. Our evaluation shows that SYNTHFUZZ on average improves MLIR dialect pair coverage by 1.75 times, which increases branch coverage by 1.22 times. Further, we show that our context dependent custom mutation increases the proportion of valid tests by up to 1.11 times, indicating that SYNTHFUZZ correctly concretizes its parameterized mutations with respect to the target context. Parameterization of the mutations reduces the fraction of tests violating the base MLIR constraints by 0.57 times, increasing the time spent fuzzing dialect-specific code.
Interleaved Learning and Exploration: A Self-Adaptive Fuzz Testing Framework for MLIR
Institute of Software Chinese Academy of Sciences Beijing, China;College of Intelligence;Computing Tianjin University Tianjin, China;Shanghai Key Laboratory of Trustworthy Computing East China Normal University Shanghai, China
CLIR: Liveness-Driven and Structure-Aware Fuzzing for the Cranelift Compiler
Beijing University of Posts and Telecommunications(北京邮电大学);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));Peking University(北京大学);The Hong Kong Polytechnic University(香港理工大学);Huazhong University of Science and Technology(华中科技大学)
FeatureFuzz: Treating Bug-prone Features as Core Primitives for Compiler Fuzzing
State Key Laboratory of Novel Software Technology, Nanjing University(南京大学软件新技术国家重点实验室);Institute of Dataspace, Hefei Comprehensive National Science Center(合肥综合性国家科学中心数据空间研究所);Honor Device Co., Ltd(荣耀终端有限公司)
Pattern-Guided Graph Synthesis for Suppressing Known Defects in DL Compiler Fuzzing
School of Computer Science and Engineering, Nanjing University of Science and Technology(南京理工大学计算机科学与工程学院);Department of Computer Science, Xidian University(西安电子科技大学计算机科学与技术学院);School of Computer Science, Wuhan University(武汉大学计算机学院)