MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair

Generative AI & LLMs
Published: arXiv: 2509.16187v1
Authors

Ali Reza Ibrahimzada Brandon Paulsen Reyhaneh Jabbarvand Joey Dodds Daniel Kroening

Abstract

Code translation transforms source code from one programming language (PL) to another. Validating the functional equivalence of translation and repairing, if necessary, are critical steps in code translation. Existing automated validation and repair approaches struggle to generalize to many PLs due to high engineering overhead, and they rely on existing and often inadequate test suites, which results in false claims of equivalence and ineffective translation repair. We develop MatchFixAgent, a large language model (LLM)-based, PL-agnostic framework for equivalence validation and repair of translations. MatchFixAgent features a multi-agent architecture that divides equivalence validation into several sub-tasks to ensure thorough and consistent semantic analysis of the translation. Then it feeds this analysis to test agent to write and execute tests. Upon observing a test failure, the repair agent attempts to fix the translation bug. The final (in)equivalence decision is made by the verdict agent, considering semantic analyses and test execution results. We compare MatchFixAgent's validation and repair results with four repository-level code translation techniques. We use 2,219 translation pairs from their artifacts, which cover 6 PL pairs, and are collected from 24 GitHub projects totaling over 900K lines of code. Our results demonstrate that MatchFixAgent produces (in)equivalence verdicts for 99.2% of translation pairs, with the same equivalence validation result as prior work on 72.8% of them. When MatchFixAgent's result disagrees with prior work, we find that 60.7% of the time MatchFixAgent's result is actually correct. In addition, we show that MatchFixAgent can repair 50.6% of inequivalent translation, compared to prior work's 18.5%. This demonstrates that MatchFixAgent is far more adaptable to many PL pairs than prior work, while producing highly accurate validation results.

Paper Summary

Problem
Code translation, the process of converting source code from one programming language (PL) to another, is a crucial step in software modernization efforts. However, translating code manually, especially for large codebases, can be tedious, time-consuming, and error-prone. This problem is further complicated by the complexity of code structures and dependencies involved.
Key Innovation
The researchers present MatchFixAgent, a novel language-agnostic framework for equivalence validation and repair of translations. MatchFixAgent combines the power of program analysis and large language model (LLM) agents to systematically generate targeted tests, enabling the demonstration of functional equivalence or detection of semantic bugs. This framework is designed to be cost-effective, scalable, and capable of supporting multiple programming languages.
Practical Impact
MatchFixAgent has the potential to revolutionize the code translation process by automating validation and repair tasks. This can save developers a significant amount of time and effort, reduce the likelihood of errors, and improve the overall quality of translated code. Additionally, MatchFixAgent can generate high-quality reports that can be used by end-users to better understand translated programs and the validation process.
Analogy / Intuitive Explanation
Think of MatchFixAgent as a quality control system for translated code. Just as a manufacturing quality control system checks for defects and ensures that products meet quality standards, MatchFixAgent checks for semantic bugs and ensures that translated code is functionally equivalent to the original code. This analogy highlights the importance of MatchFixAgent in ensuring the reliability and maintainability of translated code.
Paper Information
Categories:
cs.SE cs.LG
Published Date:

arXiv ID:

2509.16187v1

Quick Actions