Ratte: Fuzzing for Miscompilations in Multi-Level Compilers Using Composable Semantics
Pingshi Yu, Nicolas Wu, Alastair F. Donaldson
Abstract
Multi-level intermediate representation (MLIR) is a rapidly growing compiler framework, with its defining feature being an ecosystem of modular language fragments called dialects. Specifying dialect semantics and validating dialect implementations presents novel challenges, as existing techniques do not cater for the modularity and composability required by MLIR. We present Ratte, 1 a framework for specifying composable dialect semantics and modular dialect fuzzers. We introduce a novel technique for the development of semantics and fuzzers for MLIR dialects, enabling a harmonious cycle where the fuzzer validates the semantics via test-case generation, whilst at the same time the semantics allow the generation of high-quality test cases that are free from undefined behaviour. The composability of semantics and fuzzers allows generators to be cheaply derived to test combinations of dialects. We have used Ratte to find 6 previously-unknown miscompilation bugs in the production MLIR implementation. To our knowledge, Ratte is the first MLIR fuzzer capable of finding such bugs. Our work identified several aspects of the MLIR specification that were unclear, for which we proposed fixes that were adopted. Our technique provides composable reference interpreters for important MLIR dialects, validated against the production implementation, which can be used in future compiler development and testing research.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 58c233ba-5980-4f30-a263-cc604503bdddCited by top-tier papers3
- OBsmith: LLM-Powered JavaScript Obfuscator TestingShan Jiang, Chenguang Zhu, Sarfraz KhurshidOOPSLA 2026 · 2 citations
- Interleaved Learning and Exploration: A Self-Adaptive Fuzz Testing Framework for MLIRZeyu Sun, Jingjing Liang, Weiyi Wang, Chenyao Suo et al.ASE 2025 · 1 citation
- Finding Bugs in MLIR Compiler Infrastructure via Lowering Space ExplorationJingjing Liang, Shan Huang, Ting SuASE 2025
Builds on7
- Random testing for C and C++ compilers with YARPGenVsevolod Livinskii, Dmitry Babokin, John RegehrOOPSLA 2020 · 140 citations
- Fuzzing Loop Optimizations in Compilers for C++ and Data-Parallel LanguagesVsevolod Livinskii, Dmitry Babokin, John RegehrPLDI 2023 · 42 citations
- Test-case reduction and deduplication almost for free with transformation-based compiler testingAlastair F. Donaldson, Paul Thomson, Vasyl Teliman, Stefano Milizia et al.PLDI 2021 · 39 citations
- High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 citations
- Fuzzing MLIR Compiler Infrastructure via Operation Dependency AnalysisChenyao Suo, Junjie Chen, Shuang Liu, Jiajun Jiang et al.ISSTA 2024 · 12 citations
Related papers
- MLIRSmith: Random Program Generation for Fuzzing MLIR Compiler InfrastructureHaoyu Wang, Junjie Chen, Chuyue Xie, Shuang Liu et al.ASE 2023 · 16 citations
- First-Class Verification Dialects for MLIRMathieu Fehr, Yuyou Fan, Hugo Pompougnac, John Regehr et al.PLDI 2025 · 5 citations
- Fuzzing MLIR Compilers with Custom Mutation SynthesisBen Limpanukorn, Jiyuan Wang, Hong Jin Kang, Eric Zitong Zhou et al.ICSE 2025 · 3 citations
- Directed Testing in MLIR: Unleashing Its Potential by Overcoming the Limitations of Random FuzzingWeiyuan Tong, Zixu Wang, Zhanyong Tang, Jianbin Fang et al.FSE 2025 · 1 citation
- Finding Compiler Bugs through Cross-Language Code Generator and Differential TestingQiong Feng, Xiaotian Ma, Ziyuan Feng, Marat Akhin et al.OOPSLA 2025 · 2 citations
