S yn F ix: Dependency-Aware Program Repair via R elation G raph Analysis (2025)

Abstract: Recent advancements in large language models (LLMs) have significantly improved software development automation, including bug localization, code synthesis, program repair, and test generation. However, most prior work on program repair focuses on isolated elements, such as classes or functions, neglecting their interdependencies, which limits repair accuracy. We present SynFix, a RelationGraph-based approach that integrates LLMs with structural search and synchronization techniques for coordinated program repair across codebases. SynFix constructs a RelationGraph to capture relationships among classes, functions, variables, and their interactions (e.g., imports, inheritance, dependencies). Each RelationGraph node includes detailed code descriptions to help LLMs understand root causes and retrieve relevant contexts. By analyzing one-hop nodes in the RelationGraph, SynFixensures repairs account for dependent updates across components. Patch validation is conducted using regression tests from the SWE-bench benchmark suite. Evaluated on SWE-bench datasets, SynFix resolves 52.33% of issues in SWE-bench-lite (300 GitHub issues), 55.8% in SWE-bench-verified (500 issues), and 29.86% in SWE-bench-full (2,294 issues), outperforming baselines such as Swe-Agent, Agentless and AutoCodeRover. The codebase is available at https://anonymous.4open.science/r/AutoFix-EC86/ .

## introduction large language models (llms) have reshaped software engineering by automating diverse tasks such as bug localization, program repair, and test generation @xcite @xcite . however, applying llms to repository-level debugging still presents significant challenges. although existing methods do well at resolving isolated issues, they often fail to capture the broader context of repository-wide dependencies between files, classes, and functions @xcite . repository-level tasks are inherently difficult as they involve complex interactions across components that require a holistic understanding of the codebase. traditional approaches struggle to address these challenges, often leading to partial or suboptimal fixes. consequently, there is a pressing need for solutions that can effectively model and address the interconnected nature of large-scale codebases. to bridge this gap, benchmarks like swe-bench and its subset swebenchlite @xcite evaluate real-world software development tasks. swe-bench includes issues from open-source repositories, testing tools on challenges such as multi-file dependencies, parameter synchronization, and regression testing. swe-bench lite focuses on bug-fixing in a controlled setting. these benchmarks reveal current limitations and help develop scalable debugging solutions. agent-based systems have been proposed to address these repository-level challenges by equipping llms with toolsets for iterative decisionmaking @xcite . these systems enable llms to autonomously decide on actions, perform operations like file edits or test executions, and iteratively refine their solutions based on feedback. while promising in theory, agent-based approaches face key limitations in practice; for example, the complexity of tool usage often introduces abstraction layers that are prone to errors, especially when mapping actions to apis @xcite . moreover, the lack of robust planning mechanisms means that agents frequently make suboptimal decisions, leading to inefficiencies and unnecessary costs @xcite . the iterative, multi-turn nature of these methods exacerbates these issues, as incorrect decisions in early stages can cascade into larger problems, significantly hindering performance @xcite . furthermore, their limited ability to self-reflect and filter irrelevant or incorrect feedback amplifies these challenges, making agent-based systems less reliable for large-scale debugging tasks. to address these limitations, we propose syn-fix, including four-phase modules: relationgraph, localization, synchrony, and patch validation. synfix shifts the focus from iterative exploration to structured, deterministic processes that explicitly model the structural relationships within a codebase. central to synfix is the relationgraph, which captures dependencies among files foot_0 , functions, variables, and classes, enabling a comprehensive understanding of the codebase. this representation ensures that fixes in one part of the codebase are propagated correctly across related components, maintaining repository-wide consistency. by leveraging the relationgraph, synfix systematically localizes issues, identifies affected contexts, and synchronizes repairs to address interdependencies effectively. unlike agent-based systems, synfix avoids uncontrolled exploration, ensuring that each repair step is precise and well-informed. in the relationgraph phase, synfix models the structural dependencies in the codebase. during the localization phase, it uses this framework to identify suspicious files, classes, and specific lines of code. synchrony ensures that fixes propagate correctly across interconnected components, while paired patch validation rigorously tests the patches using regression suites to ensure correctness and compatibility with existing functionality. this deterministic and interpretable design eliminates the inefficiencies of agent-based systems, offering a costeffective solution for real-world software debugging. synfix has demonstrated exceptional performance on swe-bench benchmarks (swe, 2024), achieving state-of-the-art results while maintaining scalability and reliability. its success highlights the potential of structured, agentless approaches to set new standards for efficient, repository-level program repair. ## methodology figure 2 presents an overview of synfix, which operates in four main phases: relationgraph ( 1 ), localization ( 2 ), synchrony ( 3 ), and patch validation ( 4 , 5 , 6 , 7 , and 8 ). given a problem statement and an existing codebase as inputs, synfix proceeds as follows. 1 first, synfix constructs a relationgraph from the input codebase, capturing its hierarchical structure, variables, classes, functions, and their calling relationships. 2 next, using both the relationgraph and the problem statement, synfix prompts a low-cost llm (e.g., gpt-3.5) to identify and rank the top n most suspicious nodes that may require edits to address the issue. these nodes are presented with their surrounding context-such as the corresponding function, class, or code variable line. to the llm. the model refines and narrows down the potential edit locations (e.g., specific lines) for both dynamic and static process. this step ensures that the final chosen edit points are as accurate as possible. 5 in the repair phase, synfix presents the problem statement and the identified edit locations to the llm. the model is then prompted to propose patches aimed at resolving the identified issues. 6 once patches are generated, synfix attempts to apply them to the original codebase. if a patch cannot be cleanly applied, the process returns to the previous step 4 , repeating for a preconfigured number of iterations. 7 if the patch application is successful, synfix validates the updated codebase by running regression tests. if these tests pass, the patch is considered successful. 8 finally, synfix updates the relationgraph to reflect the changes in the codebase, ensuring that subsequent iterations start from an accurate and upto-date state. the following sections provide a more detailed explanation of each phase within synfix. ## conclusion synfix addresses the challenges of repositorylevel program repair with a relationgraph and synchronous approach. its four-phase pipeline: re-lationgraph, localization, synchrony, and paired patch validation-enables precise issue localization, consistent synchronization of changes, and thorough validation to ensure repository integrity. by leveraging the relationgraph representation, synfix effectively captures code dependencies, enabling it to handle multi-file and cross-module interactions that are common in real-world codebases. this representation not only ensures that fixes are accurate and localized but also helps maintain consistency across interdependent components of the repository. we evaluate our experiments across all versions of swe-bench datasets