ALPHAPROG: Reinforcement Generation of Valid Programs for Compiler Fuzzing


  • Xiaoting Li Pennsylvania State University
  • Xiao Liu Facebook Inc.
  • Lingwei Chen Wright State University
  • Rupesh Prajapati Pennsylvania State University
  • Dinghao Wu Pennsylvania State University



Compiler Fuzzing, Reinforcement Learning, Coverage-guided, BrainFuck


Fuzzing is a widely-used testing technique to assure software robustness. However, automatic generation of high-quality test suites is challenging, especially for software that takes in highly-structured inputs, such as the compilers. Compiler fuzzing remains difficult as generating tons of syntactically and semantically valid programs is not trivial. Most previous methods either depend on human-crafted grammars or heuristics to learn partial language patterns. They both suffer from the completeness issue that is a classic puzzle in software testing. To mitigate the problem, we propose a knowledge-guided reinforcement learning-based approach to generating valid programs for compiler fuzzing. We first design a naive learning model which evolves with the sequential mutation rewards provided by a target compiler we test. By iterating the training cycle, the model learns to generate valid programs that can improve the testing efficacy as well. We implement the proposed method into a tool called ALPHAPROG. We analyze the framework with four different reward functions and our study reveal the effectiveness of ALPHAPROG for compiler testing. We also reported two important bugs for a compiler production that were confirmed and addressed by the project owner, which further demonstrates ALPHAPROG's applied value in practice.




How to Cite

Li, X., Liu, X., Chen, L., Prajapati, R., & Wu, D. (2022). ALPHAPROG: Reinforcement Generation of Valid Programs for Compiler Fuzzing. Proceedings of the AAAI Conference on Artificial Intelligence, 36(11), 12559-12565.