Xiaoshen Han1,2, Jiahang Cao1,2, Xinghang Li2, Tao Kong2, Hang Lai2†, Weinan Zhang1†
1Shanghai Jiao Tong University 2Xiaomi Robotics (†Corresponding authors)
Project Page | Paper (PDF) | arXiv | Video (YouTube) | Colab 3D Demo
This repository contains the official implementation of COMPASS (COMpiled Potentials for Action Selection and Steering).
COMPASS separates task reasoning from motor control. Before execution, a VLM agent compiles the instruction and the initial head-camera scene once into a stateful 3D task field over the policy's action space. At run time, the field tests every action chunk proposed by a frozen visuomotor policy on CPU: admissible chunks are executed, deviations are corrected by bounded gradient descent with detours out of local minima, and contact-rich manipulation is left to the policy inside each target's policy workspace
The core library depends only on numpy and scipy, runs on CPU and needs no GPU or robot hardware (Python 3.10 or newer). The commands below create an environment with uv, install the package and run the unit tests. With plain pip, replace the first two lines with python -m venv .venv && .venv/bin/pip install -e ".[dev]".
uv venv
uv pip install -e ".[dev]"
.venv/bin/pytest
notebooks/compass_demo.ipynb runs on a free Colab CPU runtime. It renders the 3D task field (the potential FakeReplayPolicy chunk (kept, corrected or detoured), and plots the control-sharing timeline of the four real-world tasks.
compass.run executes a task end to end in the offline closed-loop runtime (CompassRunner with OfflineMockEnv and OfflineMockPolicy). It runs either one of the four real-world tasks (--demo-task) or a compiled field bundle, compiled_field.json, in the format the task skills under skills/ produce. The last two commands below write such a bundle with the Pack Box reference builder and run it:
.venv/bin/python -m compass.run --demo-task pack_box
.venv/bin/python -m compass.run --demo-task pack_earphone
# Write a compiled_field.json with the Pack Box reference builder (the format a task skill produces), then run it:
.venv/bin/python - <<'EOF'
import json
from mem.pack_box_ref import build_pack_box_spec
spec = build_pack_box_spec(
ordered_objects=[{"id": "toothbrush", "center": [0.16, -0.10, 0.08], "half_extents": [0.02, 0.05, 0.02]}],
box={"center": [-0.18, 0.0, 0.08], "half_extents": [0.08, 0.08, 0.05]},
fixed_prompt="Put the toothbrush in the box.",
)
with open("compiled_field.json", "w") as f:
json.dump(spec, f, indent=2)
EOF
.venv/bin/python -m compass.run --field-spec compiled_field.json --backend offline
tests/fixtures/count_fruit_rollout.json is a synthetic offline rollout. compass.replay replays it through the field without hardware, exercising the chunk test and the bounded correction (Eq. 3 and 4), detours, and the quota updates of the stage ledger (TaskLedger):
.venv/bin/python -m compass.replay
# nearest-state lookup:
.venv/bin/python -m compass.replay --mode nearest_state
The same replay from Python:
from pathlib import Path
from compass.replay import FakeReplayPolicy, OfflineRollout, ReplayFieldRunner
rollout = OfflineRollout.load(Path("tests/fixtures/count_fruit_rollout.json"))
fake_policy = FakeReplayPolicy(rollout, mode="sequential") # or mode="nearest_state"
runner = ReplayFieldRunner(rollout, policy=fake_policy)
results, ledger = runner.run_all()
n_policy = sum(1 for r in results if r.mode == "policy")
n_field = sum(1 for r in results if r.mode == "field")
print(f"Replayed {len(results)} chunks: {n_policy} kept (policy), {n_field} corrected (field)")
compass/ # Task fields, chunk arbitration, detours, calibration, perception, transitions, and replay
skills/ # Skill documents: meta skill, real-world task skills (real/), simulation task skills (sim/)
mem/ # Task-judgment notes and reference field builders consulted during compilation
notebooks/ # Interactive 3D Plotly / Google Colab demo (FakeReplayPolicy vs. field guidance)
tests/ # Unit tests and a synthetic offline rollout fixture
sim/ # Simulation benchmark interfaces (RoboMME): single-arm task field runtime, runners, per-layout compile step
-
Included: the hardware-free runtime in
compass/(task fields, chunk arbitration, stage ledger, transition predicates, calibration and perception utilities, theofflineanddry-runbackends ofcompass.run, and replay); reference field builders (mem/) and skills (skills/real/) for the four real-world tasks; the RoboMME simulation integration with sixteen task fields (sim/robomme/tasks/) and their skills (skills/sim/robomme/); notebooks and tests. -
Not included: robot and camera drivers or any hardware backend for
compass.run, and policy checkpoints. The RoboMME$\pi_{0.5}$ checkpoint comes from the benchmark's release (seesim/robomme/README.md).
The paper evaluates COMPASS on four real-world tasks. Each task has a skill under skills/real/ that compiles its task field; the table lists the capability the task tests and the frozen base policy it runs with.
| Paper Task | Skill | Core Capability | Base Policy |
|---|---|---|---|
| Pack box | skills/real/pack_box |
Ordered instruction following & fixed-prompt field control | |
| Pack earphone | skills/real/pack_earphone |
Disambiguating visually similar distractor earbuds | XR1 |
| Count fruit | skills/real/count_fruit |
Long-horizon category quota memory in an opaque bag | |
| Puzzle | skills/real/puzzle |
Spatial planning, mating orientation & distractor avoidance | XR1 |
sim/ applies the same compiled task fields to open simulation benchmarks. The first is RoboMME, run with a frozen
The table lists held-out success on RoboMME over sixteen tasks, counted out of 38 held-out episodes per task (episodes 12-49 of each task; 608 in total), with 1300 steps per episode, the gpt-6.1-sol.
| Method | Success (of 608) | Rate |
|---|---|---|
| Base policy | 108 | 17.8% |
| COMPASS-language | 139 | 22.9% |
| COMPASS-waypoint | 307 | 50.5% |
| COMPASS (fixed |
519 | 85.4% |
| COMPASS (adaptive |
548 | 90.1% |
Per-task results are in sim/robomme/README.md.
sim/robomme: the environment interface (a single-arm task field runtime, runners and the per-layout compile step).skills/sim/robomme: the benchmark layer and one fine skill per task.sim/robomme/README.md: the run guide.notebooks/compass_robomme.ipynb: a walkthrough of running a fine skill, developing one, and starting from the paper.
The meta skill skills/meta takes the paper and a new task, on a real robot or in a simulation benchmark, to the task's fine skill. On a new robot or benchmark, it first builds the shared layers (embodiment and calibration, field library, ground rules) that every task of that environment starts from. The three levels of skills are described in skills/README.md.
If you find this work useful, please cite:
@article{han2026compass,
title = {{COMPASS}: Bridging Agentic Reasoning and Dexterous Policies via Compiled Task Fields},
author = {Han, Xiaoshen and Cao, Jiahang and Li, Xinghang and Kong, Tao and Lai, Hang and Zhang, Weinan},
journal = {arXiv preprint arXiv:2611.37941},
year = {2026}
}
Released under the MIT License.