Introduction
Software modernization often involves the massive undertaking of translating legacy codebases into modern programming languages. A primary challenge in this process is ensuring functional equivalence—guaranteeing that the translated code behaves identically to the original. Traditional automated translation tools are often limited by high engineering overhead for specific language pairs, inadequate test coverage, and brittle repair strategies that fail to account for repository-level dependencies.
Methodology: The MatchFixAgent Framework
MatchFixAgent addresses these bottlenecks through a "neuro-symbolic" multi-agent architecture. By leveraging Large Language Models (LLMs) alongside lightweight static analysis, the framework automates the validation and repair of code translations across diverse language pairs with minimal manual configuration.
Multi-Agent Pipeline
The system is structured around three core agents:
- Semantic Analyzer: This agent decomposes the complex task of equivalence checking into six specialized semantic dimensions: Control Flow, Data Flow, I/O Mapping, Library API usage, Exception Handling, and Formal Specifications. It utilizes the language-agnostic Tree-Sitter parser to extract code structures for LLM analysis.
- Test Generator & Repair Agent: Based on the semantic reports, this agent generates real-world test cases within a sandboxed environment. If discrepancies are found, it iteratively attempts to "patch" the target implementation.
- Verdict Agent: This agent acts as the final judge, synthesizing the results from the semantic analysis and test executions to provide a definitive verdict on functional equivalence.
Experimental Evaluation
The researchers evaluated MatchFixAgent using a comprehensive benchmark of 2,219 translation pairs sourced from 24 GitHub projects, totaling over 900,000 lines of code. The study covered six language combinations, including Go to Rust, Java to Python, and C to Rust.
Key Results and Insights
MatchFixAgent demonstrated significant improvements over state-of-the-art (SOTA) specialized tools:
- Verdict Coverage: The framework provided a definitive verdict for 99.2% of cases, significantly outperforming prior tools that often failed to produce results for up to 30% of the dataset.
- Repair Efficacy: MatchFixAgent successfully repaired 50.6% of identified translation bugs, nearly triple the 18.5% success rate of previous SOTA methods.
- Cost Efficiency: Due to its language-agnostic design, adding support for a new language pair requires only approximately 280 lines of code, making it 11.6x cheaper to maintain than manually-engineered systems.
Discussion and Future Work
The study highlights the power of task decomposition; breaking equivalence checking into specific semantic dimensions improved LLM accuracy by nearly 40%. However, challenges remain, such as occasional LLM hallucinations and the "infeasible input" problem, where agents identify bugs based on states that are unreachable in real-world execution. Future work will focus on deeper repository-level awareness to further refine accuracy and handle complex cross-file dependencies.
Conclusion
MatchFixAgent represents a significant step toward autonomous, language-agnostic software modernization. By combining structured semantic reasoning with multi-agent coordination, it provides a scalable and cost-effective solution for validating and repairing code translations at the repository level.
Summary updated