# Stateful Testing for Deep Learning Compilers

arXiv: https://arxiv.org/abs/2610.22003 · HTML: https://mlsanity.com/paper/2610.22003/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 26 of its 55 references that are in the map.
- Submitted 15 Oct 2026.

## Builds on (most cited first, 26 of 26)

- [NNSmith: Generating Diverse and Valid Test Cases for Deep Learning Compilers](https://mlsanity.com/paper/2207.13066/) (2022)
- [On Correctness of Automatic Differentiation for Non-Differentiable Functions](https://mlsanity.com/paper/2006.06903/) (2020)
- [Coverage-Guided Tensor Compiler Fuzzing with Joint IR-Pass Mutation](https://mlsanity.com/paper/2202.09947/) (2022)
- [Fuzzing Deep Learning Compilers with HirGen](https://mlsanity.com/paper/2208.02193/) (2022)
- [NeuRI: Diversifying DNN Generation via Inductive Rule Inference](https://mlsanity.com/paper/2302.02261/) (2023)
- [Skeletal Program Enumeration for Rigorous Compiler Testing](https://mlsanity.com/paper/1610.03148/) (2016)
- [Fuzzing MLIR Compilers with Custom Mutation Synthesis](https://mlsanity.com/paper/2404.16947/) (2024)
- [Enhancing Differential Testing With LLMs For Testing Deep Learning Libraries](https://mlsanity.com/paper/2406.07944/) (2024)
- [TorchProbe: Fuzzing Dynamic Deep Learning Compilers](https://mlsanity.com/paper/2310.20078/) (2023)
- [Exo 2: Growing a Scheduling Language](https://mlsanity.com/paper/2411.07211/) (2024)
- [TensorRight: Automated Verification of Tensor Graph Rewrites](https://mlsanity.com/paper/2511.17838/) (2025)
- [On the Correctness of Automatic Differentiation for Neural Networks with Machine-Representable Parameters](https://mlsanity.com/paper/2301.13370/) (2023)
- [FTTN: Feature-Targeted Testing for Numerical Properties of NVIDIA & AMD Matrix Accelerators](https://mlsanity.com/paper/2403.00232/) (2024)
- [DESIL: Detecting Silent Bugs in MLIR Compiler Infrastructure](https://mlsanity.com/paper/2504.01379/) (2025)
- [Training with Mixed-Precision Floating-Point Assignments](https://mlsanity.com/paper/2301.13464/) (2023)
- [A Tale of Two DL Cities: When Library Tests Meet Compiler](https://mlsanity.com/paper/2407.16626/) (2024)
- [DevMuT: Testing Deep Learning Framework via Developer Expertise-Based Mutation](https://mlsanity.com/paper/2507.04360/) (2025)
- [Scalpel: Automotive Deep Learning Framework Testing via Assembling Model Components](https://mlsanity.com/paper/2510.21451/) (2025)
- [Testing Deep Learning Libraries via Neurosymbolic Constraint Learning](https://mlsanity.com/paper/2601.15493/) (2026)
- [Demystifying the Silence of Correctness Bugs in PyTorch Compiler](https://mlsanity.com/paper/2604.08720/) (2026)
- [Tools-CC-Bench: a Benchmark Suite for Collective Communication with Compression in HPC and AI Workloads](https://mlsanity.com/paper/2609.08739/) (2026)
- [Formal Semantics for the Halide Language](https://mlsanity.com/paper/2210.15740/) (2022)
- [Correctness Witness Validation by Abstract Interpretation](https://mlsanity.com/paper/2310.16572/) (2023)
- [Optimization-Aware Test Generation for Deep Learning Compilers](https://mlsanity.com/paper/2511.18918/) (2025)
- [TENSURE: Fuzzing Sparse Tensor Compilers (Registered Report)](https://mlsanity.com/paper/2603.18372/) (2026)
- [Grounding Deep Learning Framework Testing in Data Flow](https://mlsanity.com/paper/2610.15808/) (2026)

## Abstract (arXiv)

Modern deep learning compilers compile models lazily and cache artifacts across invocations. Retained compiler state can make a later invocation incorrect even when it is correct in isolation. An analysis of 26 publicly reported issues in PyTorch, JAX, and TensorFlow shows that detecting such bugs requires sequences that first establish compiler state and then expose a failure. We present Rondo, a stateful testing method that represents each test case as a model paired with an invocation sequence. Rondo mutates invocation sequences and uses a Markov chain Monte Carlo sampler guided by compilation behavior to favor rarely observed behaviors. Its three-way differential oracle compares execution without compilation, compiled execution with compiler state reset, and compiled execution with state retained. It confirms stateful bugs by replaying the same invocation with state retained and reset while preserving inputs and program state, then shortens sequences while preserving the original bug. We evaluate Rondo on four deep learning frameworks using 24 common model architectures. Rondo detects 117 bugs, including 35 stateful bugs. We submit 39 bug reports, including 18 for stateful bugs; developers confirm 35 reports, including 16 for stateful bugs, and fix 18 bugs, including 11 stateful bugs. Rondo achieves the highest behavior coverage and compiler Python source-line coverage among the compared methods, with 99.26% alarm precision. It shortens 44 of 117 invocation sequences, reducing the lengths of these 44 sequences by 83.34% on average.
