Coding Agents Controlling Robots: Pinpointing Failures Across 1,156 Tasks with Three Evaluation Methods
This article describes an evaluation framework for coding agents that generate control code for robots. It covers how a suite of 1,156 tasks is organized, how static code review, simulation, and real-robot testing each check different failure modes, and how step-level trace analysis attributes a failure to a specific step. It also outlines how to build a similar evaluation pipeline.
Writing code for a robot that operates in the physical world is hard to test. Traditional software tests check return values and interface states. A robot control task is different. An agent must generate code, call tools, and handle sensor feedback in a physical environment that cannot be fully predicted, and a failure can occur at any of these steps. With 1,156 tasks and 456 high-difficulty core tasks, we need an evaluation system that can locate a failure at each step.
1. Background and Core Challenges
Robot control is a closed loop of perception, decision-making, and execution. A coding agent receives instructions in natural language or through a programming interface, then generates control scripts that drive robotic arms, mobile bases, dexterous hands, and other hardware to complete a task. This approach is flexible, but its weaknesses are clear. Is the generated code valid? Does the sequence of actions satisfy physical constraints? Can it withstand disturbances in a real environment?
Evaluation faces three main challenges:
- Task diversity: Tasks range from grasping and transport to a humanoid robot hitting a volleyball over a net. The task types differ widely, so a unified but extensible set of metrics is required.
- Execution uncertainty: Both simulated and real hardware environments contain noise. The same code can produce different results on different runs, so multiple samples and statistical evaluation are needed.
- Complex failure attribution: A task can fail because of a perception error, a decision error, an actuator fault, or a logic defect in the code. Without fine-grained records, it is hard to tell which step caused the problem.
For this reason, an evaluation system should not produce only a single overall score. It should make every failure traceable to a specific action, a specific line of code, and a specific point in time.
2. The Task Suite: From Scale to Layered Coverage
The evaluation starts with the task suite. All 1,156 tasks cover categories such as navigation, object grasping, tool use, multi-robot collaboration, and athletic competition. The tasks are not a simple collection. They are layered by their subtask structure:
- Basic tasks: A single action, such as “move to a specified coordinate.”
- Composite tasks: Two or three subactions performed in sequence, such as “navigate to the table, then grasp the cup.”
- High-difficulty core tasks: 456 tasks selected from the full suite. They require multi-step reasoning, adaptation to dynamic environments, and exception handling. An example is “identify the ball’s position while moving and hit it accurately over the net.”
Each task definition should include four elements:
- Natural language instruction: The input to the agent, which may contain ambiguity or omissions.
- Initial state: The robot’s starting position, object positions, and environment parameters.
- Success criteria: Quantifiable conditions for success, such as “the ball lands in the opponent’s court.”
- Constraints: Rules such as no collisions, no timeouts, and no use of specific sensors.
The task suite must support dynamic expansion. As agent capabilities improve, new edge cases can be added so the evaluation set is not memorized. For the high-difficulty core set, perturbed versions are recommended, such as changed lighting, added obstacles, or a lower control frequency, to test robustness.
3. Three Evaluation Methods: Layered Verification Boundaries
No single evaluation method covers everything. Static code checks cannot observe the physical world. Pure simulation suffers from the sim-to-real gap. Real-robot testing is expensive and carries risk. Therefore, we use three evaluation methods that check each other across different levels of abstraction.
1. Static Code Review
This is a white-box evaluation method. The control code generated by the agent first passes through a series of static checks:
- Syntax and type checks: Detect undefined variables, type mismatches, and invalid parameters.
- Interface contract checks: Verify that the motion control interfaces being called have the appropriate permissions and control ranges. For example, joint angles must stay within physical limits.
- Resource safety checks: Verify that loops have exit conditions, memory does not grow continuously, and sensor sampling frequency is reasonable.
- Code style checks: Verify that names are clear and that key execution paths are documented with comments.
Static review is the fastest method and suits large-scale scanning. It can find obvious logic defects, but it cannot verify real motion. For example, if the code contains “wait until the ball reaches the designated area, then strike,” static review can confirm that the syntax is correct, but it cannot guarantee that the ball will actually be hit.
2. Simulation Execution
In simulation, the agent connects to an interactive physics environment and runs the task in real time or accelerated time. During the run, the evaluation system records each step’s commands, robot poses, and sensor readings, and calculates success metrics.
Simulation is low-cost, repeatable, and can run in parallel. For example, the same task can run 100 times to estimate the success rate from samples. To approximate real conditions, the simulation environment needs noise models for sensor error, actuator latency, and changes in friction. High-difficulty tasks can also include dynamic obstacles, requiring the agent to replan during the run.
Simulation is suited to full regression testing of the 456 core tasks. When a run fails, the system can automatically export the complete trajectory so developers can reproduce the failure.
3. Real-Robot Physical Validation
A task that passes static review and simulation does not yet prove real-world capability. Real-robot testing runs only on physical hardware with real sensors and actuators. It is most useful for exposing two types of problems:
- Sim-to-real gap: The simulation models physical parameters imprecisely, so an action that succeeds in simulation cannot be reliably reproduced on the real robot.
- Hardware state differences: Battery level, joint wear, floor friction, and communication latency all affect the final result.
Real-robot validation is expensive, so representative tasks are typically sampled from the 456 core tasks. For safety, teams first run a “pre-validation” in low-speed mode or with human assistance. Full autonomous mode is enabled only after the agent’s outputs have proven stable. The evaluation system must record hardware logs, control frequency, and the causes of any interruptions, so every real-robot run can be traced.
The three methods do not form a simple sequence of filters where a task must pass each one in turn. Together they form a three-dimensional evaluation matrix:
| Task | Static Code Review | Simulation | Real Robot |
|---|---|---|---|
| Task A | Pass | 80% success rate | Not run |
| Task B | Warning | Fail | Not run |
| Task C | Pass | Pass | Success |
Comparing the same task across methods shows quickly whether a failure comes from the code or from the environment.
4. Locating Failures at Each Step: Task Decomposition and Trace Attribution
Locating a failure at each step is the core of this evaluation system. The method is to break a high-level task into a sequence of subtasks, and to define an entry condition, a completion condition, and a failure condition for each one. Take “humanoid robot hits a volleyball over the net” as an example. It can be decomposed into:
- Move to the hitting position on the left side of the net.
- Lock onto the volleyball in view and calculate its trajectory.
- Adjust the robotic arm’s joint angles to prepare the swing.
- Execute the strike within the specified time window.
- Confirm that the ball crosses the net and lands in the opponent’s half of the court.
The evaluation system records a timestamp at the entry of each subtask. All intermediate code, sensor data, and internal reasoning produced by the agent are written to a trace log. After execution, the system compares the actual trace with the expected sequence of subtasks.
If the task fails at subtask 3, the system narrows down the cause:
- Perception layer: Did the system fail to identify the ball’s position?
- Decision layer: Did the computed joint angle exceed its limit?
- Execution layer: Did the arm physically reach an angle different from the command?
- Code layer: Did the generated control code return an abnormal value at a critical moment?
The attribution process follows this sequence: read the trace log, find the last completed subtask, analyze the inputs and outputs of the failed subtask, and generate a readable failure summary. Developers do not need to read through the full log from the beginning. They can get a conclusion such as “Step 3 failed. Cause: the commanded elbow joint angle was 170 degrees, which exceeds the 155-degree limit.”
Below is a simplified pseudocode example of trace recording:
def record_step(task_id, step_index, observation, action, result):log_entry = {"task_id": task_id,"step_index": step_index,"step_name": task["subtasks"][step_index],"observation": observation,"action": action,"result": result,"timestamp": now()}trace.append(log_entry)if result != "success":return diagnose(step_index, log_entry)return None
This level of detail is useful beyond evaluation. During agent training, it can help developers identify problems such as preference collapse or ambiguous prompts.
5. Practical Guide: Building Your Own Evaluation Pipeline
To implement this approach, you can follow these steps:
- Define the task specification: Describe tasks, subtasks, success criteria, and constraints in a unified format. Store task files in version control so they are easy to review and update.
- Wrap the agent in an interface: Package the coding agent as a callable function that takes a task definition and returns control code or an action sequence.
- Build three evaluation runners: Handle static review, simulation runs, and real-robot runs separately. All three should share the same log structure so the data formats are consistent.
- Design a failure attribution module: Automatically identify the failed subtask from trace logs, then classify the cause using a rule engine or statistical methods.
- Generate evaluation reports: Reports should include task success rate, static check pass rate, simulation success rate, real-robot success rate, and a distribution of failures grouped by cause.
A simple evaluation driver looks like this:
def evaluate(agent, task, modes):report = {"task_id": task["id"],"modes": {},"failure_steps": []}for mode in modes:if mode == "static":report["modes"][mode] = run_static_checks(agent.code, task)elif mode == "sim":report["modes"][mode] = run_sim_episodes(agent, task, num_episodes=20)elif mode == "real":report["modes"][mode] = run_real_episodes(agent, task, num_episodes=3)for failure in report["modes"][mode]["failures"]:report["failure_steps"].append(failure)return report
This pipeline can run locally at small scale or be extended to the cloud. Container platforms and message queues can distribute tasks, and logs can be collected in a unified monitoring and alerting system. Evaluation results should serve as the gate for agent iteration. Only tasks that pass static review and simulation coverage should be scheduled for real-robot execution.
6. Conclusion
Evaluating coding agents that command robots is not a one-time exam. It is a lifecycle activity that runs through development, testing, deployment, and maintenance. The 1,156 tasks and 456 high-difficulty core tasks provide a solid sample base. The three evaluation methods check each other across code, simulation, and physical hardware. Locating failures at each step turns an abstract success rate into concrete guidance on what to fix next. Developers get more than a score sheet. They get a roadmap that shows where to make the next change.
When an agent can reliably generate code, execute actions, and correct its own errors in complex embodied tasks, we can say it has passed the exam.
