Mobile AI Coding Benchmarks: Evaluating Long-Horizon Tasks, Cost, and Efficiency

    This article explains how mobile AI coding evaluation is shifting from code completion to end-to-end task delivery. It covers the four core metrics for long-horizon tasks, how to read them together, how to build an internal benchmark, and how to isolate, observe, and roll back AI-generated changes. It also covers strategies for controlling cost and latency across the task lifecycle.

    Mobile AI coding evaluation is moving from code completion toward end-to-end task delivery. In a recent public benchmark update, the metrics drawing the most attention were long-horizon task pass rate, average completion, wall-clock time per run, and cost per run. Some tested solutions improved their pass rate noticeably over their predecessors while reducing time and cost per run. A lightweight solution completed a single test round at very low cost, but its pass rate was relatively limited. The leading solutions passed roughly 40% of tasks.

    These signals should not be read as a ranking of which product is best. They are more useful as input for building an evaluation framework. For development teams, the key questions are how to measure AI coding capability with a reproducible benchmark, and how to balance quality, latency, and cost in real engineering work.

    1. Why long-horizon tasks are the dividing line

    Mobile development tasks are rarely single-file completions. They are end-to-end deliveries that span files and modules. The work includes understanding requirements, analyzing dependencies, modifying code, building and running the app, fixing failing tests, checking compatibility, and adjusting permissions and configuration. A failure at any step can cause the whole task to fail. Even a high accuracy rate for single-point code generation does not mean the output is ready to ship. This is why long-horizon tasks have become the dividing line in evaluation.

    A long-horizon task can be defined as follows: given a requirement description and a repository snapshot, the AI coding system must make changes in an isolated environment, run tests, and fix failures based on the test output, until the tests pass or the budget limit is reached. Evaluation covers at least four metrics:

    • Strict pass rate: whether the task was fully delivered.
    • Average completion: partial progress on tasks that did not fully pass.
    • Wall-clock time per run: the interaction efficiency.
    • Comprehensive cost per run: the combined cost of tokens, call counts, and sandbox resources.

    These four metrics must be observed across the same task distribution. Looking only at pass rate or only at low cost leads to a one-sided conclusion.

    2. Reading the four core metrics and their relationships

    Pass rate is a strict metric. It equals the number of passed tasks divided by the total number of tasks. It measures end-to-end delivery capability, but it is highly sensitive to the difficulty distribution of the tasks. If a benchmark contains many easy tasks, the pass rate is inflated. If it contains many long-tail tasks, the pass rate drops quickly. When reading public results, check the task categories, difficulty tiers, and statistical confidence intervals.

    Completion is a process metric. It is usually based on the proportion of tests passed, the hit rate of key steps, or partial scores from the grader. It shows how far a system got on tasks it did not finish. High completion with low pass rate means the system gets close to the goal but lacks the ability to finish. Low completion with high pass rate may mean the tasks are too simple or the grader is too lenient.

    Time and cost are engineering metrics. Wall-clock time affects how long developers wait and how many tasks a pipeline can process. Cost affects whether large-scale evaluation and daily use are practical. Two derived metrics give a more realistic picture than averages: cost per pass, which equals total cost divided by passed tasks, and time per pass, which equals total time divided by passed tasks.

    Cost and quality usually follow a Pareto relationship. Lightweight solutions suit low-complexity tasks, high concurrency, draft generation, and initial fault localization. Complex tasks need stronger reasoning, longer context, and more tool calls. Engineering teams should avoid using a single model for every task. A better approach is tiered routing: send lightweight tasks to low-cost solutions first, then escalate to stronger solutions when a task fails or its complexity rises.

    3. From public signals to an internal benchmark

    Public benchmarks are useful references, but they cannot replace internal evaluation. Codebase size, dependency systems, test coverage, and business constraints differ widely between teams. The task distribution in a public benchmark may not match a team’s real pain points. To build an internal benchmark, follow these steps:

    1. Sample tasks. Cover categories such as dependency upgrades, UI adaptation, permission configuration, network requests, local storage, test creation, and build failure fixes. Set three difficulty tiers for each category (easy, medium, and hard), and keep a share of long-tail tasks.
    2. Isolate environments. Prepare a reproducible repository snapshot, dependency cache, and isolated runtime for each task. Block access to unnecessary external networks, and record an allowlist of tool calls with minimum permissions.
    3. Design graders. Rely mainly on automated tests and use manual review as a supplement. For tasks that cannot be judged fully automatically, define checks on key artifacts and structured scoring rules.
    4. Run multiple trials and compute statistics. Run each task several times. Report pass rate, variance, and confidence intervals so that a single run’s fluctuation is not mistaken for a difference in capability.
    5. Version everything. Version the task set, graders, dependency mirrors, and run parameters so that past results can be traced and reproduced.

    The following pseudocode illustrates the calculations:

    1. Record structure: task ID, category, difficulty, passed (yes/no), completion, duration, cost, retry count
    2. Aggregation:
    3. pass_rate = passed_tasks / total_tasks
    4. avg_completion = sum(completion) / total_tasks
    5. cost_per_pass = total_cost / max(passed_tasks, 1)
    6. time_per_pass = total_duration / max(passed_tasks, 1)
    7. stability = 1 - standard_deviation(pass results)
    8. Output:
    9. Summarize by category and difficulty, and report sample size and confidence intervals

    4. Engineering implementation: isolation, observability, and rollback

    For long-horizon tasks, the core engineering goal is control. First, isolation: run each task in its own sandbox, restrict network, filesystem, and system call permissions, and keep generated code from affecting the host environment. Second, observability: record prompts, tool calls, patch contents, test output, resource consumption, and failure causes to create an auditable trail. Third, rollback: save every change as an incremental patch, roll back automatically when a task fails, and apply lock files and supply chain checks to dependency changes.

    For large-scale evaluation, teams can use general-purpose infrastructure such as the container platform, object storage, log service, and monitoring and alerting from Baidu AI Cloud to build an isolated evaluation pipeline. Teams that already have similar infrastructure can reuse it. The platform itself matters less than standardizing task scheduling, environment preparation, result collection, and alert integration.

    5. Cost and latency optimization

    Reducing the cost of long-horizon tasks cannot rely only on lowering the price per call. Teams should optimize across the task lifecycle:

    • Model routing: Handle lightweight tasks with low-cost solutions first. Escalate when a task fails repeatedly or when its complexity score exceeds a threshold.
    • Context compression: Keep only the files, logs, and test output related to the current failure, which reduces irrelevant context.
    • Cache reuse: Cache dependency installs, build artifacts, and static check results, and define an invalidation policy.
    • Early stopping: When tests keep failing for the same reason, stop early and hand the task to a human or a stronger solution.
    • Test-driven repair: Require the system to locate the failing test first, then generate a minimal patch. This reduces the regression risk of large-scale rewrites.

    6. Risk and governance

    When AI coding moves into long-horizon tasks, the risks extend beyond whether code is syntactically correct. Teams must also ask whether the code is secure, compliant, and maintainable. Key concerns include the licensing of generated code, dependency supply chain security, leakage of sensitive data, permission overreach, and untraceable changes. Governance measures include tool-call allowlists, network egress restrictions, artifact auditing, human review, regression test gates, and cost budget caps. Metrics support decision-making, but they do not replace engineering judgment.

    Overall, the latest mobile AI coding benchmark update points to a clear trend. Evaluation is shifting from single-point generation to end-to-end delivery, and from a single accuracy number to a combined view of quality, latency, and cost. Teams should use public results as a reference point and internal benchmarks as the standard for their own decisions. They should build isolated, observable, and reversible evaluation pipelines, and use tiered routing and lifecycle optimization to introduce AI coding into real development workflows with confidence.