Android AI Agent Evaluation: Trading Off Quality, Runtime, and Cost

    A practical breakdown of a public Android AI coding-agent leaderboard, explaining what pass rate, average completion, runtime, and cost per run really measure, why high-completion runs take so long and cost so much, the statistical traps of small task sets, and how to build a reproducible evaluation platform with tiered routing and cost guardrails.

    From “Writing Correct Code” to “Delivering a Project”

    The usual way to assess coding models has been to check whether they can complete a function, explain an error, or score well on online judges. These tasks have clear boundaries and instant feedback, but they don’t answer the question that matters in real work: if you hand an AI agent a task that would take an engineer several days, can it finish on its own?

    Recently, a platform published an open leaderboard for AI coding agents in Android development. Instead of focusing on single functions, it targets long-horizon tasks such as:

    • App creation: starting from requirements, generating a project skeleton that is structurally complete, buildable, and runnable;
    • Feature development: understanding architecture and dependencies in an existing codebase, then adding new features without breaking existing behavior;
    • Code migration: upgrading build configuration or dependencies, and moving the UI layer to a new programming paradigm;
    • App transformation: adapting an app’s form and capabilities, for example to large-screen or foldable display scenarios.

    These tasks routinely run for hours or even tens of hours, requiring the agent to repeatedly build, test, verify on a real device, diagnose failures, and roll back and retry. In the public results, one deep-reasoning agent configuration achieved a 24.0% pass rate and 82.3% average completion across 30 long-horizon tasks, with an average runtime of 27.4 hours and a cost of $317.4 per complete run. Another lightweight, fast model paired with an agent framework reached a 17.3% pass rate and 71.2% average completion, with an average runtime of 12.0 hours and a cost of just $9.9 per run.

    On their own, these numbers are only scores. Put together, they expose the core question of long-horizon evaluation: quality, time, and cost are bound by a hard constraint, and every selection is a tradeoff among the three. Using this leaderboard as a sample, this article unpacks what each metric means, analyzes how runtime and cost are generated, and offers engineering recommendations.

    What the Four Core Metrics Actually Measure

    Pass Rate: Counting Only What Truly Runs

    The pass rate is the share of tasks whose acceptance checks all pass, usually a binary outcome (pass or fail) that best reflects “can it really be delivered.” What matters is how “pass” is defined. A credible approach runs a deterministic acceptance script in an isolated environment, covering at least:

    • whether the project builds successfully;
    • whether all existing tests still pass (no regressions);
    • whether newly added acceptance tests for the task goal pass;
    • whether code-quality gates are met, such as no new severe issues from static checks.

    Average Completion: Capturing “How Much Was Done”

    Counting only pass/fail throws away a lot of information. A submission that “fails the build but implements the core logic” has far more engineering value than one that “builds but only writes the UI.” Average completion measures, on a continuous scale, how far a task was actually completed, revealing the gap between “one step short of delivery” and “completely wrong direction.” But completion depends on how the scoring rubric is designed, so scores under different rubrics cannot be compared directly. Read the scoring rules before reading the leaderboard.

    Average Runtime: Deciding Whether a Task Fits the Pipeline

    Runtime here means wall-clock time, the actual elapsed time from task start to verdict, including model inference, tool calls, and all build and test waits. It is an engineering metric, not a compute metric: a task that takes 27 hours cannot sit in a pre-merge gate, but it fits overnight, unattended batch processing.

    Cost per Run: Deciding Whether It Is Sustainable

    Cost per run is the cumulative spend for a full evaluation task, usually billed by actual input/output tokens consumed, with some approaches adding overhead such as tool calls. The point of measuring it is to answer one question: if these tasks were folded into a daily development workflow, what would each one cost on average?

    Reading the Metrics Together

    Using the public data (model and agent names omitted):

    Metric Deep-reasoning config Lightweight fast config
    Pass rate 24.0% 17.3%
    Average completion 82.3% 71.2%
    Average runtime 27.4 hours 12.0 hours
    Cost per run $317.4 $9.9
    Cost per passing task (run cost ÷ pass rate) ~$1322.5 ~$57.2
    • Quality: the former leads, with a pass rate 6.7 percentage points higher and completion 11.1 percentage points higher.
    • Speed: the latter runs in about 44% of the former’s time.
    • Cost: the latter costs about 3% of the former per run, and the gap widens to roughly 23x when measured as the average cost of each successfully passing task.

    So the latter’s role is not “a worse model” but a reasonable choice when cost and time budgets are tight. Commentary notes that its speed and cost advantage suits teams sensitive to budget and response time, which shows that reading the metrics always has to come back to the specific scenario.

    The Engineering Tradeoffs Behind High Completion and Long Runtime

    Quality Comes from the Verify-Fix Loop, Not From Getting It Right First Time

    On long-horizon tasks, the probability of generating a correct, complete solution in a single pass is very low, so quality depends mainly on the ability to iterate and repair. A typical loop is: generate or edit code, run the build and tests, parse the errors, find the root cause, fix, and retry. Higher completion often means more iteration, such as proactively adding edge-case handling, running on-device verification, and fixing regressions.

    But iteration is capped by two limits:

    • longer context means higher inference cost;
    • more tool calls mean longer serial waits.

    Together they push up both runtime and cost, forming a structural conflict between quality and efficiency.

    Where the Long Runtime Comes From

    Average runtime can be roughly decomposed into three parts:

    1. Average runtime ≈ effective work (reading code, writing changes)
    2. + verification waits (build, unit tests, on-device tests)
    3. + rework overhead (failed retries, context compaction, tool retries)
    • Deep-reasoning config: to pursue higher completion, it tends to explore more thoroughly, verify repeatedly, and proactively refactor, turning “rework overhead” into quality. But verification waits (such as builds and on-device tests) happen serially and can’t be fully eliminated through parallelism, which is the rigid floor on runtime.
    • Lightweight fast config: it tends to take shorter paths with less exploration and rework, so it is faster and cheaper, but some “almost-there” tasks are left on the failing side.

    Why Cost Balloons: A Simplified Accumulation Model

    Let the input context size at inference round k be C_k and the output tokens be O_k, with input and output unit prices p_in and p_out. Total cost can be approximated as:

    1. Cost ≈ Σ ( C_k × p_in + O_k × p_out )

    In long-horizon tasks, context accumulates across rounds. If we approximate it as C_k = C₀ + k·ΔC, then the input portion alone is roughly:

    1. Σ C_k × p_in ≈ N·C₀·p_in + N(N+1)/2 · ΔC·p_in

    where N is the number of inference rounds. This is a quadratic function of N: doubling the rounds makes input cost roughly four times as large. Add failed retries and tool round-trips, and the real cost often grows faster than intuition suggests. Context compaction and summarization can lower ΔC, but compression itself consumes tokens and may drop key details, causing rework.

    So “high completion, long runtime” is neither more nor less cost-effective in itself; it simply spends cost on deeper iteration. Whether that is worth it depends on how sensitive the task is to quality.

    Decide on the Margin, Not the Average

    Average metrics describe the overall level, but marginal changes are what actually drive decisions. Roughly converting from the public data:

    • Comparing deep vs. fast: the pass rate rises 6.7 percentage points, while cost per run grows about 32x and average runtime about 2.3x.
    • Comparing against a higher-pass-rate tier (only pass rate is comparable; estimated from the midpoint of two ranges): the pass rate rises another ~4.7 percentage points, with cost per run up about 2.1x.
    • Marginal cost: for each 1-percentage-point gain in pass rate, the first upgrade costs about $46.2 more, and the second about $23.1 more.

    Two conclusions follow:

    • whether this level of cost is acceptable depends on the real business cost of a single failed task;
    • when resources are limited, deepening a single tier’s configuration may pay off less than expanding task coverage or strengthening acceptance quality.

    Borrow the Methodology, Not the Conclusions

    Statistical Pitfalls with Small Samples

    Long-horizon evaluations commonly face limited task-set sizes. Take 30 tasks with pass rates of 24.0% and 28.7% as an example; their 95% confidence intervals (Wilson intervals, method in the code below) are:

    Pass rate Approx. passing items 95% confidence interval
    24.0% ~7/30 ~11.8% – 40.9%
    28.7% ~9/30 ~16.7% – 47.9%
    17.3% ~5/30 ~7.3% – 33.6%

    The three intervals overlap heavily. In other words, at a scale of 30 tasks, the differences among these scores cannot yet be judged statistically as real gaps. Three practical recommendations follow:

    • Report dispersion alongside the mean: include run-to-run variance, spread, and confidence intervals so readers can judge whether differences are credible.
    • A single run is not a stable conclusion: if each configuration is run only once, the effective sample is even smaller, and results are heavily influenced by the luck of a single run, especially for tasks that take tens of hours and can’t be rerun often.
    • Favor continuous metrics like completion: to distinguish close tiers, completion can accumulate signal more easily than an all-or-nothing pass rate. But this does not remove the uncertainty from a limited task set, nor does it replace repeated runs.

    Also, 24.0% times 30 is 7.2, not an integer. This usually means the pass rate is an average over multiple runs or uses a more complex scoring method. Readers need to confirm the statistical basis to interpret the numbers correctly.

    1. import math
    2. def wilson_interval(k: int, n: int, z: float = 1.96) -> tuple[float, float]:
    3. """Compute the Wilson 95% confidence interval for k successes in n independent trials.
    4. The Wilson interval is more reliable than the normal approximation for small samples
    5. and proportions near 0 or 1, which makes it well suited to small-sample scenarios
    6. like long-horizon task evaluation.
    7. """
    8. p = k / n
    9. z2 = z * z
    10. denom = 1 + z2 / n
    11. center = (p + z2 / (2 * n)) / denom
    12. margin = z * math.sqrt(p * (1 - p) / n + z2 / (4 * n * n)) / denom
    13. return max(0.0, center - margin), min(1.0, center + margin)
    14. for k, rate in [(7, "24.0%"), (9, "28.7%"), (5, "17.3%")]:
    15. lo, hi = wilson_interval(k, 30)
    16. print(f"Passed {k}/30 ({rate}) -> 95% CI [{lo:.1%}, {hi:.1%}]")

    Same Model, Different Agent: Results Are Not Directly Comparable

    The same model paired with different agent frameworks decomposes tasks, calls tools, and manages context differently, so scores can differ markedly. In the public data, the fast model paired with an agent framework and the deep-reasoning model paired with its own agent framework are already two different “model + agent” combinations. Therefore:

    • compare model capabilities under the same agent shell;
    • compare agent frameworks with the model version and environment held fixed.

    Scores Are an Environment Snapshot with a Shelf Life

    Leaderboard results are a snapshot at a specific point in time, and any of the following changes can affect scores:

    • a model version update;
    • a toolchain upgrade, such as build tools, OS versions, or test frameworks;
    • changes to the task set;
    • changes to evaluation prompts and run parameters.

    Conclusions must come with version and environment information and be re-checked periodically.

    Building a Reproducible Evaluation Platform on General Cloud Capabilities

    A leaderboard’s real value is its methodology. A team that wants to reproduce a similar evaluation on its own codebase and business scenarios can build it in five stages. General-purpose infrastructure from cloud platforms such as Baidu AI Cloud (container services, object storage, logging services, monitoring and alerting, and so on) can support this workflow.

    Task Definition: Favoring Decidability

    Each task needs the following:

    • a clear input (a requirement or defect description);
    • an initial code state (a pinned version);
    • automatically decidable acceptance criteria.

    Tasks should be stratified by difficulty: from “fix a known defect” to “add a cross-module feature,” then to “migrate or transform.” Only after stratification can you see how different configurations perform at each difficulty level.

    1. task_id: feature-offline-cache-017
    2. layer: 2 # Difficulty layer: 1 single-point fix / 2 in-module feature / 3 cross-module feature
    3. repo_ref: example-android-app@sha256:3f9c... # Pinned code snapshot
    4. prompt_file: prompts/offline-cache.md # Requirement description and acceptance notes
    5. budget:
    6. wall_clock_hours: 4 # Wall-clock time cap
    7. max_tool_calls: 800 # Max tool calls
    8. max_cost_usd: 5.0 # Cost cap; abort and mark as failed when exceeded
    9. environment:
    10. image: android-ci:2026-08 # Fixed image tag; build artifacts archived to object storage
    11. network: restricted # Only internal dependency mirrors allowed; blocks uncontrolled downloads
    12. acceptance:
    13. build: ["./gradlew", "assembleDebug"]
    14. unit_tests: ["./gradlew", "testDebugUnitTest"]
    15. instrumentation: ["./gradlew", "connectedDebugAndroidTest"]
    16. regression_guard:
    17. forbidden_paths: ["app/src/test/**"] # Acceptance tests must not be modified
    18. quality_gate:
    19. lint_severity_max: warning # No new error-level issues allowed

    Environment Isolation: Ensuring Fairness, Safety, and Reproducibility

    All evaluations should run in disposable containers that meet these requirements:

    • Consistent runtime: use fixed-version OS images, build tools, and dependency caches, so configurations differ only at the model and agent level;
    • Restricted network: allow access only to the necessary internal dependency sources, preventing the agent from pulling in code or dependencies of unknown origin;
    • Least privilege: inject no real secrets or production credentials, and prohibit access to production resources;
    • Full traceability: archive code changes, build and test logs, and runtime and cost data to object storage as an auditable execution record.

    Acceptance Judging: Preventing “Passing for the Sake of Passing”

    Automated acceptance must guard against the following gaming behaviors:

    • an agent deleting or skipping tests just to make them pass;
    • loosening quality gates;
    • modifying the acceptance tests themselves.

    You can intercept these by verifying test-file hashes, detecting changes to build scripts and gate configuration, and comparing the scope of changes to task-related files. UI automation tests are affected by device state and can be flaky, so configure retry policies and periodically remove or fix unstable cases.

    1. from dataclasses import dataclass
    2. import time
    3. @dataclass
    4. class Verdict:
    5. passed: bool
    6. completion: float # 0~1, weighted by acceptance stage
    7. elapsed_sec: float
    8. cost_usd: float
    9. reason: str = ""
    10. # Example stage weights: build is a baseline gate, core functionality weighs the most
    11. WEIGHTS = {"build": 0.2, "unit": 0.3, "ui": 0.3, "quality": 0.2}
    12. def judge(env, task, snapshot, original_test_hashes, start, guard) -> Verdict:
    13. """Single verdict entry point: all configs go through the same acceptance logic for comparability."""
    14. elapsed, cost = time.monotonic() - start, snapshot.cost_usd
    15. # 1) Anti-gaming: acceptance tests unchanged, edits within scope
    16. if not guard.tests_intact(snapshot, original_test_hashes):
    17. return Verdict(False, 0.0, elapsed, cost, "Acceptance tests were modified")
    18. if guard.violates_scope(snapshot, task):
    19. return Verdict(False, 0.0, elapsed, cost, "Changes exceed task scope")
    20. # 2) Staged acceptance: award points per passed stage to compute completion
    21. results, score = {}, 0.0
    22. for stage in WEIGHTS:
    23. results[stage] = env.run_check(stage, snapshot) # e.g. build, unit tests, UI tests, quality gate
    24. if results[stage]:
    25. score += WEIGHTS[stage]
    26. # 3) Budget guardrail: exceeding limits means automatic failure; cost is counted along with the failure
    27. passed = all(results.values()) and guard.within_budget(elapsed, cost, snapshot.calls)
    28. reason = "ok" if passed else f"Failed stages: {[k for k, v in results.items() if not v]}"
    29. return Verdict(passed, score, elapsed, cost, reason)

    Scheduling and Cost Guardrails: Keeping Evaluation Under Control

    • Set wall-clock time, tool-call count, and cost caps for each task; exceeding any one aborts and records a failure.
    • Set an overall budget cap based on spend aggregated by day or by task queue, and use monitoring alerts to warn when approaching the threshold.
    • Adjust concurrency dynamically to quota, avoiding running many long tasks at once and starving the evaluation environment of resources.

    Observability and Repeated Runs

    Feed per-stage runtime, token consumption, tool-call counts, and failure reasons into logging services and monitoring alerts to form a traceable evaluation record. Important conclusions should come from at least several independent runs, reporting mean, variance, and confidence intervals, rather than ranking on a single run.

    Optimizing Agents: Letting Fast and Deep Tiers Do Their Own Jobs

    Tiered Routing for “Fast When It Should Be Fast, Deep When It Should Be Deep”

    Rather than using one configuration across the whole workflow, route by task characteristics:

    • simple single-point fixes, formatting, and dependency upgrades go to the lightweight fast configuration;
    • complex cross-module features and migration tasks go to the deep-reasoning configuration;
    • escalate from fast to deep when the fast tier fails repeatedly and budget allows.
    1. FAST, DEEP = "fast", "deep"
    2. def choose_tier(task, budget) -> str:
    3. """Choose the execution tier by task complexity and live budget."""
    4. if task.layer <= 1:
    5. return FAST # Prioritize speed and cost for single-point tasks
    6. if budget.spent_today / budget.daily_cap > 0.8:
    7. return FAST # When budget is tight, prioritize coverage breadth
    8. return DEEP if task.layer >= 3 else FAST
    9. def run_with_cascade(task, budget):
    10. """Cascade scheduling: escalate to the deep tier when the fast tier fails and budget allows."""
    11. plan = [FAST, DEEP] if choose_tier(task, budget) == FAST else [DEEP]
    12. results = []
    13. for tier in plan:
    14. if not budget.can_start(tier):
    15. break
    16. v = execute_in_sandbox(task, tier, budget) # Execute in an isolated environment
    17. budget.record(v)
    18. results.append((tier, v))
    19. if v.passed:
    20. return v
    21. # When all attempts fail, return the highest-completion one for human intervention
    22. return max(results, key=lambda x: x[1].completion)[1]

    Improving the Fast Tier’s Cost Efficiency

    • Control context size: retrieve task-relevant code snippets instead of stuffing the whole repo into context, and produce structured summaries of long history to lower ΔC in the cost model above.
    • Raise single-pass success: supply team knowledge such as architecture notes, build and test commands, and coding standards to reduce trial-and-error exploration.
    • Strengthen verification feedback: passing structured failure information back to the agent (error location, failing cases, log snippets) reduces blind rework more than returning a bare “failed.”
    • Reserve a rollback path: make changes on an isolated branch and discard them if verification fails, keeping the mainline clean and lowering manual cleanup cost.

    Calibrating Expectations: Failure Shapes Beyond Pass Rate

    For fast-tier tasks, treat “insufficient pass rate” as expected and design fallback mechanisms:

    • add human review on critical paths;
    • rank failed results by completion so engineers take on near-finished tasks first;
    • categorize repeatedly failing task patterns and feed them back to improve prompts, task decomposition, or the toolchain.

    Choosing by Scenario: A Decision Table

    Scenario Typical traits Recommended tier Key metrics
    Merge gate, pre-commit checks High frequency, real-time, low failure cost Lightweight fast tier Response latency, cost per run
    Overnight batch migration and upgrades Low-frequency batches, queueable, auto-verifiable Deep-reasoning tier (with budget guardrails) Pass rate, completion
    Interactive assisted development Human in the loop, instant feedback Lightweight fast tier, escalate to human when needed Response latency, acceptance rate
    Exploratory prototyping Vague requirements, frequent trial and error Start fast, escalate on failure Cost per passing task, iteration speed
    Critical-path delivery High failure cost, strict acceptance Deep tier plus human review Pass rate, regression rate

    Conclusion

    An Android AI agent evaluation isn’t really answering “which model is stronger,” but “under what budget and time constraints can a given combination complete tasks at an acceptable failure rate.” High completion usually comes with high runtime and high cost, an inevitable result of the verify-fix loop on long-horizon tasks, while lightweight fast solutions trade some quality for a significant advantage in cost and speed, a rational choice in the right scenario.

    When facing a leaderboard, readers are advised to do three things:

    1. Understand the metric definitions and environment versions;
    2. Focus on dispersion, not a single score;
    3. Reproduce the evaluation on your own task set.

    On that basis, use tiered routing, budget guardrails, and strict acceptance to turn evaluation conclusions into sustainable engineering practice.