Code Researcher - A deep research agent tool launched by Microsoft Research
Code Researcher is a deep research agent tool developed by Microsoft Research, specifically designed to process large system codebases and their commit history, automating the repair of system code crashes. It works through three phases: Analysis (Ana...
What is a Code Researcher?
Code Researcher is a deep research agent tool developed by Microsoft Research, specifically designed to process large system codebases and their commit history, automating the repair of system code crashes. It works through three phases: Analysis, Synthesis, and Validation. In the Analysis phase, Code Researcher uses a multi-step reasoning strategy, combining code semantics, patterns, and commit history information to collect context and store it in structured memory. The Synthesis phase generates a patch based on the collected context, and the Validation phase verifies the patch's effectiveness using external tools.
It can delve deep into the codebase and commit history to uncover global contextual information related to crashes. It supports various inference strategies, such as control flow and data flow analysis, pattern search, and causal analysis based on historical commits. It uses regular expressions to search the codebase and commit history, efficiently locating the root cause of problems.
Main functions of Code Researcher
- In-depth code analysisCode Researcher can use multi-step reasoning, combining the semantics, patterns, and commit history of the code, to gradually collect contextual information and fully understand the root cause of a crash.
-
Context collectionBy using information collected during the structured memory storage analysis process, we ensure that there is sufficient background information to support the generation of fix patches.
-
Code searchIt supports searching for specific patterns in the code library using regular expressions to quickly locate relevant code snippets.
-
Submit historical analysisIt can search historical commit records to find changes related to the current crash and assist in fixing it based on past development experience.
-
Causal analysisAnalyze the impact of historical submissions on the current problem and identify the root causes that introduced the problem.
-
Intelligent SynthesisBased on the collected context information, it generates patches to fix crashes. It can identify code snippets modified in multiple files and generate high-quality fixes.
-
Filtering and OptimizationDuring the synthesis phase, Code Researcher filters out irrelevant information and focuses on the context directly related to the crash fix, ensuring that the generated patch is accurate and effective.
-
External tool integrationUse external tools to verify whether the generated patch can effectively prevent crashes, ensuring the accuracy and security of the repair.
-
Automated verification processAutomated testing verifies the effectiveness of patches, reducing manual intervention and improving repair efficiency.
- Generalization abilityCode Researcher is suitable for large system codebases such as the Linux kernel, and can quickly adapt to other system codebases (such as FFmpeg) to generate effective patch fixes, demonstrating good generalization ability.
-
Provide repair suggestionsIn some complex situations where problems cannot be completely fixed, Code Researcher can provide valuable debugging information and repair suggestions to accelerate problem resolution.
The technical principles of Code Researcher
- Multi-step reasoning and semantic analysisCode Researcher uses multi-step reasoning to progressively collect semantic information, patterns, and commit history context from the code. Leveraging the semantic analysis capabilities of Large Language Models (LLMs), it deeply understands code logic and structure, more accurately pinpointing the root cause of crashes.
- Code commit history analysisThis innovative approach mines code commit history, analyzing the evolution of vulnerabilities during development to understand the essence of problems. This time-series analysis method enables the processing of ultra-large-scale codebases with millions of lines of code.
- Global Context CollectionCode Researcher collects global context information during the analysis phase, including code snippets, past commit history, and symbol definitions. This information is stored in structured memory for subsequent patch generation.
- Deep exploration and intelligent synthesisCode Researcher can delve deep into code repositories, exploring an average of 10 related files per track. During the synthesis phase, irrelevant information is filtered out, and fixes are generated based on the collected context.
Code Researcher project address
- arXiv technical paper:https://arxiv.org/pdf/2506.11060
Application scenarios of Code Researcher
- Linux kernel crash repairBy deeply analyzing the semantics, patterns, and commit history of the code, Code Researcher can automatically pinpoint the root cause of a crash and generate a fix patch.
- Enterprise software maintenanceCode Researcher can automate the handling of crashes in enterprise software by deeply analyzing codebases and commit history to quickly generate fixes.
- Developer assistance toolsCode Researcher can serve as a developer aid, providing root cause analysis and fix suggestions for crashes.
- Automated testing and continuous integrationCode Researcher can be integrated into automated testing and continuous integration environments to automatically detect and fix crashes.