PyRUA-Dex: Learning Programmatic Policies for Dexterous Bimanual Manipulation with Coding Agents

Feixiang Ruan, Guodong Lv, Kewei Zhang, Wenbo Huang, Yintianrun Zhang, Qiang Wang, Ruiyang Si, Shunyu Yang, Shulong Jiang, Weicheng Duan, Rui Ni, Jianxin Bi, Lekai Wang, Yuze Fan, Haobo Li, Zeliang Fu, Jiankun Zhang, Duomin Wang, Enze Xie, Daquan ZhouarXiv 2026

TL;DR

Teaching multi-fingered robotic hands to do delicate tasks usually requires thousands of painstakingly recorded human demonstrations. PyRUA-Dex throws out the training data entirely: instead, a team of AI coding agents experiments in simulation to write, debug, and refine standalone Python scripts that control the hands. Once written, these lightweight programs run at the robot's native control speed—playing piano, writing calligraphy, and beating state-of-the-art neural networks without spending a single LLM token at test time.

PyRUA-Dex at a glance: two-stage code learning in simulation, benchmark performance, diverse robot hands, and real-world piano playing.

What Problem Does This Paper Address?

Right now, the dominant recipe for robotic manipulation is imitation learning: record humans teleoperating a robot, then train a large neural network (like a Vision-Language-Action model) to mimic them. For simple parallel-jaw grippers, this works great. For dexterous, multi-fingered hands with up to 22 degrees of freedom (DoF), it hits a wall. Human video retargeting is sloppy, VR teleoperation lacks force feedback when fingers make contact, and hardware exoskeletons don't scale. Plus, neural policies trained on scarce data tend to fall apart the moment lighting changes or an object shifts slightly.

Meanwhile, using LLMs or coding agents to control robots live during a task burns millions of tokens per episode and moves far too slowly. The authors ask: can coding agents figure out a dexterous task once during development, and hand over a fast, reliable Python program that runs completely on its own?

Methods

PyRUA-Dex turns policy learning into a two-stage software engineering problem in simulation, powered by general coding agents (GPT-6 Astra CLI sessions). Rather than outputting raw motor torques, agents write code using a unified codebox—an auto-generated library of primitives built from any robot's description file that groups joints functionally (bend, curl, spread), locates objects via calibrated cameras and SAM 3 segmentation, and checks grasp success using fingertip tactile sensors and joint lag.

Overview of PyRUA-Dex's two-stage Exploration and Refinement pipeline.
  1. Stage 1: Exploration (Finding a solution). Eight agents work in parallel on a task. Crucially, they can checkpoint and rewind the simulator state up to eight times per layout, letting them rapidly retry tricky grasps without re-running the whole episode. They log working snippets to a curated shared memory. Finally, a distilling agent condenses the best attempts into a modular task library and a single staged Python program.
  2. Stage 2: Refinement (Making it robust). Because a 5-stage task where each stage is 80% reliable yields only a 33% overall success rate ($0.8^5$), one agent systematically stress-tests the program across hundreds of randomized layouts. It identifies the weakest stage (the bottleneck), opens failing scenes interactively to patch the code, and keeps revisions only if they hold up on unseen validation layouts.

For real-world deployment, the authors build a calibrated simulation of their dual-arm, 22-DoF hand setup (real-to-sim), run the frozen Python policy on hardware (sim-to-real), and feed physical discrepancies back into the simulator for another round of refinement.

Datasets

Because PyRUA-Dex learns zero-shot from trial and error in simulation without human demonstrations, no training datasets are used (though baseline comparisons use benchmark-provided teleoperated demos). Evaluation spans two existing simulation benchmarks and a real-world setup:

  • Bench2Dex: 26 bimanual tasks across 12 diverse arm–hand embodiments (6 to 22 DoF), tested under four visual and spatial perturbation channels.
  • DexJoCo: 11 tasks in MuJoCo using 16-DoF Allegro hands (without tactile maps or intermediate stage counts), tested under object randomization (rand-obj) and full camera/lighting/texture randomization (rand-full).
  • Real-World Platform: Six tasks (including cube stacking, calligraphy, and bimanual piano) on dual Franka FR3 arms with 22-DoF Sharpa Wave SE tactile hands.

Key Insights and Ideas

  • Pay for reasoning during development, not deployment: Running GPT-6 Astra online during test episodes achieves 25.6% success at the standard step budget while burning millions of tokens per run. Letting the exact same model write a frozen program offline jumps Full-channel success to 61.5%—a 2.4× improvement—at zero test-time token cost.
  • Failures are bottlenecks, not timeouts: Analyzing failed post-exploration runs revealed that only 2% actually ran out of time; 68% quit early with plenty of step budget left because a single brittle stage failed. Targeted bottleneck refinement plus retry loops directly fixes this compound-probability trap.
  • Explicit perception shrugs off visual perturbations: Neural policies degrade sharply when camera angles, lighting, or object positions shift (e.g., GR00T N1.7 drops from 39.4% to 13.2% success). Because PyRUA-Dex programs explicitly measure object geometry at the start of every episode and compute motions analytically, its success rate varies by just 4.1 percentage points across all perturbation channels.
  • Distilled code libraries unlock rapid skill transfer: Once the agents distilled a reusable two-handed "piano player" skill library, learning brand-new sheet music on the real robot dropped from multiple full exploration rounds down to 30–60 minutes of iteration.

Key Results

Bench2Dex comparison across overall score, stage completion, and execution step budgets.

Bench2Dex comparison across overall score, stage completion, and execution step budgets.
  • Bench2Dex SOTA: PyRUA-Dex achieves a leaderboard score of 72.9 (60.6% mean success rate, 82.3% stage completion), beating all 12 trained IL, VLA, and World-Action baselines—including per-task fine-tuned ME-Dex 1.5 (70.5). Refinement alone boosts the score by +13.8 points over exploration.
  • DexJoCo Dominance: Reaches 88.5% (rand-obj) and 81.0% (rand-full) success, doubling the strongest trained VLA baseline, $\pi_{0.5}$ (54.1% and 40.3%), and outperforming trained policies on every single task.
  • Real-World Dexterity: Over iterative real-to-sim-to-real rounds, simulated validation completions rose from 119/192 to 168/192, translating into frozen real-world programs that stack three cubes, open boxes via fabric loops, write "Dex" with a calligraphy brush, and play two-handed piano pieces.

Limitations and Future Work

  • Weak on sustained, delicate force control: Coding agents excel at geometry, sequencing, and timing (e.g., 99.5% vs. 32.0% on bimanual piano), but struggle with continuous slip and force modulation. Trained neural policies still win on tasks like flipping bread in a frying pan, pouring between hands, and jigsaw puzzles.
  • Coarse tactile simulation: Simulated fingertip pads respond crudely, forcing agents to infer contact mostly from motor joint lag.
  • Future directions: The authors suggest hybrid policies where Python programs hand off tricky, contact-rich phases to learned neural controllers, seeding new tasks with code libraries from different task families, and conducting large-scale, repeated-trial reliability benchmarks directly on physical hardware.

Summary updated

Abstract

Learning for dexterous manipulation is limited by the scarcity of high-quality demonstrations: retargeting from human video is imprecise, teleoperation gives no force feedback to the operator, and exoskeleton-based collection is hard to scale up. We present PyRUA-Dex, a framework that enables coding agents to develop dexterous manipulation through programmatic policy, without the need of demonstrations. The programmatic policy is developed in two stages: during exploration, multiple agents explore in parallel for task skills and ways to compose them, and a distilling agent condenses the successful attempts into a task library and one program. During refinement, this program is improved through randomized layouts for enhanced robustness and execution efficiency. In simulated environments, PyRUA-Dex achieves SOTA on Bench2Dex with a score of 72.9 and reaches 81.0% success on DexJoCo under full randomization, ahead of every trained policy on both benchmarks. In real world experiments on a bimanual platform with two 22-DoF hands, PyRUA-Dex learns to play piano, write calligraphy, and other tasks efficiently: learning a new piece from sheet music takes as little as 30 minutes. These results suggest that PyRUA-Dex is an effective framework for developing dexterous manipulation policies with coding agents in the absence of high quality dexterous manipulation demonstrations.
BibTeX
@misc{ruan2026pyrua,
  author = {Feixiang Ruan and Guodong Lv and Kewei Zhang and Wenbo Huang and Yintianrun Zhang and Qiang Wang and Ruiyang Si and Shunyu Yang and Shulong Jiang and Weicheng Duan and Rui Ni and Jianxin Bi and Lekai Wang and Yuze Fan and Haobo Li and Zeliang Fu and Jiankun Zhang and Duomin Wang and Enze Xie and Daquan Zhou},
  title = {{PyRUA-Dex: Learning Programmatic Policies for Dexterous Bimanual Manipulation with Coding Agents}},
  year = {2026},
  eprint = {2611.33144},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33144},
}
Figure