Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ Changes are grouped by software version. Entries under Unreleased describe work

### Added

- RAX ([arXiv:2610.22496](https://arxiv.org/abs/2610.22496), `docs/methods/rax.md`): the `rax` template (RAX's skill
library: `INDEX.md` and `skills/<slug>/` with `SKILL.md`, `code/` and `evidence/`, checked by RAX's own
`validate_tree`), the `rax` Evolver (RAX's merge of each session's library merges into the adapter, no model), and
RAX's exploration session as task functions (`hermit/agent/evolver/methods/rax/actor.py`: RAX's start prompt and
workspace, RAX's MCP bridge to its frontend on the host, its relaunch policy as a Claude Code Stop hook, the
library's clone and RAX's `skill_library_merge`). RAX's library code is vendored unchanged with its license.
`examples/libero/rax/`: LIBERO's forty tasks on RAX's LIBERO-PRO backend (its host service, judge and formal
batch), with disjoint train, validation and test splits, a smoke and the paper's protocol.
- `examples/officeqa_harbor/`: OfficeQA as Harbor's task set (harbor-datasets' `datasets/officeqa`, pinned) in the
OfficeQA paper's evaluation: each question in its own Harbor environment, the paper's agent prompt, the final
message's `<FINAL_ANSWER>` scored by the paper's `reward.py` (the OfficeQA repository's at its commit) at a 0.0%
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ methods/harness2
methods/continual_harness
methods/reharness
methods/aspire
methods/rax
methods/meta_harness_adapter
methods/ace
methods/ahe_adapter
Expand Down
2 changes: 2 additions & 0 deletions docs/methods/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ template–method combinations meaningful.
| Evolve whole adapters round by round under regularizers against overfitting the evolve set: an annealed edit budget, the edit history, exploration when stalled, a pre-evaluation leakage critic, a noise-adjusted floor and a cost rule | [RRSI Adapter](rrsi_adapter.md) | `rrsi-adapter` | A training split (the evolve set, k rows per task), a proposer CLI (Codex, Claude Code or Pi), the `rrsi` dependency group, a domain module with the benchmark's texts |
| Learn the framework contract offline | [Quick Start](../get-started/quickstart.md) | Prompt-only with a teaching learner | Included toy tasks |
| Grow a library of verified skill entries from robot tasks, each proposal re-solved by a fresh actor before it is admitted, with the coordinator choosing the next task | [ASPIRE](aspire.md) | `aspire` | A coordinator CLI (Codex, Claude Code or Pi), verifier task rows in `data.val`, an acting agent that delivers the adapter |
| Carry executable robot skills with their evidence from one exploration session to the next, each merged into a git skill library by a checked merge, with no learner model | [RAX](rax.md) | `rax` | RAX's checkout and its host service (a GPU for the simulators), Claude Code acting with RAX's task functions |

A learner model endpoint above can be your Claude subscription, and a learner CLI can run on it, with no API key:
[Claude subscription](../guides/claude-subscription.md) says which roles go which way.
Expand All @@ -48,6 +49,7 @@ task-specific service overhead. Call counts vary with evidence, candidates, and
| ReHarness | Per instance, one reflection call, one revision call per retrieved reflection (up to k) and one embedding call; no candidate rollouts or validation | Reflection bank in the adapter; source trajectories and per-instance retrieval and revision records in `state/` | Current adapter: the bank after the last instance |
| Meta-Harness Adapter | One proposer session per round writing k candidates; each candidate is a full rollout of the search set, one step per candidate | Every candidate's files, hypothesis, base and per-task scores in `state/` | Best mean on the search set |
| ASPIRE | Per task, one coordinator session and, when it proposes entries, a verifier rollout (a fresh actor on the task's verifier row) | The coordinator's curriculum and changelog notes in `state/` | Current adapter: the library after the last task |
| RAX | None: the Evolver replays each session's library merges with RAX's merge, without a model | None (the library is the adapter) | Current adapter: the library after the last session |
| RRSI Adapter | Per round: the analyst with a digester per rendered trace (a session per turn), m proposer sessions with the critic's review and repairs, a smoke on the domain's smoke tasks per screened candidate; each candidate is a full rollout of the evolve set (k rows per task), one step per candidate | Every candidate's files and digest, the edit history, the attribution and the frontier in `state/` (upstream's files under `state/rrsi/`) | The incumbent H_T, admitted above the noise floor and within the cost rule |

`use_gate: false` in SkillOpt removes the ordinary improvement requirement, **not** the validation calls.
Expand Down
203 changes: 203 additions & 0 deletions docs/methods/rax.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/libero/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ runs/
# ASPIRE's tasks and splits, written by aspire/tasks.sh at launch
aspire/tasks/
aspire/splits/
# RAX's tasks and splits, written by rax/launch.sh (rax/rows.py)
rax/tasks/
rax/splits/
10 changes: 9 additions & 1 deletion examples/libero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ on held-out seeds by the task's own success check.
| `utils/launch.sh` | Starts a method folder's run: the simulator service and hermit |
| [`aspire/`](aspire/) | The ASPIRE method (its session's task functions, verifier and coordinator are ASPIRE's own; `tasks.sh` adds its verifiers to the tasks). `run.yaml` (Object, Spatial, Goal, Long: 40 tasks), `run_90.yaml` (LIBERO-90), `run_pro.yaml` (LIBERO-Pro: 80), `run_pro_long.yaml` (LIBERO-Long-Pro), `run_luna.yaml` (`run.yaml` on Luna), `run_sample_luna.yaml` (six of the forty on Luna, for a run of a day or two), `smoke*.yaml`, `launch.sh` |
| [`prompt_only/`](prompt_only/) | The prompt-only template: one `ADAPTER.md` the built-in Codex Evolver revises after each task, with the method-neutral prompt. `run.yaml`, `run_pro.yaml`, `smoke.yaml`, `smoke_luna.yaml`, `launch.sh` |
| [`rax/`](rax/) | The RAX method on RAX's own LIBERO-PRO backend, not on the engine below: a Claude Code exploration session per task with RAX's robot tools, scored by RAX's formal batch on LIBERO's fixed initial states or LIBERO-Pro's swap states; RAX's skill library as the adapter. `run.yaml` (train, 40 tasks), `eval_val.yaml`, `eval_official.yaml`, `smoke.yaml`, its own `launch.sh`; its README gives RAX's setup and the splits |

The `*_luna.yaml` configs run GPT-5.6-Luna on the machine's ChatGPT login; the others GLM 5.3 Flash on Fireworks.
The `*_luna.yaml` configs run GPT-5.6-Luna on the machine's ChatGPT login; the others GLM 5.3 Flash on Fireworks
(`rax/` runs Claude Code on the machine's Claude login).

## The engine and the protocol

Expand All @@ -45,6 +47,11 @@ pinned, the judge can score the held-out seeds 1-50 on them. ASPIRE notes that s
distinct for every task: where a task's placement leaves little room, a held-out seed can give a development seed's
layout.

`rax/` is the exception: it runs on RAX's own backend (LIBERO's official environment in RAX's harness), explores
seeded resets (`env.seed(1000 + i)`) and is scored on LIBERO's fixed initial states (official, or LIBERO-Pro's
swap states), so its numbers are comparable with results on LIBERO's fixed states and not with this engine's
seeded scenes. Its README states its splits.

A method's number is measured the same way whatever its prompt: the workspace, `bin/sim`, the seeds, the scored
program (`fix_code.py`) and the judge are the engine's, and nothing of a method is in them. ASPIRE's configs give the
session ASPIRE's own task functions (`hermit.agent.evolver.methods.aspire.actor`: the fix-loop subagent and the
Expand Down Expand Up @@ -87,3 +94,4 @@ ASPIRE_SIM_GPU=0 ASPIRE_CONFIG=run_pro.yaml ./launch.sh # LIBERO-Pro
is a folder of configs beside these: `utils/agent/task.py` as its prompt and the engine's workspace, or its own (and a
`tasks.sh` if it adds rows of its own, as ASPIRE's verifiers). Run one method folder at a time on a checkout and an
`ASPIRE_OUT`: they share the task rows, the staged docs and the service's ledger, which each launch writes.
`rax/` has its own launcher and variables (`RAX_ROOT`, `RAX_SIM_GPU`, ...), which its README describes.
124 changes: 124 additions & 0 deletions examples/libero/rax/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# RAX on LIBERO

[RAX](../../../docs/methods/rax.md) ([arXiv:2610.22496](https://arxiv.org/abs/2610.22496),
[code](https://github.com/robot-agent-exploration/rax)) on LIBERO's forty tasks (Spatial, Object, Goal and Long), on
RAX's own LIBERO-PRO backend: the official LIBERO environment, RAX's robot tools and episodes, and RAX's formal
evaluation on LIBERO's stored init states. Each task is one RAX exploration session in code mode: Claude Code explores
fresh layouts of the task (at most 20 episodes, two environments), writes a controller, rehearses and submits it, and
the judge plays the submitted controller alone on held-out init states. Across the sessions, RAX's skill library (the
`rax` template) carries verified, executable skills from one task to the next, merged with RAX's own merge.

| File | What it is |
|---|---|
| `rows.py` | The task rows (`tasks/`, task directories in Harbor's format) and splits (`splits/`), written by `launch.sh` |
| `run.yaml` | Training: the train split, Claude Opus 5.5 at xhigh, the `rax` template and Evolver; `hermit eval` runs the test split |
| `eval_val.yaml` | The validation split as `hermit eval`'s test split, to compare the training run's checkpoints |
| `eval_official.yaml` | The paper's protocol (official init states 0-49), for RAX as published (`--adapter none`) |
| `smoke.yaml` | One task, two episodes, Claude Haiku 5.5, and its evaluation on another row |
| `launch.sh` | Writes the rows, starts the RAX service, runs hermit |
| `service.py` | RAX's trusted side on the host: each session's configuration, workspace and frontend (RAX's code) |
| `judge.py`, `formal.py` | The score: RAX's formal batch of the submitted bundle on the row's formal layouts |
| `task-info/` | What a task and its record are, for the learner |

## Data splits

Every split but the smokes holds the forty tasks; a row is one session. A session explores fresh seeded resets of the
original task (RAX's collection 0: layout *i* is `env.seed(1000 + i)` then `reset()`, never a stored init state) and is
scored on stored init states it never plays.

| Split | Rows | Exploration layouts | Scored on | Used by |
|---|---|---|---|---|
| train | `train-<task>` | 100-119 | official LIBERO, init states 0-42 (collection 1) | `run.yaml`: the training rollouts, the Evolver's material |
| val | `val-<task>` | 200-219 | official LIBERO, init states 43-49 (collection 1) | `eval_val.yaml`: choosing a checkpoint |
| test | `test-<task>` | 0-19 | LIBERO-Pro swap, init states 0-49 (collection 2) | `run.yaml`'s `hermit eval`: the reported result |
| official | `official-<task>` | 0-19 | official LIBERO, init states 0-49 | `eval_official.yaml`: the paper's protocol, no library |
| smoke | `smoke-libero_spatial_0` | 300-301 | official LIBERO, init states 0-1 | `smoke.yaml`: its training |
| smoke_test | `smoke_test-libero_spatial_0` | 302-303 | LIBERO-Pro swap, init states 0-1 | `smoke.yaml`: its evaluation |

Train, val, test and the smokes explore disjoint layouts (`official` explores test's, RAX's own 0-19), training and
validation are scored on disjoint official states, and the test split's swap states (objects exchange their initial
regions) are neither played nor scored by any training or validation session. The learner never sees a score's episodes:
the Evolver reads only the sessions' own library merges. `official` shares its states with train and val, so it is a
reproduction of the paper's table, not a test of a trained library. RAX's optional second stage (up to five adaptation
episodes on swap layouts, collection 6) is not a split here.

## Setup

RAX's checkout at the pinned commit, set up as its own README and `docs/LIBERO_PRO_BACKEND.md` say (an NVIDIA GPU
for the simulators, bubblewrap, git):

```bash
git clone https://github.com/robot-agent-exploration/rax && cd rax
git checkout 1767412c5300b9358059ae6a39740c3c28d2b8b9 # branch libero-pro/native
bash scripts/bootstrap_sources.sh # LIBERO-PRO/ at its pinned commit
bash scripts/setup_host_env.sh # runtime/envs/host: the harness's and agent's Python
bash scripts/setup_libero_pro_env.sh # runtime/envs/libero_pro: the simulator's
runtime/envs/host/bin/python scripts/setup_libero_pro_data.py
for suite in spatial object goal 10; do for i in $(seq 0 9); do # three demonstration images per task
runtime/envs/host/bin/python scripts/setup_libero_pro_demos.py --gpu 0 --task libero_${suite}_$i
done; done
runtime/envs/host/bin/python scripts/libero_pro_doctor.py --gpu 0 --task libero_spatial_0
```

RAX runs each rehearsal and formal episode in a fresh bubblewrap sandbox whose `/tmp` it caps with `bwrap --size`.
RHEL 9's bubblewrap (0.6.3) takes no `--size`, and every episode would fail at its start: `launch.sh` refuses such a
bwrap. `RAX_BWRAP` names a newer one for RAX's processes only (the service, its frontends, the judge's formal
batches); hermit's own sandboxes keep the one on `PATH`:

```bash
conda create -y -p ~/bwrap-env -c conda-forge bubblewrap=0.9.0 # then: export RAX_BWRAP=~/bwrap-env/bin/bwrap
```

On a host whose GPUs also run other processes' CUDA work, NVIDIA's EGL can break under the simulators: `start_episode`
then fails in LIBERO's depth check (`get_real_depth_map`'s range assertion) or hangs. `RAX_RENDER=cpu` renders with
Mesa's llvmpipe instead (Mesa's EGL must be installed): `launch.sh` gives RAX a simulator Python (`LIBERO_PRO_PYTHON`,
which RAX's `services/libero_pro/process.py` reads) that `cpu_render.sh` writes. It selects Mesa's software EGL device
(`egl_device.py` finds it) and no CUDA device, at `nice 10` with two llvmpipe threads. Physics is unchanged; the
images differ from NVIDIA's by renderer noise (on `libero_spatial_0`'s layout 300, 1.3/255 per pixel on average, 0.6%
of the pixels by more than 20, at edges), so a run with it says so beside its results. RAX's setup scripts
render too (the demonstrations are replayed in the simulator): on such a host, run them with the same Python,

```bash
cpu=/path/to/hermit/examples/libero/rax/cpu_render.sh # in RAX's checkout, before its setup scripts above
export LIBERO_PRO_PYTHON="$("$cpu" ~/rax-cpu "$PWD/runtime/envs/libero_pro/bin/python")"
```

The sessions run on the machine's Claude login ([Claude subscription](../../../docs/guides/claude-subscription.md):
`claude setup-token`, then `CLAUDE_CODE_OAUTH_TOKEN`). RAX's Gemini perception tool (`gemini_generate`, which the
paper's sessions had) needs an OpenRouter key file (`RAX_KEY_FILE`); without one the sessions run without it.

## Run

From this folder:

```bash
export RAX_ROOT=/path/to/rax RAX_SIM_GPU=0 RAX_KEY_FILE=~/.codex/secrets/openrouter_api_key
export RAX_BWRAP=~/bwrap-env/bin/bwrap # where the system's bwrap takes no --size (above)
export RAX_RENDER=cpu # where other processes' CUDA shares the GPUs (above)
RAX_CONFIG=smoke.yaml ./launch.sh # the smoke
./launch.sh # train: forty sessions, one per step
RAX_CONFIG=eval_val.yaml ./launch.sh eval --adapter rax-libero/ckpt-step-20 # validation, per checkpoint
./launch.sh eval --adapter rax-libero/ckpt-step-20 # test, the chosen checkpoint
./launch.sh eval --adapter root # test, the empty library
RAX_CONFIG=eval_official.yaml ./launch.sh eval --adapter none # the paper's protocol
```

Further arguments go to hermit, its overrides (`key=value`) before `eval`'s `--adapter`, since hermit's parser takes
them in one run: `./launch.sh eval "agent.claude.plan_dir=$HOME/plan" --adapter final`.

`--adapter none` runs RAX's sessions as published (no library, no `skill_library_merge`); `--adapter root` gives
every session the empty library, its clone and the merge tool. Runs go to `RAX_OUT` (default `../runs/rax`): the
trainer's records, the sessions' logs (`actor-logs/`: the CLI's stream, the session's notes and code, its library
bundle), the service's ledger and log (`rax-service/`, `rax-service.log`), and each session's run tree, its
exploration's frames and traces (`rax-service/run-trees/<random>`, `run_tree` in its facts: the task sandbox shows the
trees read-only and cannot list them; the service makes their directory unlistable while it runs and listable again
when it stops, so after a service that was killed, `chmod u+r "$RAX_OUT/rax-service/run-trees"` before removing a
run). RAX's own session directories (its state, bundles and formal reports) stay
under `$RAX_ROOT/runtime/auto-research/`, named in the ledger. One launch at a time on a `RAX_OUT`: its service holds
a lock in `rax-service/`, and a service started after one that was killed first ends the sessions that one left
open.

A session runs for hours (the paper reports a median of 0.7 to 1.8 hours of agent time per DexJoCo session, Table
17; LIBERO's sessions have two environments and up to 20 episodes), and each score is a formal batch of 43 (train), 7
(val) or 50 (test) episodes, four at a time. A run has one session at a time (`agent.concurrency: 1`): the library is
sequential, each session starting from the one the last session left.
25 changes: 25 additions & 0 deletions examples/libero/rax/cpu_render.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# RAX's simulators on the CPU (RAX_RENDER=cpu in launch.sh; README.md): writes <dir>/libero-pro-python, a simulator
# Python for RAX's LIBERO_PRO_PYTHON (services/libero_pro/process.py reads it) that renders with Mesa's llvmpipe and
# sees no CUDA device, and prints its path. For a host whose GPUs run other processes' CUDA, which can break NVIDIA's
# EGL under the simulators; RAX's setup scripts (setup_libero_pro_demos.py, libero_pro_doctor.py) take it too.
#
# cpu_render.sh <dir> <RAX's simulator Python, e.g. $RAX_ROOT/runtime/envs/libero_pro/bin/python>
set -euo pipefail
(( $# == 2 )) || { echo "usage: cpu_render.sh <dir> <RAX's simulator Python>" >&2; exit 2; }
HERE="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
DIR="$1"
SIM_PYTHON="$2"
MESA=/usr/share/glvnd/egl_vendor.d/50_mesa.json
DEVICE="$(__EGL_VENDOR_LIBRARY_FILENAMES="$MESA" "$SIM_PYTHON" -I "$HERE/egl_device.py")" || {
echo "no Mesa software EGL device for $SIM_PYTHON (Mesa's EGL: $MESA)" >&2; exit 1; }
mkdir -p "$DIR"
DIR="$(cd "$DIR" && pwd)"
{ echo '#!/bin/bash'
echo "# RAX's simulators on the CPU (cpu_render.sh): Mesa's software EGL device, no CUDA device"
printf 'export __EGL_VENDOR_LIBRARY_FILENAMES=%q MUJOCO_EGL_DEVICE_ID=%q\n' "$MESA" "$DEVICE"
echo 'export CUDA_VISIBLE_DEVICES='
echo 'export LP_NUM_THREADS="${LP_NUM_THREADS:-2}"'
printf 'exec nice -n 10 %q "$@"\n' "$SIM_PYTHON"; } > "$DIR/libero-pro-python"
chmod +x "$DIR/libero-pro-python"
echo "$DIR/libero-pro-python"
23 changes: 23 additions & 0 deletions examples/libero/rax/egl_device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Prints the index of Mesa's software (llvmpipe) EGL device, for RAX_RENDER=cpu (launch.sh): run on RAX's simulator
Python with Mesa as the only EGL vendor (__EGL_VENDOR_LIBRARY_FILENAMES), MUJOCO_EGL_DEVICE_ID then selects it."""
import ctypes

EGL_EXTENSIONS = 0x3055

egl = ctypes.CDLL("libEGL.so.1")
egl.eglGetProcAddress.argtypes = [ctypes.c_char_p]
egl.eglGetProcAddress.restype = ctypes.c_void_p
query_devices = ctypes.CFUNCTYPE(ctypes.c_uint, ctypes.c_int, ctypes.POINTER(ctypes.c_void_p),
ctypes.POINTER(ctypes.c_int))(egl.eglGetProcAddress(b"eglQueryDevicesEXT"))
query_string = ctypes.CFUNCTYPE(ctypes.c_char_p, ctypes.c_void_p, ctypes.c_int)(
egl.eglGetProcAddress(b"eglQueryDeviceStringEXT"))
count = ctypes.c_int()
query_devices(0, None, ctypes.byref(count))
devices = (ctypes.c_void_p * count.value)()
query_devices(count.value, devices, ctypes.byref(count))
for index in range(count.value):
if b"EGL_MESA_device_software" in (query_string(devices[index], EGL_EXTENSIONS) or b""):
print(index)
break
else:
raise SystemExit("no Mesa software EGL device")
Loading
Loading