Ratte: Fuzzing for miscompilations in multi-level compilers using composable semantics
Author(s)
Yu, Pinshi
Wu, Nicolas
Donaldson, Alastair
Type
Conference Paper
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.
Date Issued
2025-03-01
Date Acceptance
2025-01-28
Citation
ASPLOS '25: Proceedings of the 30th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, 2025, 2, pp.966-981
ISBN
9798400710797
Publisher
ACM
Start Page
966
End Page
981
Journal / Book Title
ASPLOS '25: Proceedings of the 30th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
Volume
2
Copyright Statement
© 2025 Copyright held by the owner/author(s). This work is licensed under a Creative Commons Attribution International 4.0 License (https://creativecommons.org/licenses/by/4.0/)
License URL
Identifier
10.1145/3676641.3716270
Source
30th ACM International Conference on Architectural Support for Programming Languages and Operating Systems
Subjects
CCS Concepts: • Software and its engineering → Interpreters
Compilers
Semantics Compiler testing
differential testing
fuzzing
composable semantics
MLIR ASPLOS '25, Rotterdam, Netherlands
Publication Status
Published
Start Date
2025-03-30
Finish Date
2025-04-03
Coverage Spatial
Rotterdam, The Netherlands
