一句话:提出 FLEX,用神经网络生成、扰动采样与反馈驱动增强循环自适应模糊测试 MLIR,发现大量新缺陷。
MLIR 已成为现代编译器框架的基础设施,但其自身正确性与鲁棒性难以保障。现有基于手工模板或规则变异的模糊测试方法难以生成足够多样且语义有效的测试用例,因而难以暴露 MLIR 复杂代码空间中深层的缺陷。本文提出 FLEX,一个面向 MLIR 的自适应模糊测试框架:它利用神经网络进行程序生成,采用扰动采样策略提升生成多样性,并设计反馈驱动的增强循环,迭代地使用崩溃与非崩溃测试用例改进生成模型,从而从有限种子语料出发逐步学习合法语法与语义并自主产生高质量测试输入。作者在上游 MLIR 编译器上与四个最先进模糊测试工具进行对比:30 天持续测试中发现 80 个此前未知的缺陷(含多个新根因与解析器缺陷);在 24 小时固定版本对比中检出的缺陷数是最佳基线的 3.5 倍以上,代码覆盖率达 28.2%,比次优工具高 42%;消融实验进一步证实扰动生成与多样性增强两个组件对效果的关键作用。
MLIR (Multi-Level Intermediate Representation) has rapidly become a foundational technology for modern compiler frameworks, enabling extensibility across diverse domains. However, ensuring the correctness and robustness of MLIR itself remains challenging. Existing fuzzing approaches—based on manually crafted templates or rule-based mutations—struggle to generate sufficiently diverse and semantically valid test cases, making it difficult to expose subtle or deep-seated bugs within MLIR’s complex and evolving code space. In this paper, we present FLEX, a novel self-adaptive fuzzing framework for MLIR. FLEX leverages neural networks for program generation, a perturbed sampling strategy to encourage diversity, and a feedback-driven augmentation loop that iteratively improves its model using both crashing and non-crashing test cases. Starting from a limited seed corpus, FLEX progressively learns valid syntax and semantics and autonomously produces high-quality test inputs. We evaluate FLEX on the upstream MLIR compiler against four state-of-the-art fuzzers. In a 30-day campaign, FLEX discovers 80 previously unknown bugs—including multiple new root causes and parser bugs—while in 24-hour fixed-revision comparisons, it detects 53× bugs (over 3.5 as many as the best baseline) and achieves 28.2% code coverage, outperforming the next-best tool by 42%. Ablation studies further confirm the critical role of both perturbed generation and diversity augmentation in FLEX’s effectiveness.
DOI 原文 ·
@inproceedings{paperbot9343,
title = {Interleaved Learning and Exploration: A Self-Adaptive Fuzz Testing Framework for MLIR},
author = {Zeyu Sun and Jingjing Liang and Weiyi Wang and Chenyao Suo and Junjie Chen and Fanjiang Xu},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00196}
}