WEAVE: Weaving Real-World Code Evolution into Dependency-Structured Tasks for Benchmarking and Training Code Agents
Organizations: Independent Researchers · Shanghai Artificial Intelligence Laboratory · National University of Singapore · Tsinghua University
Abstract
Real-world software engineering rarely consists of isolated changes. Features, migrations, and systematic fixes often unfold across multiple pull requests (PRs), requiring coordinated modifications across a repository. Yet most executable repository-level benchmarks retain a single issue or PR as the task unit, while existing multi-PR settings rely on coarse aggregation and structure-agnostic evaluation. This mismatch obscures dependencies among changes and limits progress measurement and learning signals for long-horizon code agents. We introduce WEAVE, a framework that transforms verified PR histories into executable, dependency-structured tasks. WEAVE leverages repository-calibrated typed change loci to organize related PRs into bounded DAGs and instantiate each as a unified executable task. We further introduce Graph Credit, a deterministic, test-grounded metric that measures dependency-consistent partial progress and supports dense, verifiable rewards for reinforcement learning. Experiments on task construction, agent evaluation, supervised fine-tuning, and reinforcement learning show that WEAVE yields coherent executable tasks, enables more faithful progress measurement than flat scoring, and provides effective supervision and verifiable rewards for training code agents.
Figures & tables
| Benchmark | Unit | Construction | Struct. | Exec. | Credit | Train | Lang. |
| SWE-bench Verified | Issue–PR | Issue linked | Atomic | ✓ | Binary | – | Py |
| Multi-SWE-bench | Issue–PR | Issue linked | Atomic | ✓ | Binary | ✓ | Multi |
| SWE-Gym | Issue–PR | Real issues | Atomic | ✓ | Binary | ✓ | Py |
| SWE-EVO | Release delta | Release based | Flat | ✓ | Flat F2P | – | Py |
| SWE-CI | Commit span | Evolution span | Sequence | ✓ | EvoScore | – | Py |
| SWE-Milestone | Milestone | Commit + LLM | DAG | ✓ | Milestone | – | Multi |
| Scaffold | Model | Resolved | Flat-F2P | GraphCr. | OverCr. | Turns | Tok (M) |
|---|---|---|---|---|---|---|---|
| OpenCode | MiniMax-2.7 | 12.3 | 24.2 | 13.4 | 10.8 | 90.9 | 5.98 |
| DeepSeek-V4-Flash | 21.0 | 21.8 | 14.6 | 7.2 | 78.7 | 6.03 | |
| Kimi-K2.5 | 14.0 | 12.4 | 5.1 | 7.3 | 88.6 | 6.65 | |
| Kimi-K2.6 | 29.3 | 30.1 | 21.4 | 8.7 | 96.3 | 8.16 | |
| GLM-5.1 | 28.7 | 24.1 | 14.5 | 9.6 | 114.8 | 7.88 | |
| GLM-5.2 | 34.0 | 32.5 | 23.8 | 8.7 | 145.1 | 12.17 |
| Method | AP | Coverage | P@50 |
|---|---|---|---|
| Temporal Window | 5.1 | 73.1 | 2.0 |
| Traceability Links | 17.2 | 12.8 | 28.0 |
| File Overlap | 26.6 | 73.5 | 10.0 |
| Symbol Overlap | 24.0 | 69.0 | 30.0 |
| WEAVE (Ours) | 37.7 ∗∗ | 84.5 | 38.0 |
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Language | |||||
|---|---|---|---|---|---|
| Python | ✓ | ✓ | ✓ | ✓ | ✓ |
| TypeScript | ✓ | ✓ | ✓ | ✓ | ✓ |
| JavaScript | ✓ | ✓ | ✓ | ✓ | |
| Go | ✓ | ✓ | ✓ | ✓ | |
| Java | ✓ | ✓ | ✓ | ✓ | |
| Kotlin | ✓ | ✓ | ✓ | ✓ |
| Operator | Spearman | Resid. OverCredit |
|---|---|---|
| Linearized (no graph) | 0.69 | 10.5 pp |
| Depth-weighted | 0.73 | 7.1 pp |
| Mean-parent | 0.77 | 3.2 pp |
| Min-bottleneck (ours) | 0.82 | 0.0 pp |
| Parameter | Value |
|---|---|
| Max interaction turns | 200 |
| Total task timeout | 2 hours |
| Test suite timeout | 30 minutes |
| Tool interface | Shell + File Edit |
| Context window | Model-provider default |
| Temperature | Model-provider default |
| AP | Coverage | Exec. Rate | |
|---|---|---|---|
| 0.05 | 31.4 | 92.0 | 62.4 |
| 0.10 | 35.6 | 88.0 | 71.2 |
| 0.15 | 37.6 | 84.0 | 76.8 |
| 0.20 | 37.2 | 78.0 | 82.4 |
| 0.25 | 34.0 | 68.0 | 80.6 |
| 0.30 | 30.2 | 58.0 | 78.8 |
| (days) | AP | Coverage | Candidates |
|---|---|---|---|
| 7 | 38.4 | 48.0 | 326 |
| 14 | 38.0 | 60.0 | 708 |
| 30 | 37.6 | 72.0 | 1,482 |
| 60 | 37.4 | 77.4 | 3,716 |
| 90 | 37.2 | 78.0 | 6,218 |
| Method | P@10 | P@20 | P@50 | P@100 |
|---|---|---|---|---|
| Temporal Window | 10.0 | 5.0 | 2.0 | 2.0 |
| Traceability Links | 60.0 | 45.0 | 28.0 | 17.0 |
| File Overlap | 20.0 | 15.0 | 10.0 | 8.0 |
| Symbol Overlap | 50.0 | 40.0 | 30.0 | 22.0 |
| WEAVE | 70.0 | 50.0 | 38.0 | 29.0 |
| Configuration | AP | Coverage |
|---|---|---|
| Single type | ||
| only | 28.4 | 62.1 |
| only | 22.6 | 55.8 |
| only | 14.2 | 38.4 |
| only | 18.8 | 44.2 |
| only | 12.4 | 32.6 |
| Model | Training Data | SWE-V | SWE-Pro | SWE-ML | WB-Res | WB-GC |
|---|---|---|---|---|---|---|
| Qwen3.5-4B | ||||||
| Base (no SFT) | 50.4 | 24.2 | 35.3 | 4.0 | 8.6 | |
| External Reference | ||||||
| SWE-rebench V2 | 51.8 | 25.4 | 36.6 | 4.7 | 9.5 | |
| daVinci-Agency | 50.6 | 24.0 | 35.7 | 3.7 | 8.2 | |
| Controlled (same repos, matched tokens) | ||||||
| Budget | 25% | 50% | 75% | 100% |
|---|---|---|---|---|
| Atomic-PR | 9.2 | 10.8 | 11.7 | 12.4 |
| Temporal-Window | 9.9 | 11.7 | 12.8 | 13.5 |
| WEAVE | 12.6 | 15.2 | 16.7 | 17.8 |
| Reward Config | WB-Res | WB-GC | SWE-V | |
| SFT only (no RL) | 9.0 | 17.8 | 57.8 | 3.7 |
| (full) | 12.7 | 23.4 | 61.0 | – |
| GraphCredit | 11.0 | 19.0 | 59.4 | 1.7 |
| Resolved | 11.6 | 22.3 | 60.1 | 1.1 |
| FlatF2P | 12.1 | 22.7 | 60.5 | 0.6 |
| Reg P2P | 12.4 | 23.1 | 60.7 | 0.3 |
| Scheduling | WB-Res | WB-GC | SWE-V |
|---|---|---|---|
| Flat (uniform random) | 11.7 | 22.2 | 60.2 |
| 3-phase curriculum | 12.7 | 23.4 | 61.0 |
| +1.0 pp | +1.2 pp | +0.8 pp |
| Stage | Retained | Pass rate |
|---|---|---|
| Rollouts generated (3,200 3) | 9,600 | – |
| Dependency-consistent success | 4,320 | 45.0% |
| Length | 4,058 | 93.9% |
| Regression | 3,857 | 95.0% |
| Degenerate pattern | 3,699 | 95.9% |
| Leakage | 3,644 | 98.5% |
| Parameter | 4B | 35B-A3B | Search range |
|---|---|---|---|
| Learning rate | 5e-6 | 3e-6 | {2,3,5,10}e-6 |
| LR schedule | Cosine, 10% floor | – | |
| Warmup ratio | 0.03 | 0.03 | {0.01, 0.03, 0.05} |
| Global batch (seq.) | 16 | 16 | – |
| Training epochs | 3 | 3 | {2, 3, 4} |
| Max sequence length | 131,072 | – | |
| Parameter | 4B | 35B-A3B | Search range |
|---|---|---|---|
| RL prompt pool | 3,200 tasks | – | |
| Rollouts per task ( ) | 8 | 8 | – |
| Tasks per update | 16 | 16 | – |
| Passes over pool | 2 | 2 | – |
| Policy updates | 400 | 400 | – |
| Total episodes | 51,200 | – | |
| Language | WEAVE-Bench | WEAVE-Train |
|---|---|---|
| Python | 50 (16.7%) | 720 (22.5%) |
| TypeScript | 50 (16.7%) | 680 (21.3%) |
| JavaScript | 50 (16.7%) | 640 (20.0%) |
| Go | 50 (16.7%) | 480 (15.0%) |
| Kotlin | 50 (16.7%) | 360 (11.3%) |
| Java | 50 (16.7%) | 320 (10.0%) |
| Metric | WEAVE-Bench | WEAVE-Train | ||
|---|---|---|---|---|
| Mean | Median | Mean | Median | |
| Nodes ( ) | 4.91 | 5 | 4.16 | 4 |
| Edges ( ) | 4.99 | 5 | 4.28 | 4 |
| Depth (path nodes) | 3.93 | 4 | 3.71 | 4 |
| Width (max anti-chain) | 1.50 | 1 | 1.31 | 1 |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | |
| Tasks | 640 | 704 | 640 | 480 | 352 | 224 | 160 |
| Share | 20.0 | 22.0 | 20.0 | 15.0 | 11.0 | 7.0 | 5.0 |
| Metric | Mean | Median | P25 | P75 |
|---|---|---|---|---|
| Gold patch (lines) | 378 | 274 | 139 | 528 |
| Files modified | 8.4 | 6 | 3 | 12 |
| F2P tests | 18.6 | 12 | 6 | 24 |
| P2P tests | 142 | 87 | 34 | 198 |
| Attributed tests (%) | 72.8 | 76.4 | 61.2 | 86.3 |
Software Engineering Benchmarks
Software engineering benchmarks evaluate how well AI systems understand, build, repair, test, and maintain software in realistic settings.
See all 155 papers