Choosing Long-Horizon Coding Benchmarks: How to Balance Pass Rate, Completion, Runtime, and Cost
Long-horizon coding benchmarks measure whether AI tools can deliver complete, verifiable software—not just autocomplete a function. This guide explains what these benchmarks actually test, how to read pass rate, average completion, runtime, and cost together, why the execution framework matters as much as the model, and how teams can build their own reproducible evaluations to pick the right approach for quality-first, balanced, or cost-first scenarios.
1. Background: Coding evaluation shifts from “completion” to “long-horizon engineering”
When developers think of AI coding capability, many first picture line-level or function-level autocomplete in the editor. These scenarios share one precondition: the task boundary is clear. Examples like “make this function async” or “explain what this regex does” typically require only a single reasoning hop, and the model can produce an answer that is immediately verifiable.
But in real mobile app development, a single requirement often spans many stages before it ships: scaffolding the project and configuring dependencies, implementing UI and business logic, wiring up network requests and local storage, handling permission prompts and lifecycle management, adapting to different screen resolutions and OS versions, and filling in unit tests and a CI pipeline. These tasks have clear goals but long cycles, many steps, and complex state. This article calls them long-horizon coding tasks.
Matching evaluation methods have emerged alongside them. One class of AI coding benchmarks aimed at application development no longer only asks “is this code correct?” Instead, it abstracts tasks into scenarios such as app creation, feature development, code migration, and app conversion, then checks whether the system under test can actually complete a full software delivery. Because each task can run for hours or longer, the model must repeatedly plan, call tools, run builds and tests, read errors, and modify and retry within a limited context and under resource limits. These long-horizon benchmarks usually report four key results at once:
- Pass rate: the share of tasks that fully meet the acceptance criteria—answers “can it get done?”
- Average completion: the mean of each task’s acceptance progress (partial credit)—answers “how far did it get?”
- Average runtime: answers “how long does it take?”
- Cost per benchmark run: answers “how much does it cost?”
Recently published mobile app development benchmark results have pushed long-horizon coding back to the center of discussion. Several mainstream candidate solutions were evaluated on long-horizon tasks drawn from app development scenarios, each driven by a different AI coding tool. Notably, the leading candidates passed roughly 40% of tasks, while a mid-ranked candidate still completed around 70% of the progress; and solutions whose prices differ by more than an order of magnitude do not necessarily show a comparable gap in quality. For teams that need to choose for themselves, the more useful questions are not “who came first” but how to understand these metrics, how to connect them to your own business, and how to make a decision on your own task set.
2. How the benchmark works: task composition and verifiability
The credibility of a long-horizon benchmark depends first on the design quality of the task set itself. A usable long-horizon task set typically needs to meet the following requirements.
1. Scenario coverage. Tasks should be categorized by real development activity, with a difficulty gradient designed for each category:
- App creation: starting from a blank project, establish the layered structure and foundational modules;
- Feature development: add pages, modules, or business capabilities to an existing codebase;
- Code migration: replace an implementation or upgrade a framework while preserving behavior, such as converting hand-written layouts to a declarative UI;
- App conversion: cross-platform or cross-paradigm changes, such as turning a native app into a cross-platform one, or moving on-device capabilities to cloud services.
2. Machine-verifiable acceptance criteria. The endpoint of a long-horizon task should not be judged by human impression, but resolved to objective signals: whether compilation passes, whether static analysis introduces new issues, whether unit and integration tests are all green, and whether key behaviors satisfy assertions. This removes subjective bias and makes batch, repeatable execution easy.
3. Environment isolation and reproducibility. Each task should run in a sandbox built from a fixed image: pinned dependency versions, unified simulator images and network-access policies, an upper limit on runtime, and retention of a code snapshot, build logs, and test results at the end. Reproducibility is the precondition for horizontal comparison.
4. Difficulty distribution and contamination resistance. Long-horizon tasks span multiple layers of dependencies and long context windows, and simply stacking more items does not proportionally improve discriminative power. Once a public benchmark becomes widely known, it may enter the model’s training corpus. So when a team builds its own evaluation set, what matters more is an internal task set derived from real requirements, which is naturally harder for a model to have “memorized.”
3. How to read the metrics: pass rate, completion, runtime, and cost
The numbers from a long-horizon coding benchmark need to be understood across dimensions; looking at pass rate alone easily leads to a one-sided conclusion.
Pass rate measures the “end state.” It counts only the proportion of tasks that fully satisfy every acceptance criterion, which is closest to the business judgment of “can it be delivered,” but it is insensitive to partial completion. Two solutions might both have a pass rate around 30%, yet their average completion could differ by more than ten percentage points—meaning one of them reached fairly late stages even on many of the tasks it did not pass.
Average completion measures “progress.” A sound approach is to first break each task into several verifiable checkpoints, then add partial credit proportionally:
completion = Σ(checkpoints passed in a task / total checkpoints in that task) / total tasks
For example, if a task has 10 checkpoints and the system under test completes 7, that task’s completion is recorded as 70%. It’s worth stressing that completion is essentially human-defined partial credit—how checkpoints are split and weighted all affect the result. When comparing completion across different sources, you must first confirm the calculation methods are consistent, otherwise the numbers are not strictly comparable.
Runtime and cost measure the “price.” Long-horizon tasks typically run for hours, and cost is aggregated by pay-per-call execution frameworks, so the value depends on task count, per-task size, and pricing policy. As a result, the same outcome is not transferable across different pricing policies or task-set sizes. A more useful practice is to convert to unit efficiency:
cost per pass = total run cost / number of tasks passedthroughput = number of tasks passed / total runtime
Suppose the total run cost is 24 currency units, the total runtime is 24 hours, the task set has 40 items, and 8 are passed. Then the cost per pass is 24 ÷ 8 = 3 currency units, and throughput is 8 ÷ 24 ≈ 0.33 tasks/hour. The former suits budget-sensitive teams, while the latter suits teams with tight release cycles and high labor costs.
Run count and variance. Long-horizon tasks often run for hours, and a single run is expensive, so most public benchmarks report only one result. Probabilistic tasks, however, often show noticeable run-to-run variance, and a single score may land above or below the true level. When building their own evaluation, teams are advised to repeat key tasks at least three times, take the mean, and record the standard deviation, to avoid being misled by a fluke result.
4. The overlooked variable: the execution framework
In long-horizon coding benchmarks, the “model” is not the only variable—the execution framework that hosts the model is equally critical. In the original evaluation, the candidate solutions were each driven by different AI coding tools, which shows that the following capabilities significantly affect final results:
- Tool set and permission design: the breadth and granularity of abilities to read files, run builds, execute tests, and view logs directly determine whether the model can close the “act–observe–correct” loop;
- Context management strategy: how history is compressed and key information retained during a long run determines whether the task can still “remember the goal” in its later stages;
- Error recovery mechanisms: whether it can automatically locate, roll back, and retry after a failed build directly affects completion;
- Resource and budget management: constraints on step count, duration, and call volume determine when it must converge;
- Sandbox and environment management: isolating the execution environment, automatically provisioning simulators or containers, and controlling concurrency and task orchestration;
- Observability: logging every tool call and its duration so failures can be diagnosed after the fact.
Therefore, when comparing long-horizon benchmark results from different sources, you must check three things together: model version, execution framework version, and run parameters. Missing any one of them weakens the rigor of a horizontal comparison. A common practice is to fix the execution framework and swap only the model under test, so the variable is narrowed as much as possible to “model capability.”
5. Illustrative implementation: measuring long-horizon tasks yourself
The following sample code demonstrates how to convert long-horizon task results into completion scores and aggregate them into comparable metrics. It is not the internal detail of any specific execution framework, just a reusable scoring skeleton.
from dataclasses import dataclass, fieldfrom statistics import meanfrom typing import Callable# Single checkpoint: name + verify function (e.g., does it compile, are all tests green)@dataclassclass Checkpoint:name: strweight: float = 1.0verify: Callable[[dict], bool] = lambda ctx: True@dataclassclass LongTask:task_id: strscene: str # create / feature / migration / conversiondifficulty: int # 1-3checkpoints: list = field(default_factory=list)max_steps: int = 500timeout_minutes: int = 240@dataclassclass TaskResult:task_id: strcheckpoints: dict # checkpoint name -> whether passedelapsed_minutes: floatcost: floatstatus: str # completed / timeout / errorevents: list = field(default_factory=list) # tool call tracedef score_completion(task: LongTask, result: TaskResult) -> float:total = sum(cp.weight for cp in task.checkpoints)if total <= 0:return 0.0got = sum(cp.weight for cp in task.checkpointsif result.checkpoints.get(cp.name, False))return got / totaldef evaluate(tasks, runs, budget_per_run=None):completions, costs, elapsed, passed = [], [], [], 0for task, result in runs:ratio = score_completion(task, result)completions.append(ratio)costs.append(result.cost)elapsed.append(result.elapsed_minutes)if ratio >= 1.0 and result.status == "completed":passed += 1n = len(runs)return {"pass_rate": passed / n,"avg_completion": mean(completions),"avg_minutes": mean(elapsed),"cost_per_run": mean(costs),"cost_per_pass": sum(costs) / passed if passed else None,}
In practice, three additional capabilities are needed:
- Acceptance-driven: each checkpoint maps to an automatically executable assertion, such as a build command’s exit code, a test case result, or a UI element lookup;
- Process tracing: write the tool-call sequence to logs so failed tasks can be replayed along a timeline, helping pinpoint whether the cause was a planning error, tool misuse, or an environment problem;
- Budget control: set step limits, duration limits, and cost limits per task, so a single task cannot fall into endless trial and error and drag down the whole evaluation.
6. From scores to selection: a tradeoff framework for three scenarios
1. Quality-first scenarios. Mature applications facing end users, where a core flow directly carries revenue or brand, and the cost of a single regression far exceeds model-call cost. These teams should put pass rate and average completion first, treating runtime and cost only as constraints.
2. Balanced scenarios. Teams focused on feature iteration with a stable release cadence can rank by weighted cost per pass and throughput. The method is to set an acceptable upper bound for both runtime and cost, and within that range prefer the solution with the higher pass rate.
3. Cost-first scenarios. For internal tools, prototype validation, or high-frequency batch tasks, response time and call budget are usually hard constraints. In the original evaluation, one candidate cost roughly a fraction of another solution’s price; while its pass rate was lower than the leader’s, its speed and cost advantages were clear, making it suitable for development teams sensitive to budget and response time. The decision logic for such teams should be “maximize pass rate within budget,” not “unconditionally chase the highest pass rate.”
4. Layered combinations. Most enterprises don’t have to choose one or the other. A workable strategy is to route by task complexity: hand simple, repetitive, templatizable work to a low-cost solution, and give complex tasks involving architecture design and cross-module changes to a high-pass-rate solution, all managed through a routing layer. This balances delivery quality while keeping total cost under control.
5. Evaluation gate first. Before adopting any solution, run an “admission evaluation” on your internal task set to confirm its performance on your company’s tasks, rather than directly adopting public leaderboard conclusions. Also build a regression mechanism: whenever the model or execution framework is upgraded, rerun on the same task set and watch how the metrics change.
7. Implementation practices: making benchmarks serve R&D
- Build an internal task pool. Select 20 to 50 items from recent real requirements, covering the four scenario types, each paired with an automatically executable acceptance script. Rotate the pool periodically to prevent the model from overfitting to fixed problems.
- Unify the evaluation environment. Containerized sandboxes, pinned dependency versions, and unified simulator images ensure results are comparable across batches.
- Focus on failure modes. Pass rate only tells you the result. Classify failed tasks into categories such as planning failure, tool misuse, unavailable environment, and context loss, so you can improve the execution framework and prompting strategy in a targeted way.
- Make cost observable. Record call volume, runtime, and cost for each run, and aggregate by team or project dimension for budgeting and optimization.
- Set security boundaries. Long-horizon execution means tools have relatively high file and command permissions, so run them in an isolated environment, restrict external network access, keep secrets off disk, and set up human review for critical changes.
If an enterprise needs to build its own evaluation pipeline, it can compose general cloud capabilities: use a container platform to host the isolated task-execution environment, object storage to save code snapshots and build artifacts, a message queue to schedule the asynchronous execution of long-running tasks, a logging service to retain the full tool-call trace, and monitoring and alerting to track timeouts, failure rates, and cost anomalies. Baidu AI Cloud provides exactly this kind of general-purpose infrastructure capability, while the specific orchestration and evaluation logic is still designed by the enterprise as needed.
8. Common misconceptions and conclusion
Three misconceptions about long-horizon coding benchmarks are worth clarifying.
First, leaderboard scores do not equal enterprise gains. Public task sets differ enormously from real requirements in code size, dependency complexity, and the proportion of legacy code, so directly copying rankings easily leads to wrong decisions.
Second, pass rate is not the only standard. A solution with a slightly lower pass rate but higher average completion and lower cost per pass may be better suited to a given stage’s needs.
Third, a single result does not represent the stable level. Long-horizon tasks are expensive to run, and drawing conclusions from just one run is likely to mistake luck for capability.
The real value of long-horizon coding benchmarks is to turn the vague question of “can AI write code” into the measurable question of “under given tasks, time, and budget, can it reliably deliver verifiable results.” For developers, understanding the meaning and calculation of the four metric types, mastering the execution framework as a key variable, and building a reproducible evaluation loop internally is more meaningful than chasing any single leaderboard. The purpose of evaluation is to guide practice: choosing the right solution, controlling cost, and leaving energy for the parts that truly need human judgment is the right way for these benchmarks to enter the daily development workflow.
