SWINGARENA: Adversarial Programming Arena for Long-context GitHub Issue Solving

Wendong XU (University of Hong Kong), Jing Xiong, Chenyang Zhao, Qiujiang Chen, Haoran Wang, Hui Shen, Zhongwei Wan, Jianbo Dai, Taiqiang Wu, He Xiao, Chaofan Tao, Zhuoqing Mao, Ying Sheng, Zhijiang Guo, Hongxia Yang, Bei Yu, Lingpeng Kong, Quanquan Gu, Ngai Wong

International Conference on Learning Representations 2026 · Oral

Overview

In this insightful talk, Wendong Xu from the University of Hong Kong introduced Swing Arena, a novel adversarial programming arena designed to rigorously evaluate AI agents in solving real-world GitHub issues. This collaborative work, involving numerous institutions, directly addresses critical shortcomings in existing code generation benchmarks. The core premise is that current evaluation methods, such as HumanEval and SWE-bench, are overly simplistic, focusing solely on an agent's ability to write code that passes a fixed set of tests. This approach fails to capture the complexity of the modern software development lifecycle, which inherently involves continuous integration (CI) pipelines, rigorous human code review, and the iterative process of fixing and re-testing.

Watch on SlidesLive

Visual summary for SWINGARENA: Adversarial Programming Arena for Long-context GitHub Issue Solving by Wendong XU, Jing Xiong, Chenyang Zhao, Qiujiang Chen, Haoran Wang, Hui Shen, Zhongwei Wan, Jianbo Dai, Taiqiang Wu, He Xiao, Chaofan Tao, Zhuoqing Mao, Ying Sheng, Zhijiang Guo, Hongxia Yang, Bei Yu, Lingpeng Kong, Quanquan Gu, Ngai Wong
Visual summary for SWINGARENA: Adversarial Programming Arena for Long-context GitHub Issue Solving by Wendong XU, Jing Xiong, Chenyang Zhao, Qiujiang Chen, Haoran Wang, Hui Shen, Zhongwei Wan, Jianbo Dai, Taiqiang Wu, He Xiao, Chaofan Tao, Zhuoqing Mao, Ying Sheng, Zhijiang Guo, Hongxia Yang, Bei Yu, Lingpeng Kong, Quanquan Gu, Ngai Wong

Key moments

  1. 0:00 Introduction: The gap in current coding agent benchmarks.
  2. 2:00 Swing Arena's three main contributions and protocol overview.
  3. 3:00 Detailed explanation of the adversarial battle rounds.
  4. 4:00 RACG: Intelligent code context retrieval pipeline.
  5. 7:00 Model performance results and cross-play insights.
  6. 8:00 Key takeaways: Writing and reviewing are distinct skills.
  7. 10:00 Future evolution of Swing Arena and dataset improvements.

SWINGARENA: Adversarial Programming Arena for Long-context GitHub Issue Solving

Speakers: Wendong XU (University of Hong Kong); Jing Xiong; Chenyang Zhao; Qiujiang Chen; Haoran Wang; Hui Shen; Zhongwei Wan; Jianbo Dai; Taiqiang Wu; He Xiao; Chaofan Tao; Zhuoqing Mao; Ying Sheng; Zhijiang Guo; Hongxia Yang; Bei Yu; Lingpeng Kong; Quanquan Gu; Ngai Wong

Conference: ICLR 2026

YouTube: https://slideslive.com/39062134

Overview

In this insightful talk, Wendong Xu from the University of Hong Kong introduced Swing Arena, a novel adversarial programming arena designed to rigorously evaluate AI agents in solving real-world GitHub issues. This collaborative work, involving numerous institutions, directly addresses critical shortcomings in existing code generation benchmarks. The core premise is that current evaluation methods, such as HumanEval and SWE-bench, are overly simplistic, focusing solely on an agent's ability to write code that passes a fixed set of tests. This approach fails to capture the complexity of the modern software development lifecycle, which inherently involves continuous integration (CI) pipelines, rigorous human code review, and the iterative process of fixing and re-testing.

Swing Arena revolutionizes AI code evaluation by introducing an adversarial battle protocol where AI agents assume dual roles: not only writing code patches but also acting as "reviewers" by crafting targeted tests to expose bugs in other agents' (or even their own) fixes. This dynamic, coupled with a sophisticated retrieval pipeline named RACG for managing long code contexts and a vast multi-language dataset of real GitHub issues, provides a much more realistic and challenging environment for assessing AI coding capabilities. The talk underscores the critical distinction between code writing and code reviewing as separate skills, highlighting how current benchmarks overlook this crucial aspect and how fixed test suites are easily "gameable" by AI models.

The significance of Swing Arena lies in its potential to push the boundaries of AI code generation research. By simulating a full CI pipeline and adversarial review, it sets a higher bar for code-solving agents, forcing them to produce more robust, production-ready code. For practitioners, it offers a more reliable metric for selecting and deploying AI tools, while for researchers, it provides a rich dataset and a challenging benchmark to develop next-generation coding assistants capable of navigating the intricacies of complex, multi-file codebases. The project's open-source nature further invites community collaboration, promising accelerated progress in this vital area of AI.

Background

▶ Watch: Introduction: The gap in current coding agent benchmarks. (0:00)

The landscape of AI-powered code generation has seen remarkable advancements, with large language models (LLMs) demonstrating impressive capabilities in writing code snippets, completing functions, and even generating entire programs. However, the methods used to evaluate these agents have largely remained static and, as highlighted in this presentation, increasingly inadequate for assessing real-world performance. Traditional benchmarks like HumanEval and SWE-bench typically present an agent with a problem description, expect a code patch, and then determine success based on whether that patch passes a predefined suite of unit tests. This pass/fail paradigm, while useful for initial sanity checks, falls short in several critical aspects when compared to the reality of professional software development.

The speaker emphasizes that real-world software development is an iterative and collaborative process. When a developer submits a pull request, the code doesn't immediately merge. Instead, it undergoes a rigorous Continuous Integration (CI) pipeline, which includes automated checks for builds, linting, testing, and security vulnerabilities. Following this, human code reviewers scrutinize the changes, testing edge cases, evaluating design choices, and often writing new, targeted tests to ensure the robustness and correctness of the patch. This cycle of review, feedback, and revision can repeat numerous times before a change is finally approved. Current benchmarks fail to replicate this comprehensive process, primarily focusing on a single "writing" phase and neglecting the crucial "checking" or "reviewing" phase.

This leads to two significant problems identified by the researchers. Firstly, the skills required for writing code are fundamentally different from those needed for reviewing or debugging code. An agent proficient at generating a solution might be poor at identifying subtle bugs or vulnerabilities in existing or newly written code. By only testing the "writer" role, existing benchmarks offer an incomplete picture of an agent's overall coding intelligence. The research found that swapping roles between writer and checker yielded vastly different performance results, underscoring this distinction. Secondly, fixed test suites, characteristic of current benchmarks, are susceptible to being "gamed." LLMs, through various training and fine-tuning techniques, can often find ways to pass these static tests without necessarily producing genuinely robust or correct code that handles all edge cases. In contrast, human reviewers dynamically create new, adversarial tests specifically designed to break a patch based on its actual implementation, a capability that fixed tests inherently lack. Addressing these limitations necessitates a benchmark that integrates both adversarial testing and a realistic CI environment, mirroring the challenges faced by human developers.

Key Findings

▶ Watch: Detailed explanation of the adversarial battle rounds. (3:00)

The Swing Arena project yielded several pivotal findings that challenge conventional wisdom in AI code generation evaluation and illuminate new directions for research and development. The core contributions and discoveries can be summarized as follows:

First and foremost, the research definitively demonstrates that writing code and reviewing code are distinct skills that single-agent benchmarks fail to capture. This was evidenced by the significant disparity between self-play scores (where an agent reviews its own code) and cross-play scores (where agents review each other's code). Models consistently achieved higher scores when reviewing their own patches, indicating "blind spots" that adversarial reviewers could exploit. For instance, Claude 3.5 Sonnet achieved a perfect 1.0 in self-play, yet its performance varied when facing external reviewers. This finding underscores the necessity of dual-role adversarial evaluation for a comprehensive assessment of AI coding agents.

Secondly, the study confirmed that fixed test suites are inadequate and miss bugs that a human reviewer, or an adversarial AI reviewer, would catch. The adversarial battle protocol, where one agent crafts tests specifically to break another's patch, proved effective in uncovering vulnerabilities and incorrect logic that would typically pass static, pre-defined tests. This highlights the value of dynamic, targeted test generation as a critical component of robust code evaluation.

Thirdly, the research revealed variations in model performance across different programming languages and problem complexities. While some models, like DeepSeek-V3, showed strong average performance across languages, others like Rust and Python were consistently identified as the hardest languages for agents to tackle. This suggests that language-specific nuances and ecosystem complexities play a significant role in an agent's success, necessitating multi-language benchmarks.

A crucial technical finding was the effectiveness of the RACG retrieval pipeline. This pipeline, designed to intelligently find and pack relevant code context for long-context GitHub issues, significantly boosted performance. It achieved a 135x higher hit rate compared to simple file-level search and led to a 3% to 13% higher win rate in every language tested. This confirms that for real-world codebases, which can span tens of thousands of tokens across multiple files, smart context retrieval is not merely helpful but absolutely essential for models to perform effectively.

Finally, the project provided a valuable large-scale, multi-language dataset of over 2,300 GitHub issues (with 400 for evaluation), all verified by CI pipelines and human experts. This dataset, coupled with the open-sourced Swing Arena protocol and tools, establishes a new, higher standard for evaluating AI coding agents, moving beyond simplistic pass/fail metrics to a more holistic assessment of their ability to survive a full CI pipeline and adversarial review.

Technical Deep Dive

▶ Watch: RACG: Intelligent code context retrieval pipeline. (4:00)

The technical innovations underpinning Swing Arena are multifaceted, encompassing a novel adversarial battle protocol, an intelligent context retrieval pipeline, and a robust dataset construction methodology. These components collectively create a more realistic and challenging environment for evaluating AI code generation.

The Adversarial Battle Protocol is the heart of Swing Arena's evaluation framework. It simulates a dynamic, multi-round interaction between two AI agents, each taking on alternating roles as a patch writer and a test writer. The battle unfolds over a total of rounds, with each agent receiving five turns in each role.

When acting as the patch writer, an agent receives a GitHub issue description and is tasked with generating a code fix (patch). This patch is then submitted to a comprehensive Continuous Integration (CI) pipeline, which includes the repository's original tests and, crucially, any new, adversarial tests crafted by the test writer. The patch writer scores +1 if their patch passes all tests (both original and adversarial) and -1 if any test fails.

When an agent takes on the role of the test writer, it observes the code changes introduced by the patch writer. Its objective is to craft new tests specifically designed to expose bugs or vulnerabilities in the submitted patch. The test writer scores +1 if their newly written test successfully breaks the patch, indicating a genuine bug. Conversely, if their test also fails when run against the correct human-provided fix for the issue, it scores -1, signifying a poorly constructed or incorrect test. This mechanism incentivizes the test writer to produce valid, targeted tests.

To ensure fairness and maintain the integrity of the adversarial process, five strict rules govern the test writer: (1) their test must pass on the correct human patch, (2) it cannot modify any source code outside the test files, (3) the edit size is limited to prevent overly broad or irrelevant changes, (4) no flaky or timing-based tests are allowed, and (5) the test must adhere to the repository's established coding style. Any violation results in the test being discarded. All interactions and code executions are performed within Docker containers with pinned images, ensuring a deterministic and reproducible environment. Furthermore, model prompts are fixed, temperature is set to zero, and seeds are kept constant across runs to minimize stochasticity.

A critical component for handling the long-context nature of real-world GitHub issues is the RACG (Retrieval, Chunking, Reranking, Packing) pipeline. Real codebases often involve 8,000 to 54,000 tokens of context spread across numerous files, far exceeding the context windows of many LLMs. RACG intelligently curates the most relevant code snippets for the model, overcoming limitations of prior tools that often only supported Python or relied on simplistic file-level search. The pipeline operates in four sequential steps:

  1. File Retriever: This initial step employs keyword matching to identify and retrieve the most relevant files from the codebase based on the issue description.
  2. Code Chunker: The retrieved files are then broken down into meaningful, smaller units such as functions, classes, and code blocks. This is achieved using language-specific parsers based on abstract syntax trees (ASTs), with regular expressions serving as a backup for less structured code or unsupported languages. Crucially, this class-level chunking was found to achieve a 135 times higher hit rate compared to simple file-level search.
  3. Code Reranker: Each code chunk is then scored for its relevance to the GitHub issue using CodeBERT, a pre-trained model for natural language and code. The reranker prioritizes definitions over mere usages across files, ensuring that the most informative parts of the codebase are emphasized.
  4. Token Budget Packing: Finally, the highest-ranking code chunks are selected and packed into the model's context window, respecting its token limit. This packing process also includes adding file paths and line numbers to each chunk, providing essential metadata for the LLM. The entire RACG pipeline is designed to be deterministic and fully reproducible.

The Multi-CI System aspect of Swing Arena refers to its capability to support various programming languages and their respective CI environments. The dataset includes issues across multiple languages (e.g., C, Python, Rust, Java), each requiring specific build tools, testing frameworks, and linting configurations within the Dockerized environment. This multi-language support ensures that the benchmark is comprehensive and applicable to diverse software development scenarios.

Experimental Setup & Results

▶ Watch: Key takeaways: Writing and reviewing are distinct skills. (8:00)

The experimental evaluation of Swing Arena involved a meticulously constructed dataset, a diverse set of state-of-the-art language models, and a suite of metrics designed to capture the nuances of adversarial code generation and review.

The dataset for Swing Arena was built through a four-step process. First, high-quality repositories were mined from GitHub across four distinct programming languages: C, Python, Rust, and Java. Second, only issues where all initial CI checks passed were retained, ensuring a baseline of correctness and avoiding already broken code. Third, an LLM was employed to score the clarity and difficulty of each issue description, aiding in selection. Fourth, a team of 12 human experts, primarily PhD students and postdocs, meticulously reviewed and filtered the final set of issues, verifying their quality and suitability. The resulting dataset comprises over 2,300 issue-patch pairs, with 400 issues reserved for evaluation (100 per language, plus an additional 100 for ablation studies). A defining characteristic of these issues is the sheer volume of relevant code context: it is typically 10 to 200 times larger than the problem description itself, with C issues, for example, averaging 54,000 tokens of context. This highlights the critical need for sophisticated context retrieval.

For evaluating performance, the researchers tested a combination of prominent closed-source models and emerging open-source models. The closed-source models included GPT-4o, Claude 3.5 Sonnet, Gemini 2.0 Flash, and DeepSeek-V3. While not explicitly named, the open-source models mentioned in the results included Qwen-Coder (7B parameters) and Qwen-14B. All models were subjected to the same experimental conditions: a fixed token budget for context, a temperature setting of zero for deterministic output, and fixed seeds.

The evaluation metrics focused on capturing both writing and reviewing proficiency:

  • Submitter Pass Rate: The percentage of times the patch writer's code successfully passed all tests (repo's own and reviewer's new tests).
  • Reviewer Pass Rate: The percentage of times the test writer's adversarial tests successfully broke a patch.
  • Win Rate: The overall success rate in the adversarial battle protocol.
  • Pass@k: While mentioned as a metric, its specific application beyond general pass rates was not detailed, but it generally refers to the probability of passing tests within k attempts.

The headline results provided compelling insights:

  • Closed-Source Model Performance: GPT-4o emerged as the strongest patch writer, achieving a 0.9 or higher win rate against every reviewer agent. Claude 3.5 Sonnet demonstrated a perfect 1.0 win rate in self-play, indicating its ability to pass its own generated tests, but this score often dropped in cross-play scenarios. DeepSeek-V3 showed the best CI pass rate at 0.66. A critical observation was that self-play scores were consistently higher than cross-play scores across all models, empirically confirming that writing and reviewing are distinct skills.
  • Open-Source Model Performance: Open-source models are rapidly catching up. The Qwen-Coder (7B parameters) achieved an impressive 0.9 win rate, and Qwen-14B reached 0.95. While their CI pass rates were close, they generally lagged behind the larger closed-source models in overall performance.
  • Impact of RACG: The RACG retrieval pipeline demonstrated a substantial performance boost. It led to a 3% to 13% higher win rate across every programming language compared to simple file-level search. Specifically, RACG improved the win rate from 0.62 to 0.84, showcasing its critical role in enabling models to handle long-context issues effectively. The heatmap analysis further showed that C and Rust issues utilized the most tokens, underscoring why smart context packing is particularly vital for these languages.
  • Language Difficulty and Model Personalities: DeepSeek-V3 led with the best average score of 0.59 across languages, with Rust and Python identified as the most challenging. The models also exhibited distinct "personalities": GPT-4o was the strongest writer but a weaker reviewer, DeepSeek-V3 and Gemini 2.0 were tougher reviewers, and Claude 3.5 Sonnet was the most balanced.
  • Scaling Patterns: The Pass@k curves indicated that performance gains tended to slow down after approximately five tries under the Swing Arena protocol, suggesting a clear scaling pattern.

The speaker also candidly noted during the Q&A that the benchmark results were "outdated" (about a year old), implying that newer models (like the latest GPT-4o) might exhibit even greater capabilities, and that future iterations of the dataset would focus on higher quality and more rigorously verified difficulty levels to ensure an even more challenging evaluation environment.

Practical Implications

▶ Watch: Future evolution of Swing Arena and dataset improvements. (10:00)

The introduction of Swing Arena carries profound practical implications for various stakeholders within the AI and software development ecosystems, from model builders to infrastructure teams. Its novel approach to evaluation provides a more realistic lens through which to view the capabilities and limitations of AI coding agents, driving the development of more robust and trustworthy systems.

For practitioners and model builders, the most significant takeaway is the necessity of moving beyond simplistic pass/fail metrics. Swing Arena unequivocally demonstrates that code writing and code reviewing are distinct skills. This implies that AI agents designed for code generation should not only be optimized for producing correct code but also for critically assessing and debugging code, potentially even their own. Developers building AI assistants need to consider training models that can generate adversarial tests or identify edge cases, rather than merely passing a predefined test suite. The benchmark highlights that models exhibit different "personalities"—some are excellent writers but poor reviewers, and vice versa. This insight can guide the selection of models for specific tasks: a model strong in writing might be paired with another strong in reviewing for a more comprehensive solution.

Infrastructure teams responsible for CI/CD pipelines and deployment strategies will find that Swing Arena validates the importance of their work in evaluating AI-generated code. The benchmark's reliance on real CI pipelines underscores that AI-generated patches must survive the same rigorous automated checks (builds, linting, security, tests) as human-written code. For deploying AI code agents, robust, Dockerized environments that ensure reproducibility and consistency are paramount. Furthermore, the challenges posed by long-context codebases emphasize the need for efficient and intelligent context management within AI infrastructure, potentially leveraging techniques similar to RACG.

For model deployers and organizations integrating AI into their development workflows, Swing Arena offers a more reliable framework for assessing the trustworthiness and quality of AI-generated code. The benchmark reveals models' "blind spots," where they perform well in self-evaluation but fail under adversarial scrutiny. This knowledge is crucial for setting realistic expectations and implementing appropriate human-in-the-loop oversight. Deploying an AI agent as a primary code generator without a robust adversarial review mechanism (either human or AI-powered) could lead to the introduction of subtle, hard-to-find bugs into production systems.

Tradeoffs and limitations are also illuminated by Swing Arena. While powerful, the adversarial nature can be computationally intensive, requiring significant resources to run numerous battles across diverse models and languages. The speaker's admission that the benchmark results were "outdated" and that the dataset still requires further human verification for difficulty and quality points to the ongoing challenges in curating truly representative and challenging real-world data for such complex tasks. Furthermore, while RACG significantly improves context retrieval, the inherent limitations of LLM context windows mean that even the most advanced retrieval methods cannot perfectly capture every nuance of an extremely large, interconnected codebase. This suggests a continuing need for models with larger effective context windows or even more sophisticated reasoning capabilities over retrieved chunks. Ultimately, Swing Arena pushes the industry towards developing AI agents that are not just code generators but truly intelligent software collaborators capable of participating in the full, complex cycle of software development.

Key Takeaways

  • Adversarial Evaluation is Crucial: Traditional benchmarks are insufficient; evaluating AI code agents requires adversarial testing within a realistic Continuous Integration (CI) pipeline to expose true vulnerabilities and ensure robust code.
  • Writing and Reviewing are Distinct Skills: AI models exhibit different proficiencies as code writers versus code reviewers. Benchmarks must assess both roles to provide a comprehensive understanding of an agent's capabilities, as self-play metrics can be misleading.
  • Context Retrieval is Paramount for Real-World Code: For long-context, multi-file GitHub issues, intelligent code context retrieval (like the RACG pipeline) is essential. Simple file-level search is inadequate, while sophisticated chunking, reranking, and packing significantly boost performance.
  • Model Personalities Exist: Different LLMs demonstrate unique strengths; some excel as code writers (e.g., GPT-4o), others as tough reviewers (e.g., DeepSeek-V3), and some achieve a balance (e.g., Claude 3.5 Sonnet). This informs model selection for specific development roles.
  • Open-Source Models are Rapidly Advancing: Open-source models like Qwen-Coder are quickly closing the performance gap with their closed-source counterparts, indicating a promising future for accessible and powerful AI coding tools.
  • Swing Arena is an Open-Source Foundation: The project provides an open-sourced benchmark protocol, tools, and a large, multi-language dataset of verified GitHub issues, inviting community collaboration to further advance AI code generation and evaluation.

About the Speaker(s)

The primary speaker for this presentation was Wendong Xu, representing the University of Hong Kong. He also mentioned co-founding a research-driven AI data company. He emphasized that the work presented was a joint effort involving numerous institutions and a large team of collaborators, highlighting the collaborative nature of this significant research. Wendong Xu and his team are actively engaged in ongoing research related to coding agents and the development of high-quality human-in-the-loop synthetic data, indicating a continued commitment to advancing the field of AI-powered software development.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026