CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation
Max Fu, Justin Yu, Karim El-Refai, Ethan Kou, Haoru Xue, Huang Huang et al. · 2026 · 199 citationsRead the paper
"Code-as-Policy" considers how executable code can complement data-intensive Vision-Language-Action (VLA) methods, yet their effectiveness as autonomous controllers for embodied manipulation remains underexplored. We present CaP-X, an open-access framework for systematically studying Code-as-Policy agents in robot manipulation. At its core is CaP-Gym, an interactive environment in which agents control robots by synthesizing and executing programs that compose perception and control primitives. Building on this foundation, CaP-Bench evaluates frontier language and vision-language models across varying levels of abstraction, interaction, and perceptual grounding. Across 12 models, CaP-Bench reveals a consistent trend: performance improves with human-crafted abstractions but degrades as these priors are removed, exposing a dependence on designer scaffolding. At the same time, we observe that this gap can be mitigated through scaling agentic test-time computation--through multi-turn interaction, structured execution feedback, visual differencing, automatic skill synthesis, and ensembled reasoning--substantially improves robustness even when agents operate over low-level primitives. These findings allow us to derive CaP-Agent0, a training-free framework that recovers human-level reliability on several manipulation tasks in simulation and on real embodiments. We further introduce CaP-RL, showing reinforcement learning with verifiable rewards improves success rates and transfers from sim2real with minimal gap. Together, CaP-X provides a principled, open-access platform for advancing embodied coding agents.
What the full text shows
Working prototype- Human expert-written programs outperform all 12 tested frontier models in single-turn, zero-shot settings. — 88.5% average single-turn success for humans (S4 tier (lowest abstraction), single-turn, zero-shot)
- Task success rates increase monotonically as primitive abstraction increases. (Across 12 models in CaP-Bench)
- Multi-turn interaction with textual execution feedback (stdout/stderr) improves performance over single-turn execution. (M1 feedback type vs S2 baseline)
- Interleaving raw RGB observations during multi-turn interaction degrades performance compared to text-only feedback. (M2 feedback type vs M1 baseline)
- CaP-Agent0 recovers near human-level reliability without task-specific training. (Simulation and real embodiments)
- CaP-RL improves success rates and enables sim-to-real transfer. (Using reinforcement learning with verifiable rewards via GRPO)
- Setup
- 12 frontier language and vision-language models; human baseline consisting of 7 authors with 2+ years of robotics experience; integration of Robosuite, LIBERO-PRO, and BEHAVIOR.
- How
- The researchers developed CaP-Gym (interactive environment) and CaP-Bench (evaluation framework) to test models across different abstraction tiers and interaction modes. They implemented CaP-Agent0 for training-free agentic reasoning and CaP-RL for fine-tuning via GRPO on physics-simulation outcomes.
- Limitations
- Performance degrades significantly as human-crafted abstractions are removed · Raw visual inputs (RGB) during multi-turn reasoning cause a cross-modal alignment gap, degrading performance
Summarized by Gemma 4 from the open-access full text · 26 Nov 2026. Read it