AI Coding Benchmarks for Real Engineering Tasks: Long-Horizon Pass Rates and Cost Analysis
This article explains why general code-generation benchmarks fall short for mobile development and what to look for in benchmarks built around real engineering tasks. It breaks down four core metrics—long-horizon pass rate, average completion, average duration, and cost per benchmark run—and examines why high completion often fails to translate into a passing result. It also outlines the main causes of that gap, a practical YAML task-orchestration example with budget guardrails and mandatory verification, and scenario-based guidance for choosing the right capability tier.
1. Why Mobile Development Needs a Dedicated AI Coding Benchmark
Benchmarks for general code generation tend to focus on single-file function completion, algorithm problems, or short-context Q&A. These tasks have small context windows and shallow dependencies, so even a mediocre model can score well through local pattern matching. Real mobile application development is nothing like that: a single working feature module typically spans the UI layer, state management, networking, local persistence, and permission declarations plus manifest configuration. Miss any one of them and the build fails or the app crashes at runtime.
That is why the industry has been moving toward benchmarks designed around real engineering work. They share four typical characteristics:
- Long-horizon tasks: a single task may take dozens of rounds of tool calls and file reads and writes to converge, testing the model’s long-range planning and self-correction.
- Realistic engineering constraints: build toolchains, dependency versions, directory structure, and resource naming conventions must all be respected.
- Verifiable results: pass/fail is decided by whether the build succeeds, whether automated checks pass, and whether the feature actually works—not by subjective scoring.
- Measurable cost: total elapsed time and resource consumption are recorded, so effectiveness and investment can be compared in the same frame of reference.
Under such a benchmark, an agent has to keep reading the project structure, editing multiple files, running the build, parsing errors, and going back to the code to fix them, forming a closed loop. That is fundamentally different from a one-question, one-answer interaction.
2. How to Read the Four Core Metrics
Evaluations usually report four numbers, and much of the discussion fixates on the first one—which is where misjudgment most often starts.
1. Long-horizon pass rate
The share of tasks that fully meet the acceptance criteria. It is the hard indicator of “can this be delivered” and has the most direct impact on production. Pass rate is extremely sensitive to defects: an artifact with only a few flaws but a high degree of completion still counts as a failure.
2. Average completion
How far tasks were actually pushed—a continuous measure of “close to usable.” High completion combined with a low pass rate indicates a model that is good at scaffolding and laying down code but has systematic weaknesses in detail convergence, edge cases, and final verification.
3. Average duration
Long-horizon tasks can run for hours to tens of hours, and duration directly determines the length of the feedback loop. Excessive duration creates two hidden costs: developers cannot wait synchronously, which raises the complexity of asynchronous collaboration and task orchestration; and the time cost of retrying failures is amplified.
4. Cost per benchmark run
Converting total resource consumption into a monetary figure makes different approaches comparable. In the reference evaluation data cited here, two approaches differed by roughly ten percentage points in pass rate, but by about thirty times in cost per run and by more than double in duration. The comparison reveals a key fact: pass rate does not push cost up linearly—the distribution of cost and duration is often far steeper than the difference in effectiveness.
3. Where the Gap Between High Completion and Low Pass Rate Comes From
This gap is not random noise; it is a typical symptom of long-horizon agent engineering, with these main sources:
- Missing verification: after writing the code, the model never actually runs the build or tests, so errors carry into the next round.
- Context drift: early constraints get diluted by later output over a long run, causing deviation from the original architectural conventions.
- Tool calls that do not close the loop: reading, editing, and executing never form a feedback path, so errors cannot be detected automatically.
- Misreading the acceptance criteria: treating “the code looks complete” as “the feature is implemented,” and overlooking easily missed engineering details such as manifest configuration, permission declarations, and resource references.
The corresponding improvements are equally clear: make verification a mandatory step, hard-code project conventions as injectable context, and split large tasks into independently verifiable sub-goals.
4. A Practical Task-Orchestration Example
Whatever kind of AI coding tool you use, output quality on long-horizon tasks can be stabilized with outer orchestration:
task:goal: "Implement a data list page with local caching"constraints:- "Follow the existing directory structure and naming conventions"- "Do not introduce undeclared dependency versions"steps:- read_project_structure- implement_data_layer- implement_ui_layer- run_build # mandatory verification; on failure, go back one step- run_unit_checks- summarize_changesacceptance:- "Build succeeds with no blocking warnings"- "All core test cases pass"budget:max_rounds: 40max_cost: 5.0 # budget guardrail; on overrun, stop and keep intermediate artifacts
The key design elements here are the budget guardrail and mandatory verification: the former prevents a long-horizon task from consuming resources in unproductive loops, and the latter stops pass rate from depending on the model’s own discipline.
5. Scenario-Based Selection Advice
- Budget- and latency-sensitive teams: prioritize duration and cost per run, accept a lower pass rate, and position the agent as a “scaffolding generator” while humans handle final convergence and acceptance. Suited to prototype validation, internal tools, and non-critical-path features.
- Delivery-quality-first teams: prioritize pass rate, pair it with thorough automated checks and code review, and treat high duration as an acceptable cost of asynchronous work.
- Platform-building direction: integrate AI coding capability into a unified development pipeline, with containerized build environments, logging services, and monitoring and alerting, to achieve per-task cost accounting and failure attribution—avoiding situations where effectiveness cannot be explained and cost cannot be calculated.
6. Conclusion
The value of a coding benchmark built around real engineering tasks is not a leaderboard, but putting effectiveness, duration, and cost in the same table. For developers, the rational approach is to first clarify their own sensitivity to pass rate and cost, then choose the matching capability tier, and use outer orchestration plus budget guardrails to compensate for the model’s stability gaps on long-horizon tasks. In related practice at Baidu AI Cloud, building a measurable development loop on top of general capability categories (such as container platforms, logging services, and monitoring and alerting) is also recommended, so that every AI coding investment has a clear basis in both output and cost.
