Benchmarking AI Coding Agents for Long-Horizon Engineering Tasks: Pass Rate, Completion, and Cost
This article examines a public mobile-development benchmark for AI coding agents and explains how to interpret pass rate, average completion, runtime, and cost. It compares two representative agent profiles, discusses the trade-offs behind high completion with long runtime, and offers practical guidance for building internal evaluations, routing tasks by difficulty, and governing budgets.
Introduction: What a New Leaderboard Reveals About Evaluating Long-Horizon Engineering Agents
A cloud vendor’s developer ecosystem team has publicly released initial results for three mainstream large models on a mobile-development benchmark through its official developer channel. The benchmark targets mobile application development and covers realistic engineering tasks such as app creation, feature development, code migration, and app conversion. It evaluates whether an agent can turn a one-sentence requirement into code changes that can be built, tested, and delivered.
After the release, discussion quickly focused on a sharp contrast. Some agents had higher pass rates, with average completion approaching 80% and average runtime approaching 30 hours, while the cost of a full benchmark run exceeded CNY 2,000. Other agents had pass rates only about 60% of that level, with average completion around 70%, but used less than half the time and only a fraction of the cost. The former represents a “high completion, long runtime” profile; the latter trades pass rate for speed and lower cost.
For engineering teams, more important than “who ranks first” is understanding what these evaluations measure, how pass rate, completion, runtime, and cost relate to one another, what engineering trade-offs “high completion and long runtime” reflects, and how teams can apply these metrics to their own development workflows. This article starts with metric interpretation, then examines trade-offs and selection strategies, and finally presents a reusable approach to building and governing internal evaluations.
1. Evaluation Targets: From Code Completion to Long-Horizon Engineering Tasks
Before interpreting the metrics, it is important to understand the nature of the evaluation target. Benchmarks for AI coding tools have generally evolved through three stages:
- Function-level completion: predicting the next line or next few lines of code, testing local syntax and pattern-matching ability.
- Repository-level understanding and modification: locating issues across multiple files, understanding call chains, and completing medium-scale changes.
- Long-horizon task delivery: starting from requirements and going through solution decomposition, cross-module implementation, build verification, test fixing, and documentation synchronization.
The mobile-development benchmark belongs to the third stage. Long-horizon tasks are difficult because of four technical characteristics:
- Large state space: the work involves multiple modules, configuration files, resource files, and third-party dependencies. Feasible changes grow combinatorially. The model must find critical code within a limited context while not missing implicit constraints.
- Long feedback chain: compilation, packaging, and test execution often take minutes. The model must make many effectively irreversible decisions before receiving feedback, relying on reasoning.
- Error propagation: one wrong interface design or incompatible dependency upgrade may be repeatedly amplified over many subsequent steps, ultimately appearing as build failures or large-scale test regressions.
- Complex termination conditions: “can it be delivered?” is not only about whether tests pass; it also involves code style, architectural consistency, backward compatibility, and other judgments that are difficult to fully automate.
Mobile development adds platform-specific constraints that directly shape the evaluation system:
| Constraint | Manifestation | Impact on evaluation |
|---|---|---|
| Complex toolchain | Multi-module projects, dependency version management, signing and packaging configuration | Build failures may come from the environment rather than model capability, requiring attribution analysis |
| Long build time | Full builds and packaging can take minutes or longer | The minimum runtime for a task is raised by the toolchain |
| Validation depends on runtime | Simulators or physical devices are needed to verify UI and interactions | End-to-end acceptance is costly and often requires layered validation |
| Cross-version and cross-device compatibility | Differences in OS versions, screen sizes, and permission models | The regression surface is large, and migration tasks are especially sensitive |
For this reason, such benchmarks usually use a combination of “task items + acceptance scripts + manual review” and set fixed time and cost budgets. All models complete the same task set under controlled conditions. The comparison is of delivered results, not the quality of isolated code snippets.
2. Metrics Explained: Pass Rate, Completion, Runtime, and Cost
2.1 Pass Rate: Strict Binary Judgment
Pass rate is the proportion of tasks that an agent completes and passes all acceptance conditions. Its key feature is “all or nothing”:
- Advantages: strict, objective, resistant to luck, and closest to the real meaning of “can it be delivered?”
- Limitations: insensitive to edge cases. A task that fails at the final step and a task that fails immediately contribute the same way to pass rate.
For example, “achieving a 24.0% pass rate on 30 long-horizon tasks” corresponds to about 7.2 tasks. It may not be an integer because the pass rate may be averaged over multiple runs or weighted across tasks. Before converting, it is important to confirm the statistical definition; otherwise, it is easy to misinterpret.
2.2 Average Completion: A Fine-Grained Progress Scale
Average completion measures how far an agent is from completion. There are two common definitions:
- Acceptance-item ratio: a task is split into several verifiable acceptance items. Completion = number of achieved items / total number of items, then averaged across tasks.
- Evaluator model scoring: a human or model scores completion quality, normalized to 0–1.
It is important to note that completion is not a linear proxy for capability. If an agent completes the first 90% smoothly but cannot cross the final 10%, completion may look good while actual delivered value is close to zero. Conversely, low completion may simply mean the task is too difficult. A reasonable way to read it is: pass rate reflects results, completion reflects the gap. When two agents have similar pass rates, the one with higher completion is closer to being usable. When the pass-rate gap is clear, completion becomes less useful as a comparative signal.
2.3 Runtime and Cost: Two Different Types of Resource Consumption
- Runtime reflects latency and throughput. An agent’s “thinking,” “retrieval,” “self-verification,” and “repair retries” within a task are all included in wall-clock time. Long runtime is not necessarily a defect; it may reflect deeper verification loops.
- Cost is usually determined by token usage and is directly related to input context length, output length, and retry rounds. In long-horizon tasks, context keeps accumulating, and single-run cost may rise nonlinearly as the task progresses.
Two points need attention:
- It must be clear whether the measurement is serial or concurrent. If the “27.4 hours” runtime is interpreted as serial execution, the average per-task time is about 55 minutes. If agents actually run concurrently, tasks may compete for shared resources such as build machines, and serial runtime may be further extended.
- The measurement basis must be consistent. If runtime is measured as wall-clock time, multiple concurrently running tasks cannot be simply divided to obtain per-task cost. Cost should be calculated based on cumulative token usage.
2.4 Relationships Among the Four Metrics: A Partial View of the “Impossible Triangle”
| Metric | Core meaning | Question answered | Main limitation |
|---|---|---|---|
| Pass rate | Share of tasks passing all acceptance conditions | Can it be used? | Coarse resolution; insensitive to near-miss failures |
| Average completion | Average proportion completed | How far is it from completion? | Does not equal delivered value; cannot be compared across sources when definitions differ |
| Average runtime | Wall-clock time to complete a task | Is it fast? | Strongly affected by concurrency basis and toolchain speed |
| Single-run cost | Cost to run the entire benchmark | Is it expensive? | Needs to be converted into cost per effective output to support decisions |
There is a tension among quality, speed, and cost similar to an “impossible triangle”: achieving a higher pass rate often requires more reasoning, retrieval, and self-verification, pushing up runtime and cost. However, this is an empirical pattern rather than a law. In long-horizon tasks, marginal improvements in completion are often more valuable than speed gains, for two reasons:
- Failed long-horizon tasks often produce partial code that requires manual rework, and this hidden cost is far higher than a single inference call.
- Higher completion means a human can take over from a higher starting point and locate issues faster, significantly reducing the total time for human-agent handoff.
This also explains the core trade-off behind “high completion, long runtime”: using deterministic time investment to reduce uncertainty.
3. Case Comparison: Two Sets of Public Results
For discussion, the two sets of public results below are anonymized as Agent A and Agent B (the completion, runtime, and cost values in the table are illustrative):
| Metric | Agent A | Agent B | Comparison |
|---|---|---|---|
| Agent framework | Framework A | Framework B | Agent capability and framework synergy can affect results |
| Pass rate | 24.0% | 17.3% | A is 6.7 percentage points higher, about a 39% relative improvement |
| Average completion | 82.3% | 71.2% | A is 11.1 percentage points higher |
| Average runtime | 27.4 hours | 12.0 hours | B is about 44% of A |
| Single-run cost | $317.4 (about CNY 2,123) | $9.9 (about CNY 66) | B is about 3% of A, a gap of about 32x |
Next, look at “cost per effective output,” which is single-run cost divided by the number of passed tasks. A is about 2,123 ÷ (30 × 24.0%) ≈ CNY 295, and B is about 66 ÷ (30 × 17.3%) ≈ CNY 13, a gap of about 23x. In other words, even when considering “only passed tasks count as effective output,” A’s per-unit cost is still significantly higher than B’s. Given that A’s pass rate is higher than the other compared models, A can be viewed as representative of “high completion, high runtime.” B is stronger in speed and cost, making it suitable for scenarios sensitive to budget and response time.
Three patterns can be drawn from these data:
- Pass rate and completion move in the same direction, but by different magnitudes. A’s completion is about 11 percentage points higher than B’s, while its pass rate is about 39% higher in relative terms. This shows that both models concentrate capability improvements on “solving long-tail difficult tasks”: basic tasks can be completed by everyone, and the difference lies in the last few complex tasks.
- Runtime and cost do not change synchronously. A’s runtime is about 2.3 times B’s, but its cost is about 32 times B’s, a difference of more than ten times. This shows that B’s individual calls are cheaper, while A spends much of its time on multiple reasoning rounds, repeated verification, and other steps that consume time but are not necessarily billed. When evaluating agents, runtime and cost should not be treated as the same thing.
- Scenarios determine selection, not rankings. For teams with urgent tasks, limited budgets, and exploratory modifications, B’s cost efficiency is more suitable. For teams involved in cross-module migration, long unattended runs, and low tolerance for delivery quality, A’s high completion can better reduce manual rework and delivery risk. Focusing only on pass-rate rankings can easily lead to one-sided conclusions.
4. Engineering Trade-offs Behind “High Completion, Long Runtime”
4.1 Self-Verification Loops: Trading Time for Certainty
More capable agents often execute multiple rounds of “modify–verify–fix” loops: generating changes, compiling and building, running tests, analyzing logs, and modifying again. This loop can resolve many issues earlier that would otherwise appear during acceptance, leading to higher completion and pass rates. The cost is that each additional loop adds another round of reasoning, one build, and one log analysis. Runtime grows almost linearly, while cost accelerates as context accumulates.
For developers, this is similar to choosing between “writing unit tests” and “committing directly”: the former requires more upfront investment but reduces the probability of later rework. The particularity of long-horizon tasks is that rework costs are amplified.
4.2 Context Management: Information Decay in Long Tasks
The amount of information in long-horizon tasks far exceeds the context window. Agents must rely on retrieval, summarization, memory compression, and other mechanisms to maintain direction. Common risks include:
- architectural constraints determined early being forgotten by later steps;
- newly generated code conflicting with existing conventions;
- repeatedly modifying the same file, resulting in “patch on patch.”
To mitigate these issues, agents often increase retrieval and review, which appears as more rounds and longer runtime. Such overhead may not be cost-effective in short tasks, but it can significantly reduce the probability of going off track in long tasks.
4.3 Task Scheduling: Serial, Concurrent, and Resource Contention
If 30 tasks are executed concurrently, build caches, simulator instances, disk, and network bandwidth are occupied at the same time, slowing each other down and increasing wall-clock time. Conversely, if concurrency is deliberately increased to reduce runtime, resource contention may interfere with reproducibility. The evaluation pipeline needs to make an engineering trade-off between “fast” and “stable,” for example:
- scheduling by build resource groups and isolating heavy tasks;
- locking shared build caches, or using read-only caches plus independent write caches;
- using containerized sandboxes to provide a clean and consistent runtime environment for each task.
4.4 Cost Structure: Nonlinear Growth from Context Expansion
Under mainstream billing models, the input-side cost of one inference depends on the prompt plus accumulated conversation and file context. In long-horizon tasks, each additional round makes the context longer, increasing single-round input cost. This means total cost is not simply linearly related to the number of task steps. In practice, the following methods can suppress expansion:
- Context trimming: keep only files and log fragments relevant to the current sub-goal;
- Subtask decomposition: split long-horizon tasks into subtasks with clear boundaries, each maintaining its own context;
- Result summarization: compress lengthy build logs into structured error summaries before giving them to the agent for analysis.
4.5 Human-Agent Collaboration: The Final Landing Point of Time Cost
“Average runtime of 27.4 hours” does not mean a task occupies a developer for 27 hours. If an agent can run continuously without supervision, most of this time is the machine “working.” The real risk lies in rework after failure: if completion is only around 70% and failure points are scattered, developers need to re-understand context and locate issues, and this time is often several times the agent’s own runtime.
Therefore, a rough model can be established:
Effective delivery time ≈ Agent runtime + Human review time + Rework and correction time
For tasks with high difficulty and large change surfaces, improving completion usually reduces the latter two. For simple, low-risk tasks, prioritizing speed and cost is often more cost-effective.
5. From Metrics to Decisions: How Teams Should Choose Agents
5.1 Build a Task Set Aligned with Business Needs
The task distribution in public leaderboards may not match a team’s real business. It is recommended to sample real requirements from the past three months and construct a layered task set:
- High-frequency, low-risk: copy adjustments, style tweaks, dependency version upgrades;
- Medium-frequency, medium-risk: new feature development, local refactoring;
- Low-frequency, high-risk: cross-module migration, architecture-level changes.
Each task should include clear acceptance scripts and manual review checklists and be updated quarterly to prevent agents from “memorizing” fixed answers.
5.2 Match Agents to Scenario-Specific Capability Profiles
| Scenario | Key requirement | Recommended focus |
|---|---|---|
| Daily development assistance | Fast response, low cost | Lightweight model + automated testing as a safety net |
| Urgent fixes | Low latency | Fast localization + small-step verification |
| Cross-module migration | High completion, can run unattended | High-completion model + strict acceptance gates |
| Exploratory refactoring | Diverse options, rollback possible | Multiple models generate options in parallel; humans compare and choose |
5.3 Layered Routing: Let Different Capabilities Fit Different Tasks
A more practical approach is not “choose one or the other,” but to route tasks by difficulty to different models. Example configuration:
# Agent routing and budget guardrails (illustrative configuration, not the interface of any specific product)routing:- name: quick_fix # Single-file changes with existing tests as a safety netmatch: { files_changed_max: 3, has_test: true }tier: lightweighttimeout_minutes: 30budget_usd: 0.5- name: standard_feature # Cross-module or new feature developmentmatch: { task_type: feature }tier: standardtimeout_minutes: 120budget_usd: 5- name: long_horizon # Cross-module migration or unattended batch processingmatch: { task_type: migration }tier: high_completiontimeout_minutes: 480budget_usd: 20budgets:daily_cap_usd: 50 # Global daily cap to prevent runaway retriesretry_max: 2 # Maximum automatic retries for the same taskfallback:on_timeout: downgrade_and_resume # Downgrade and continue after timeout rather than abandoning
The meaning of layered routing is that simple tasks are completed quickly by lightweight models, while complex tasks are assigned to high-completion models for longer runs. This can lower average cost while maintaining quality at critical steps.
5.4 Budget Governance: Making Cost an Observable Metric
Token consumption, task runtime, and human intervention frequency should be included in daily monitoring, broken down by team, project, and task type, with daily/weekly budget caps. For example, a cost view can be organized as follows:
| Dimension | Observation metric | Alert threshold (example) |
|---|---|---|
| Task level | Per-task token usage, runtime | More than 2x the P95 over the past 30 days |
| Team level | Daily cumulative cost | More than 80% of the daily budget |
| Quality level | Pass rate, human rework rate | Declines of more than 5 percentage points for 3 consecutive days |
The key here is “accounting by effective output,” using the number of tasks that pass acceptance as the denominator. Looking only at call volume can easily hide large amounts of ineffective consumption where money was spent but nothing was delivered.
5.5 Result Review: Automated Acceptance Plus Manual Sampling
No matter how high completion is, review is still needed. Three gates are recommended:
- Automated acceptance scripts cover functionality and regression.
- Manual sampling focuses on architectural consistency, readability, and security risks.
- Changes involving permissions, payments, or privacy data must undergo mandatory manual review.
6. How to Build Your Own Long-Horizon Task Evaluation
If a team wants to quantify agent performance in its own scenarios in the same way as public benchmarks, it can refer to the following process:
- Task construction: extract 20–50 tasks from real requirements. Each task should include a requirement description, an initial code snapshot, an acceptance script, and expected completion scoring criteria.
- Environment isolation: use containerized sandboxes to provide a clean and reproducible build environment for each task, avoiding cache and dependency contamination.
- Unified budget: set the same timeout and cost cap for all agents under evaluation to ensure comparability.
- Multiple runs: run each task at least 3 times, record pass rate, completion, runtime, and cost, and calculate variance to identify “accidental passes.”
- Attribution analysis: classify failures into “understanding deviation,” “implementation defects,” “toolchain issues,” and “resource timeout” to guide subsequent optimization.
The judgment logic can be expressed with the following pseudocode:
def evaluate(task, agent, budget):"""Run a long-horizon task under a unified budget and return structured evaluation results."""start = time.monotonic()result = agent.run(task.spec, sandbox=task.sandbox, budget=budget)elapsed_hours = (time.monotonic() - start) / 3600# 1) Acceptance: functional tests and regression tests must all passchecks = task.verify(result.workspace)passed = all(check.ok for check in checks)# 2) Completion: ratio of achieved acceptance items, weighted by key milestonescompletion = sum(check.weight for check in checks if check.ok) / sum(check.weight for check in checks)# 3) Resource consumption: record runtime and cost separately to avoid mixing themcost = result.tokens_input * PRICE_IN + result.tokens_output * PRICE_OUTreturn {"task_id": task.id,"passed": passed,"completion": round(completion, 4),"elapsed_hours": round(elapsed_hours, 2),"cost": round(cost, 2),# Help analyze at which stage failures mainly occur"failure_stage": checks.first_failed_stage if not passed else None,}
The code snapshots, execution traces, and acceptance logs generated by evaluation can be large and require long-term retention. It is suitable to rely on general cloud capabilities to carry them:
- Object storage for snapshots and traces of each run;
- Message queues to buffer concurrent tasks;
- Container platforms for isolated sandboxes;
- Log services to aggregate run records;
- Monitoring and alerting for cost anomalies and pass-rate fluctuations.
7. Limitations and Trends
Every benchmark has boundaries. Three points deserve rational attention:
- Task representativeness: 30 tasks cannot cover all forms of real business, and leaderboard rankings do not necessarily equal performance in a team’s own scenarios.
- Framework synergy: the same model may produce clearly different results with different agent frameworks (tool-calling methods, context management strategies, retry mechanisms). The runtime environment should be noted when comparing.
- Statistical fluctuation: long-horizon tasks involve few runs and high randomness. Single results can easily be affected by accidental factors. More disclosure of multiple-run averages and variance makes conclusions more credible.
From a trend perspective, long-horizon task evaluation is moving from “single-point pass rate” to “multi-dimensional value assessment.” Runtime, cost, stability, and security will all be considered. For developers, rather than chasing the ranking of a single leaderboard, it is better to build an evaluation system aligned with their own business and use data to drive agent selection and process optimization.
Conclusion
The real value of this leaderboard is not to provide a ranking, but to quantify the capability boundaries of AI coding agents in long-horizon engineering tasks. Agent A’s “high completion, high runtime” is essentially trading time for certainty; Agent B’s “low runtime, low cost” trades controllable quality compromises for response speed and budget friendliness.
For teams, there is no absolute “optimal solution,” only trade-offs matched to scenarios. Understanding the meanings and tensions of the four metrics, building a business-aligned evaluation set, and combining layered routing with budget governance can make AI coding agents a reliable productivity force rather than just a number on a leaderboard.
