Directed Testing in MLIR: Unleashing Its Potential by Overcoming the Limitations of Random Fuzzing
Abstract
MLIR is a new way of creating compiler infrastructures that can be easily reused and extended. Current MLIR fuzzing methods focus primarily on test case generation or mutation using randomly selected passes. However, they often overlook the hierarchical structure of MLIR, resulting in inefficiencies in bug detection, especially for issues triggered by downstream dialects. Random testing lacks a focused approach to exploring the code space, resulting in wasted resources on normal components and overlooking bug-prone areas. To address these limitations, we introduce MLIRTracer, a top-down fuzzing approach that targets the highest level of MLIR programs (tosa IR) with a directed testing strategy. Our method systematically traverses the hierarchical code space of MLIR, from tosa IR to the lower levels, while prioritizing tests of bug-prone areas through directed exploration. MLIRTracer has successfully detected 73 bugs, with 61 already resolved by the MLIR developers.
BibTeX
@article{Tong-al:FSE25,
author = {Weiyuan Tong and
Zixu Wang and
Zhanyong Tang and
Jianbin Fang and
Yuqun Zhang and
Guixin Ye},
title = {Directed Testing in {MLIR:} Unleashing Its Potential by Overcoming the Limitations of Random Fuzzing},
journal = {{PACMSE}},
volume = {2},
number = {{FSE}},
pages = {2288--2310},
year = {2025},
}