NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TRAGIC: Test Oracle Generation for ISA Compliance Testing via Large Language Model

Zhihao Xu, Bixin Li, Xiaoning Du, Lulu Wang, Li Liao, Ying Zhou

Abstract

RISC-V is one of the latest Instruction Set Architectures (ISAs). It features an extremely modular and extensible design that makes it suitable for a variety of applications, from embedded systems to large computing systems. However, its inherent customizability and open nature also present challenges in terms of compliance and standardization. Traditionally, the validation relies on Spike as the reference simulator to generate compliance test oracles. Nevertheless, research has demonstrated that Spike may contain bugs, which may compromise the reliability of the generated test oracles. Therefore, developing new cross-validation methods has become increasingly important. To address this challenge, we propose TRAGIC, a method for generating compliance test oracles for RISC-V compliance testing based on Large Language Models (LLMs). Different from traditional software testing, ISA compliance testing demands a finer-grained multidimensional test oracle, including not only the program outputs but also the detailed program states, such as key registers and memory addresses. Furthermore, long instruction sequences frequently exceed the context limitations of LLMs, and direct reasoning under such conditions leads to a notable degradation in accuracy. Therefore, TRAGIC employs a hierarchical strategy with two key components. First, the Block Segmentation Component (BSC) decomposes complex test cases into manageable sub-tasks by analyzing the control flow and applying block slicing techniques. The segmentation both preserves the original program semantics and reduces the reasoning context, thereby enhancing inference accuracy. Second, the Graph of Inference Component (GIC) performs structured reasoning on these sub-tasks using explicitly designed Chain-of-Thought prompts. We utilize LLM to dynamically infer the output of each subtask and determine the next block to execute, continuing this iterative process until the entire task is completed. Meanwhile, key register and memory address tables are maintained and integrated into the final test oracle. By combining the BSC and the GIC, TRAGIC effectively mitigates the accuracy loss associated with long context information and enhances the accuracy of test oracle generation. TRAGIC passes evaluation on the official RISC-V compliance test suite with manually-written test cases. Furthermore, we also show that when integrated with automated test generation tools, our method found 6 bugs, 2 of which were previously unknown.
BibTeX
@article{xu2026tragic,
  author = {Zhihao Xu and Bixin Li and Xiaoning Du and Lulu Wang and Li Liao and Ying Zhou},
  title = {{TRAGIC: Test Oracle Generation for ISA Compliance Testing via Large Language Model}},
  journal = {IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.},
  year = {2026},
  doi = {10.1109/tcad.2025.3632771},
}

Loading related content...

Figure