Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

EmbodiedSWE: 24 privileged tasks (all set) (#499)

Kangrui Wang80cac7a5a227
diff --git a/ci_checks/ci_scope.py b/ci_checks/ci_scope.py
index 1b4f57665f..87c78bd0fd 100755
--- a/ci_checks/ci_scope.py
+++ b/ci_checks/ci_scope.py
@@ -79,6 +79,7 @@ UNITS: dict[str, list[str]] = {
"roboEngineer": ["images/control-transfer/", "images/quadrotor-landing/"],
"ABC Sim": _own("abc-sim"),
"Embodied Safety Exam": _own("ese"),
+ "EmbodiedSWE": _own("embodiedswe"),
}
HAND_UNITS = {k: list(v) for k, v in UNITS.items()} # the rows above, before the conventional paths below are added
# images/ directories every benchmark builds on: a change to one runs the full suite (no unit owns it)
diff --git a/docs/TAXONOMY.md b/docs/TAXONOMY.md
index a302daff70..ab0377cc9d 100644
--- a/docs/TAXONOMY.md
+++ b/docs/TAXONOMY.md
@@ -6,8 +6,8 @@ Known values; a new value is added by pull request. See [protocol/README.md](pro
|---|---|
| `task_type` | `trajectory` · `policy` |
| `protocol` | standard and standard-realtime modes only; the benchmarks that serve each value (generated: `python3 scripts/task_conventions.py taxonomy --write`). Standard: `eai-standard/2.1` (RoboTwin 2.0, DexToolBench, MuJoCo Playground (some tasks), KinDER, HumanoidBench, MetaWorld+, VLABench, RoboCasa-GR1, RoboCasa, RoboCasa365, LIBERO-MAX, BiGym 2.0, Embodied Olympics - Fun, Embodied Safety Exam, Panda Dynamic Scenes) · `eai-standard/2.2` (MuJoCo Playground (some tasks), RoboWits, RoboPaint, RoboLab, BEHAVIOR-1K, ManiGuard, MolmoSpaces, MyoSuite, DexJoCo, DexHand, YAMLab, RoboDojo, AM-Bench, iSpatialGym, LabUtopia, AutoBio, ABC Sim) · `eai-standard/2.4` (the operations capability: RoboARC) · `eai-policy/1.0` (a benchmark's own runtime: roboEngineer (some tasks)) · `eai-policy/1.1` (a benchmark's own runtime: roboEngineer (some tasks)) · `eai-standard-turn/1.0` (a benchmark's own runtime: Embodied Olympics - Match). Standard-realtime: `eai-standard/2.3` (MuJoCo Playground, HumanoidBench, MyoSuite, RoboCasa365, BiGym 2.0, Embodied Olympics - Fun, Embodied Safety Exam, Panda Dynamic Scenes, ABC Sim) · `eai-standard-realtime/1.0` (a benchmark's own runtime: Embodied Olympics - Match). The `eai-standard` versions are specified in [protocol/standard_mode.md](protocol/standard_mode.md); a benchmark's own runtime names its protocol (PROTOCOL §3) |
-| `simulator` | `robosuite` · `robotwin` (RoboTwin 2.0 = SAPIEN 3 + CuRobo) · `mujoco` · `kinder` (KinDER: MuJoCo and PyBullet) · `humanoidbench` (HumanoidBench: MuJoCo + dm_control) · `robowits` (RoboWits on Genesis) · `robolab` (NVIDIA RoboLab on Isaac Lab) · `behavior` (BEHAVIOR-1K: OmniGibson on Isaac Sim) · `maniskill` (ManiSkill 3 / SAPIEN: RoboPaint; Panda Dynamic Scenes, ManiSkill 3.0.1 / SAPIEN 3.0.3 with CPU PhysX at 1000 Hz) · `vlabench` (VLABench: MuJoCo + dm_control) · `maniguard` (ManiGuard: BEHAVIOR-1K 3.7.2, OmniGibson on Isaac Sim 4.5) · `molmospaces` (Ai2 MolmoSpaces: MuJoCo) · `myosuite` (MyoSuite: musculoskeletal models on MuJoCo) · `dexjoco` (DexJoCo: MuJoCo 3.4 + its gymnasium envs) · `bigym2` (BiGym 2.0: MuJoCo 3.8.1 with NVIDIA's GR00T-WBC lower-body policy in every step) · `roboarc` (RoboARC: MuJoCo 3.14.0, CPU float64, with the blanket cloth on a deterministic CUDA step; Nyx RGB) · `yamlab` (YAMLab on Isaac Lab / Isaac Sim 5.1, PhysX on the CPU) · `robodojo` (RoboDojo's simulation benchmark: its Isaac Lab 2.3 fork on Isaac Sim 5.1, PhysX with GPU dynamics, cuRobo IK) · `ambench` (AM-Bench: aerial manipulation on Isaac Lab / Isaac Sim 5.1, PhysX on the GPU, Pyroki floating-base IK, AM-Bench's multirotor controllers) · `ispatialgym` (iSpatialGym: its fork of BEHAVIOR-1K's OmniGibson on Isaac Sim 5.1, CPU PhysX) · `labutopia` (LabUtopia on Isaac Sim 6.1, CPU PhysX) · `autobio` (AutoBio: MuJoCo 3.3 with AutoBio's own thread, detent and liquid-surface mechanisms). The simulator, not the image: benchmarks on one simulator may use different images and versions |
-| `robot` | `franka-panda` · `aloha-agilex` · `aloha-2` (ALOHA 2, MuJoCo Menagerie: MuJoCo Playground, RoboARC (its IKEA suite's svallet too); AutoBio's own model) · `kuka-iiwa14-sharpa-ha4` · `tidybot-plus-plus` · `unitree-h1` · `unitree-h1hand` (H1 with two Shadow hands) · `sawyer` (Rethink Robotics Sawyer, as in Meta-World) · `marvin-bimanual` (RoboWits) · `franka-robotiq-2f85` (a Franka arm with a Robotiq 2F-85, the DROID setup: RoboLab, MolmoSpaces' FR3, RoboARC's Panda) · `ur5e-robotiq-2f85` (a UR5e with a Robotiq 2F-85; Embodied Safety Exam, AutoBio) · `r1pro` (BEHAVIOR-1K, iSpatialGym) · `franka-panda-omron` (RoboCasa's PandaOmron: Franka Panda on an Omron mobile base with a lift torso) · `fourier-gr1` (Fourier GR1 humanoid: two arms, waist and two Fourier dexterous hands, fixed base; RoboCasa-GR1) · `franka-panda-longfinger` (ManiGuard: Franka Panda with long fin-ray fingers) · `rainbow-rby1` (Rainbow Robotics RB-Y1: holonomic base, 6-joint torso, two 7-joint arms with parallel grippers; MolmoSpaces) · `myohand` (MyoSuite's MyoHand: a musculoskeletal human forearm and hand, 39 muscles) · `myoarm` (MyoSuite's MyoArm: a musculoskeletal human shoulder, arm and hand, 34 or 63 muscles) · `myoarm-torso` (MyoSuite's table-tennis player: torso, right arm and hand on a sliding pelvis) · `myoarm-mpl` (MyoSuite's MyoArm next to the Modular Prosthetic Limb, a motorized arm) · `myolegs` (MyoSuite's MyoLegs: a free-standing musculoskeletal torso and both legs) · `myoleg-osl` (MyoSuite's MyoLeg with an Open-Source Leg knee-ankle prosthesis) · `unitree-go1` (Unitree Go1 quadruped; MuJoCo Playground) · `boston-dynamics-spot` (Boston Dynamics Spot quadruped; MuJoCo Playground) · `google-barkour-vb` (Google Barkour vB quadruped; MuJoCo Playground) · `franka-allegro` (Franka Panda with a 16-DoF Allegro hand; DexJoCo) · `franka-allegro-bimanual` (two of them side by side; DexJoCo) · `franka-panda-bimanual` (two stock Franka Panda (FER) arms with their standard hands at one table, each with a rigid task tool on its hand where the task has one; Panda Dynamic Scenes; RoboARC's IKEA suite: MuJoCo Menagerie's Panda with its hand) · `sharpa-wave-floating` (a Sharpa Wave 22-DoF five-finger hand on a six-DoF actuated wrist stage, no arm; DexHand) · `marvin-bimanual-sharpa-wave` (two Tianji Marvin 7-joint arms on a fixed stand with a Sharpa Wave hand on each wrist; DexHand) · `sharpa-wave-floating-bimanual` (two Sharpa Wave 22-DoF hands, the right one genuine and the left its declared mirror image, each on its own six-DoF actuated wrist stage, no arms; DexHand) · `unitree-g1` (Unitree G1 29-DoF humanoid with its rubber hands, a switchable grip on each palm; Embodied Olympics' robot library with Unitree's limits and motor curves) · `unitree-h1-2` (Unitree H1-2, the adult-size 27-DoF humanoid, with the same grip; Embodied Olympics' tasks whose official venue needs an adult-size body) · `booster-t1`, `ssl-robot`, `foosball-rods` (the players of Embodied Olympics' exported soccer, wheeled-soccer and foosball matches) · `unitree-g1-dex1` (Unitree G1 29-DoF humanoid with Dex1-1 two-finger grippers; legs and waist driven by GR00T-WBC; BiGym 2.0) · `i2rt-yam-bimanual` (two I2RT YAM arms, 6 joints each, with parallel two-finger grippers on a workstation table; YAMLab) · `arx-x5-bimanual` (two ARX X5 arms, 6 joints each, with parallel two-finger grippers at a table; RoboDojo) · `ambench-fahexa` (AM-Bench's fully actuated hexarotor, six tilted rotors, carrying a 4-joint arm (three pitch joints, a roll joint) with a two-finger gripper) · `intel-aero-partial` (an Intel Aero quadrotor, partly calibrated, with the Neural Lander residual; roboEngineer) · `neural-fly-partial` (the Neural Fly airframe, approximated as a symmetric X quadrotor; roboEngineer) · `anycar` (the AnyCar 1/10 racing car: contact wheels, suspension, steering; roboEngineer) · `unitree-go2` (Unitree Go2 quadruped, MuJoCo Menagerie; roboEngineer) · `aloha-2-arm` (one arm of ALOHA 2 with its parallel gripper, fixed to a bench; AutoBio, whose two-arm tasks use `aloha-2`) · `ur5e-dexhand-2f85-bimanual` (two UR5e arms, one with a DexHand021 dexterous hand that holds a pipette, one with a Robotiq 2F-85; AutoBio) |
+| `simulator` | `robosuite` · `robotwin` (RoboTwin 2.0 = SAPIEN 3 + CuRobo) · `mujoco` · `kinder` (KinDER: MuJoCo and PyBullet) · `humanoidbench` (HumanoidBench: MuJoCo + dm_control) · `robowits` (RoboWits on Genesis) · `robolab` (NVIDIA RoboLab on Isaac Lab) · `behavior` (BEHAVIOR-1K: OmniGibson on Isaac Sim) · `maniskill` (ManiSkill 3 / SAPIEN: RoboPaint; Panda Dynamic Scenes, ManiSkill 3.0.1 / SAPIEN 3.0.3 with CPU PhysX at 1000 Hz) · `vlabench` (VLABench: MuJoCo + dm_control) · `maniguard` (ManiGuard: BEHAVIOR-1K 3.7.2, OmniGibson on Isaac Sim 4.5) · `molmospaces` (Ai2 MolmoSpaces: MuJoCo) · `myosuite` (MyoSuite: musculoskeletal models on MuJoCo) · `dexjoco` (DexJoCo: MuJoCo 3.4 + its gymnasium envs) · `bigym2` (BiGym 2.0: MuJoCo 3.8.1 with NVIDIA's GR00T-WBC lower-body policy in every step) · `roboarc` (RoboARC: MuJoCo 3.14.0, CPU float64, with the blanket cloth on a deterministic CUDA step; Nyx RGB) · `yamlab` (YAMLab on Isaac Lab / Isaac Sim 5.1, PhysX on the CPU) · `robodojo` (RoboDojo's simulation benchmark: its Isaac Lab 2.3 fork on Isaac Sim 5.1, PhysX with GPU dynamics, cuRobo IK) · `ambench` (AM-Bench: aerial manipulation on Isaac Lab / Isaac Sim 5.1, PhysX on the GPU, Pyroki floating-base IK, AM-Bench's multirotor controllers) · `ispatialgym` (iSpatialGym: its fork of BEHAVIOR-1K's OmniGibson on Isaac Sim 5.1, CPU PhysX) · `labutopia` (LabUtopia on Isaac Sim 6.1, CPU PhysX) · `autobio` (AutoBio: MuJoCo 3.3 with AutoBio's own thread, detent and liquid-surface mechanisms) · `embodiedswe` (EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, PhysX on the GPU). The simulator, not the image: benchmarks on one simulator may use different images and versions |
+| `robot` | `franka-panda` · `aloha-agilex` · `aloha-2` (ALOHA 2, MuJoCo Menagerie: MuJoCo Playground, RoboARC (its IKEA suite's svallet too); AutoBio's own model) · `kuka-iiwa14-sharpa-ha4` · `tidybot-plus-plus` · `unitree-h1` · `unitree-h1hand` (H1 with two Shadow hands) · `sawyer` (Rethink Robotics Sawyer, as in Meta-World) · `marvin-bimanual` (RoboWits) · `franka-robotiq-2f85` (a Franka arm with a Robotiq 2F-85, the DROID setup: RoboLab, MolmoSpaces' FR3, RoboARC's Panda) · `ur5e-robotiq-2f85` (a UR5e with a Robotiq 2F-85; Embodied Safety Exam, AutoBio) · `r1pro` (BEHAVIOR-1K, iSpatialGym) · `franka-panda-omron` (RoboCasa's PandaOmron: Franka Panda on an Omron mobile base with a lift torso) · `fourier-gr1` (Fourier GR1 humanoid: two arms, waist and two Fourier dexterous hands, fixed base; RoboCasa-GR1) · `franka-panda-longfinger` (ManiGuard: Franka Panda with long fin-ray fingers) · `rainbow-rby1` (Rainbow Robotics RB-Y1: holonomic base, 6-joint torso, two 7-joint arms with parallel grippers; MolmoSpaces) · `myohand` (MyoSuite's MyoHand: a musculoskeletal human forearm and hand, 39 muscles) · `myoarm` (MyoSuite's MyoArm: a musculoskeletal human shoulder, arm and hand, 34 or 63 muscles) · `myoarm-torso` (MyoSuite's table-tennis player: torso, right arm and hand on a sliding pelvis) · `myoarm-mpl` (MyoSuite's MyoArm next to the Modular Prosthetic Limb, a motorized arm) · `myolegs` (MyoSuite's MyoLegs: a free-standing musculoskeletal torso and both legs) · `myoleg-osl` (MyoSuite's MyoLeg with an Open-Source Leg knee-ankle prosthesis) · `unitree-go1` (Unitree Go1 quadruped; MuJoCo Playground) · `boston-dynamics-spot` (Boston Dynamics Spot quadruped; MuJoCo Playground) · `google-barkour-vb` (Google Barkour vB quadruped; MuJoCo Playground) · `franka-allegro` (Franka Panda with a 16-DoF Allegro hand; DexJoCo) · `franka-allegro-bimanual` (two of them side by side; DexJoCo) · `franka-panda-bimanual` (two stock Franka Panda (FER) arms with their standard hands at one table, each with a rigid task tool on its hand where the task has one; Panda Dynamic Scenes; RoboARC's IKEA suite: MuJoCo Menagerie's Panda with its hand) · `sharpa-wave-floating` (a Sharpa Wave 22-DoF five-finger hand on a six-DoF actuated wrist stage, no arm; DexHand) · `marvin-bimanual-sharpa-wave` (two Tianji Marvin 7-joint arms on a fixed stand with a Sharpa Wave hand on each wrist; DexHand) · `sharpa-wave-floating-bimanual` (two Sharpa Wave 22-DoF hands, the right one genuine and the left its declared mirror image, each on its own six-DoF actuated wrist stage, no arms; DexHand) · `unitree-g1` (Unitree G1 29-DoF humanoid with its rubber hands, a switchable grip on each palm; Embodied Olympics' robot library with Unitree's limits and motor curves) · `unitree-h1-2` (Unitree H1-2, the adult-size 27-DoF humanoid, with the same grip; Embodied Olympics' tasks whose official venue needs an adult-size body) · `booster-t1`, `ssl-robot`, `foosball-rods` (the players of Embodied Olympics' exported soccer, wheeled-soccer and foosball matches) · `unitree-g1-dex1` (Unitree G1 29-DoF humanoid with Dex1-1 two-finger grippers; legs and waist driven by GR00T-WBC; BiGym 2.0) · `unitree-g1-dex3` (Unitree G1 29-DoF humanoid with Unitree's Dex3-1 three-finger hands, Isaac Lab's `G1_29DOF_CFG`; EmbodiedSWE: a fixed pelvis, or walking under a frozen locomotion policy) · `i2rt-yam-bimanual` (two I2RT YAM arms, 6 joints each, with parallel two-finger grippers on a workstation table; YAMLab) · `arx-x5-bimanual` (two ARX X5 arms, 6 joints each, with parallel two-finger grippers at a table; RoboDojo) · `ambench-fahexa` (AM-Bench's fully actuated hexarotor, six tilted rotors, carrying a 4-joint arm (three pitch joints, a roll joint) with a two-finger gripper) · `intel-aero-partial` (an Intel Aero quadrotor, partly calibrated, with the Neural Lander residual; roboEngineer) · `neural-fly-partial` (the Neural Fly airframe, approximated as a symmetric X quadrotor; roboEngineer) · `anycar` (the AnyCar 1/10 racing car: contact wheels, suspension, steering; roboEngineer) · `unitree-go2` (Unitree Go2 quadruped, MuJoCo Menagerie; roboEngineer) · `aloha-2-arm` (one arm of ALOHA 2 with its parallel gripper, fixed to a bench; AutoBio, whose two-arm tasks use `aloha-2`) · `ur5e-dexhand-2f85-bimanual` (two UR5e arms, one with a DexHand021 dexterous hand that holds a pipette, one with a Robotiq 2F-85; AutoBio) |
| `family` | free-form slug naming the scene/goal, shared by its instances (e.g. `stack_blocks_two`, `dextoolbench/brush/blue_brush/sweep_forward`) |
| `dynamics` | `static` · `dynamic` — whether something in the scene other than the robot does work by a force other than the robot's and gravity (PROTOCOL §2; "Dynamics" below); each task's own declaration |
| `oracle` | `full` (oracle scores 1) · `partial` (oracle reaches part of the goal) · `none` — see PROTOCOL §4 |
diff --git a/embodied_first_exam/benchmarks/embodiedswe/esw_proxy.py b/embodied_first_exam/benchmarks/embodiedswe/esw_proxy.py
new file mode 100644
index 0000000000..417c5e07b8
--- /dev/null
+++ b/embodied_first_exam/benchmarks/embodiedswe/esw_proxy.py
@@ -0,0 +1,451 @@
+"""The graded `env` of an EmbodiedSWE task: a proxy in an untrusted process, the simulator in a trusted one.
+
+A delivered `solution/solve.py` exposes `solve(env)`. In grading, `solve` never runs next to the simulator:
+
+ trusted sim process (root, verifier) untrusted solution process (`nobody`, no network)
+ rcb_embodiedswe.py rollout python -I -B esw_proxy.py <fd_in> <fd_out> <solution dir>
+ env (built from the frozen instance) <---> solve(RemoteEnv) (one request per line, over two pipes)
+ the task's grader (records every step)
+
+`RemoteEnv` mirrors the env the agent used in development: attribute reads, item reads, `len`, iteration and
+read-only method calls are forwarded and answered with copies (a tensor comes back as a new CPU tensor; changing
+it changes nothing in the simulator); every other object stays in the trusted process and is reached through a
+handle. `env.step(action)` is the only call that advances the simulation; the trusted side records every action
+it executes. `reset`, `set_states`, attribute and item assignment, and every call that is not a read are refused
+with PermissionError (the same rule as EmbodiedSWE's GradedEnv, made structural).
+
+This module is both sides' codec (`encode` / `decode`) and the untrusted side's entry point (`main`). It imports
+only the standard library, numpy and torch, never the simulator.
+"""
+from __future__ import annotations
+
+import base64
+import json
+import os
+import sys
+
+MAX_LINE = 256 << 20 # one message (a large describe_stage text, a big tensor) at most
+MAX_ARRAY_BYTES = 64 << 20 # one tensor or array crossing the boundary
+DTYPES = ("float32", "float64", "float16", "int64", "int32", "int16", "int8", "uint8", "bool")
+PROTOCOL = "esw-proxy/1"
+
+
+class ProxyError(RuntimeError):
+ """The trusted side refused or failed a request (raised in solve as the original error type when it is one
+ of PermissionError, AttributeError, KeyError, IndexError, TypeError, ValueError, RuntimeError)."""
+
+
+# ------------------------------------------------------------------------------------------------ codec
+def _np():
+ import numpy as np
+ return np
+
+
+def encode(v, handle_of=None, depth: int = 0):
+ """A JSON-able form of `v`. `handle_of(obj) -> dict` turns an object that is not plain data into a handle
+ (trusted side); without it such an object is an error (untrusted side: it only sends plain data)."""
+ if depth > 64:
+ raise ValueError("value nested too deeply")
+ if v is None or isinstance(v, (bool, int, str)):
+ return v
+ if isinstance(v, float):
+ return v if v == v and v not in (float("inf"), float("-inf")) else {"__f__": repr(v)}
+ if isinstance(v, bytes):
+ return {"__b__": base64.b64encode(v).decode()}
+ if isinstance(v, (list, tuple)):
+ items = [encode(x, handle_of, depth + 1) for x in v]
+ return {"__l__": items} if isinstance(v, list) else {"__tu__": items}
+ if isinstance(v, dict):
+ if all(isinstance(k, str) for k in v):
+ return {"__d__": {k: encode(x, handle_of, depth + 1) for k, x in v.items()}}
+ return {"__dk__": [[encode(k, handle_of, depth + 1), encode(x, handle_of, depth + 1)] for k, x in v.items()]}
+ if isinstance(v, slice):
+ return {"__s__": [encode(v.start), encode(v.stop), encode(v.step)]}
+ if v is Ellipsis:
+ return {"__e__": 1}
+ mod = type(v).__module__ or ""
+ if mod.startswith("torch") and type(v).__name__ in ("Tensor", "Parameter"):
+ import torch
+ a = v.detach().to("cpu").contiguous()
+ return {"__t__": _arr((a.float() if a.dtype == torch.bfloat16 else a).numpy())}
+ if mod.startswith("torch") and type(v).__name__ in ("device", "dtype", "Size"):
+ return str(v) if type(v).__name__ != "Size" else {"__tu__": [int(x) for x in v]}
+ if mod.startswith("numpy"):
+ np = _np()
+ if isinstance(v, np.ndarray):
+ return {"__n__": _arr(v)}
+ if isinstance(v, np.generic):
+ return encode(v.item(), handle_of, depth)
+ if mod.startswith("pxr.Gf"): # USD vectors / matrices / quaternions by value
+ try:
+ if hasattr(v, "GetReal") and hasattr(v, "GetImaginary"):
+ return {"__tu__": [encode(float(v.GetReal()))] + [encode(float(x)) for x in v.GetImaginary()]}
+ return encode(tuple(tuple(r) if hasattr(r, "__len__") else r for r in v), handle_of, depth + 1)
+ except TypeError:
+ pass
+ if handle_of is None:
+ raise TypeError(f"cannot send a {type(v).__name__} to the simulator (plain data, tensors and handles only)")
+ return handle_of(v)
+
+
+def _arr(a) -> dict:
+ np = _np()
+ a = np.ascontiguousarray(a)
+ if a.dtype.name not in DTYPES:
+ raise TypeError(f"array dtype {a.dtype} is not supported")
+ if a.nbytes > MAX_ARRAY_BYTES:
+ raise ValueError(f"array of {a.nbytes} bytes is larger than {MAX_ARRAY_BYTES}")
+ return {"dtype": a.dtype.name, "shape": list(a.shape), "b64": base64.b64encode(a.tobytes()).decode()}
+
+
+def _unarr(d: dict):
+ """Rebuild an array from untrusted input: whitelisted dtype, exact byte count, bounded size."""
+ np = _np()
+ if not isinstance(d, dict) or d.get("dtype") not in DTYPES or not isinstance(d.get("shape"), list):
+ raise ValueError("malformed array")
+ shape = [int(x) for x in d["shape"]]
+ if any(x < 0 for x in shape) or len(shape) > 8:
+ raise ValueError("malformed array shape")
+ raw = base64.b64decode(d.get("b64", ""), validate=True)
+ if len(raw) > MAX_ARRAY_BYTES:
+ raise ValueError("array too large")
+ a = np.frombuffer(raw, dtype=np.dtype(d["dtype"]))
+ if a.size != int(np.prod(shape, dtype=np.int64)):
+ raise ValueError("array size does not match its shape")
+ return a.reshape(shape).copy()
+
+
+def decode(v, resolve=None, depth: int = 0):
+ """Inverse of `encode`. `resolve(dict) -> object` turns a handle back into what it names (each side its own)."""
+ if depth > 64:
+ raise ValueError("value nested too deeply")
+ if v is None or isinstance(v, (bool, int, float, str)):
+ return v
+ if isinstance(v, list):
+ raise ValueError("bare list on the wire")
+ if not isinstance(v, dict) or len(v) == 0:
+ raise ValueError("malformed value")
+ if "__h__" in v:
+ if resolve is None:
+ raise ValueError("unexpected handle")
+ return resolve(v)
+ (k, x), = list(v.items())[:1]
+ if k == "__f__":
+ return float(x) if x in ("nan", "inf", "-inf") else float("nan")
+ if k == "__b__":
+ return base64.b64decode(x, validate=True)
+ if k == "__l__":
+ return [decode(i, resolve, depth + 1) for i in x]
+ if k == "__tu__":
+ return tuple(decode(i, resolve, depth + 1) for i in x)
+ if k == "__d__":
+ return {str(kk): decode(i, resolve, depth + 1) for kk, i in x.items()}
+ if k == "__dk__":
+ return {decode(a, resolve, depth + 1): decode(b, resolve, depth + 1) for a, b in x}
+ if k == "__s__":
+ return slice(*(decode(i, resolve, depth + 1) for i in x))
+ if k == "__e__":
+ return Ellipsis
+ if k == "__n__":
+ return _unarr(x)
+ if k == "__t__":
+ import torch
+ return torch.from_numpy(_unarr(x))
+ raise ValueError(f"unknown tag {k!r}")
+
+
+# ------------------------------------------------------------------------------------------------ wire
+class Wire:
+ """Line-delimited JSON over two file descriptors."""
+
+ def __init__(self, fd_in: int, fd_out: int):
+ self.r = os.fdopen(fd_in, "rb", buffering=1 << 16)
+ self.w = os.fdopen(fd_out, "wb", buffering=0)
+
+ def send(self, obj) -> None:
+ data = (json.dumps(obj, separators=(",", ":")) + "\n").encode()
+ if len(data) > MAX_LINE:
+ raise ValueError("message too large")
+ self.w.write(data)
+
+ def recv(self):
+ line = self.r.readline(MAX_LINE + 1)
+ if not line:
+ raise EOFError("the other side closed the connection")
+ if len(line) > MAX_LINE:
+ raise ValueError("message too large")
+ return json.loads(line)
+
+
+# ------------------------------------------------------------------------------------------------ client
+_ERRORS = {"PermissionError": PermissionError, "AttributeError": AttributeError, "KeyError": KeyError,
+ "IndexError": IndexError, "TypeError": TypeError, "ValueError": ValueError,
+ "RuntimeError": RuntimeError, "StopIteration": StopIteration, "TimeoutError": TimeoutError}
+
+
+class _Conn:
+ def __init__(self, wire: Wire):
+ self.wire = wire
+ self.calls = 0
+
+ def ask(self, req: dict):
+ self.calls += 1
+ self.wire.send(req)
+ rep = self.wire.recv()
+ if "error" in rep:
+ if rep.get("stop"): # the trusted side ended the rollout (time limit, step cap)
+ raise SystemExit(f"[esw] rollout stopped by the evaluator: {rep['error']}")
+ raise _ERRORS.get(rep.get("kind"), ProxyError)(rep["error"])
+ return decode(rep.get("value"), self.handle)
+
+ def handle(self, d: dict):
+ return RemoteObject(self, int(d["__h__"]), str(d.get("type", "object")), bool(d.get("callable")))
+
+
+class RemoteObject:
+ """A read-only view of an object that lives in the trusted simulator process."""
+
+ __slots__ = ("_c", "_h", "_t", "_callable")
+
+ def __init__(self, conn: _Conn, h: int, type_name: str, is_callable: bool = False):
+ object.__setattr__(self, "_c", conn)
+ object.__setattr__(self, "_h", h)
+ object.__setattr__(self, "_t", type_name)
+ object.__setattr__(self, "_callable", is_callable)
+
+ def __getattr__(self, name: str):
+ if name.startswith("__") and name.endswith("__"):
+ raise AttributeError(name)
+ return self._c.ask({"op": "getattr", "h": self._h, "name": name})
+
+ def __setattr__(self, name, value):
+ raise PermissionError(f"blocked during grading: cannot set {self._t}.{name} (read-only view of the simulator)")
+
+ def __delattr__(self, name):
+ raise PermissionError(f"blocked during grading: cannot delete {self._t}.{name}")
+
+ def __getitem__(self, key):
+ return self._c.ask({"op": "getitem", "h": self._h, "key": encode(key, _send_handle)})
+
+ def __setitem__(self, key, value):
+ raise PermissionError(f"blocked during grading: cannot assign items of {self._t}")
+
+ def __delitem__(self, key):
+ raise PermissionError(f"blocked during grading: cannot delete items of {self._t}")
+
+ def __len__(self):
+ return int(self._c.ask({"op": "len", "h": self._h}))
+
+ def __iter__(self):
+ return iter(self._c.ask({"op": "iter", "h": self._h}))
+
+ def __contains__(self, item):
+ return bool(self._c.ask({"op": "contains", "h": self._h, "item": encode(item, _send_handle)}))
+
+ def __bool__(self):
+ return bool(self._c.ask({"op": "bool", "h": self._h}))
+
+ def __call__(self, *args, **kwargs):
+ return self._c.ask({"op": "call", "h": self._h, "args": encode(list(args), _send_handle),
+ "kwargs": encode(dict(kwargs), _send_handle)})
+
+ def __repr__(self):
+ try:
+ return self._c.ask({"op": "repr", "h": self._h})
+ except Exception: # noqa: BLE001
+ return f"<remote {self._t}>"
+
+ def __dir__(self):
+ return list(self._c.ask({"op": "dir", "h": self._h}))
+
+
+def _send_handle(obj):
+ """Untrusted side: a RemoteObject may be passed back as an argument (by handle); nothing else that is not data."""
+ if isinstance(obj, RemoteObject):
+ return {"__h__": object.__getattribute__(obj, "_h")}
+ raise TypeError(f"cannot send a {type(obj).__name__} to the simulator (plain data, tensors and handles only)")
+
+
+class RemoteEnv(RemoteObject):
+ """The env handed to `solve` in grading. `step` is the one call that advances the simulation."""
+
+ __slots__ = ()
+
+ def step(self, action, render: bool = False):
+ return self._c.ask({"op": "step", "action": encode(action, _send_handle)})
+
+ def reset(self, *args, **kwargs):
+ raise PermissionError("blocked during grading — the graded env was reset by the grader; solve may only step forward")
+
+ def set_states(self, *args, **kwargs):
+ raise PermissionError("blocked during grading — solve may only step forward")
+
+
+# ------------------------------------------------------------------------------------------------ untrusted entry
+def _limits() -> None:
+ import resource
+ gb = 1 << 30
+ for res, val in ((resource.RLIMIT_AS, 24 * gb), (resource.RLIMIT_NOFILE, 512), (resource.RLIMIT_FSIZE, 1 * gb),
+ (resource.RLIMIT_NPROC, 512), (resource.RLIMIT_CORE, 0)):
+ try:
+ resource.setrlimit(res, (val, val))
+ except (ValueError, OSError):
+ pass
+
+
+# Landlock (Linux >= 5.13, unprivileged, allowed by Docker's default seccomp profile): the solution process may read
+# the system's software trees, its own solution copy and /proc entries of its own; it may write only its scratch
+# directory, and it can open no TCP connection. Everything else (other processes' /proc entries, /tests, /logs, the
+# trusted work files, /tmp, /cache, /app) is out of reach whatever the file modes say. A PID namespace would need
+# CAP_SYS_ADMIN, which a verifier container does not get (PROTOCOL H.1: no service widens its container).
+LANDLOCK_ABI_MIN = 4
+_FS_EXECUTE, _FS_WRITE_FILE, _FS_READ_FILE, _FS_READ_DIR = 1, 2, 4, 8
+_FS_ALL_V1 = (1 << 13) - 1 # execute .. make_sym
+_FS_REFER, _FS_TRUNCATE = 1 << 13, 1 << 14
+_NET_BIND_TCP, _NET_CONNECT_TCP = 1, 2
+READ_TREES = ("/usr", "/bin", "/sbin", "/lib", "/lib32", "/lib64", "/libx32", "/etc", "/opt", "/root", "/sys")
+PROC_FILES = ("/proc/cpuinfo", "/proc/meminfo", "/proc/stat", "/proc/loadavg", "/proc/version", "/proc/filesystems",
+ "/proc/sys")
+DEV_FILES = ("/dev/null", "/dev/zero", "/dev/urandom", "/dev/random", "/dev/full")
+
+
+def landlock_abi() -> int:
+ import ctypes
+ libc = ctypes.CDLL(None, use_errno=True)
+ return int(libc.syscall(444, None, 0, 1)) # landlock_create_ruleset(NULL, 0, LANDLOCK_CREATE_RULESET_VERSION)
+
+
+def sandbox(solution: str, scratch: str) -> int:
+ """Restrict this process (and everything it starts) with Landlock. Returns the ABI; raises when unavailable."""
+ import ctypes
+ libc = ctypes.CDLL(None, use_errno=True)
+ abi = landlock_abi()
+ if abi < LANDLOCK_ABI_MIN:
+ raise OSError(f"Landlock ABI {abi} < {LANDLOCK_ABI_MIN}")
+ fs_all = _FS_ALL_V1 | _FS_REFER | _FS_TRUNCATE
+
+ class Ruleset(ctypes.Structure):
+ _fields_ = [("fs", ctypes.c_uint64), ("net", ctypes.c_uint64)]
+
+ class PathBeneath(ctypes.Structure):
+ _pack_ = 1
+ _fields_ = [("allowed", ctypes.c_uint64), ("fd", ctypes.c_int32)]
+
+ rs = Ruleset(fs_all, _NET_BIND_TCP | _NET_CONNECT_TCP)
+ fd = libc.syscall(444, ctypes.byref(rs), ctypes.sizeof(rs), 0)
+ if fd < 0:
+ raise OSError(ctypes.get_errno(), "landlock_create_ruleset")
+ read = _FS_EXECUTE | _FS_READ_FILE | _FS_READ_DIR
+ rules = [(p, read) for p in READ_TREES] + [(p, _FS_READ_FILE | _FS_READ_DIR) for p in PROC_FILES]
+ rules += [(f"/proc/{os.getpid()}", _FS_READ_FILE | _FS_READ_DIR), (solution, _FS_READ_FILE | _FS_READ_DIR)]
+ rules += [(p, _FS_READ_FILE | _FS_WRITE_FILE) for p in DEV_FILES]
+ rules += [(scratch, fs_all & ~_FS_REFER if abi < 2 else fs_all)]
+ for path, acc in rules:
+ try:
+ pfd = os.open(path, os.O_PATH | os.O_CLOEXEC)
+ except OSError:
+ continue
+ try:
+ if os.path.isfile(path) or not os.path.isdir(path):
+ acc &= _FS_EXECUTE | _FS_READ_FILE | _FS_WRITE_FILE | _FS_TRUNCATE
+ attr = PathBeneath(acc, pfd)
+ if libc.syscall(445, fd, 1, ctypes.byref(attr), 0) != 0:
+ raise OSError(ctypes.get_errno(), f"landlock_add_rule {path}")
+ finally:
+ os.close(pfd)
+ if libc.prctl(38, 1, 0, 0, 0) != 0: # PR_SET_NO_NEW_PRIVS
+ raise OSError(ctypes.get_errno(), "prctl(PR_SET_NO_NEW_PRIVS)")
+ if libc.syscall(446, fd, 0) != 0: # landlock_restrict_self
+ raise OSError(ctypes.get_errno(), "landlock_restrict_self")
+ os.close(fd)
+ return abi
+
+
+def _verify_sandbox(scratch: str) -> None:
+ """Fail closed: after sandbox() returns, confirm the restrictions are actually in force. A silently
+ mis-applied Landlock ruleset (a rule fd that failed to open, an ABI quirk) would otherwise leave a hole
+ that only shows up as a leak. Each check must be DENIED; if any is allowed we raise, and main() reports
+ an infrastructure failure instead of running the solution. Cheap (a few syscalls)."""
+ import socket
+ holes = []
+ try: # another process's /proc must be unreadable
+ with open("/proc/1/cmdline", "rb") as f:
+ f.read(1)
+ holes.append("/proc/1/cmdline readable")
+ except (PermissionError, FileNotFoundError, OSError):
+ pass
+ probe = os.path.join("/", "esw_sandbox_probe") # a write outside scratch must be refused
+ try:
+ with open(probe, "w") as f:
+ f.write("x")
+ os.unlink(probe)
+ holes.append("write outside scratch allowed")
+ except (PermissionError, FileNotFoundError, OSError):
+ pass
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # an outbound TCP connect must be refused
+ s.settimeout(0.2)
+ try:
+ s.connect(("10.255.255.1", 9))
+ holes.append("outbound TCP connect allowed")
+ except PermissionError:
+ pass
+ except OSError:
+ pass # unreachable / refused / timeout: no egress, acceptable
+ finally:
+ s.close()
+ if holes:
+ raise OSError("sandbox verification failed: " + "; ".join(holes))
+
+
+def main(argv: list[str]) -> int:
+ """`python -I -B esw_proxy.py FD_IN FD_OUT SOLUTION_DIR [EXTRA_PATH ...]` (started by the trusted side)."""
+ fd_in, fd_out, sol = int(argv[1]), int(argv[2]), argv[3]
+ _limits()
+ wire = Wire(fd_in, fd_out)
+ conn = _Conn(wire)
+ for p in reversed(argv[4:]): # read-only package roots (robobench), after the standard library
+ if p not in sys.path:
+ sys.path.append(p)
+ import importlib.util
+ import traceback
+
+ hello = wire.recv() # {"op": "hello", "root": {...handle...}, "scratch": dir}
+ env = RemoteEnv(conn, int(hello["root"]["__h__"]), "BaseEnv")
+ status = {"op": "done"}
+ try:
+ scratch = hello.get("scratch") or os.getcwd()
+ status["sandbox"] = f"landlock/{sandbox(sol, scratch)}"
+ _verify_sandbox(scratch) # fail closed: a sandbox that did not take effect = no run
+ except Exception as exc: # noqa: BLE001 — no sandbox, no run: the trusted side reports an infrastructure failure
+ wire.send({"op": "done", "sandbox_failed": f"{type(exc).__name__}: {exc}"})
+ os._exit(0)
+ try:
+ sys.path.insert(0, sol) # the native grader's rule: solve.py's directory is importable
+ spec = importlib.util.spec_from_file_location("solve", os.path.join(sol, "solve.py"))
+ mod = importlib.util.module_from_spec(spec)
+ sys.modules["solve"] = mod
+ spec.loader.exec_module(mod)
+ if not callable(getattr(mod, "solve", None)):
+ raise AttributeError("solve.py does not expose solve(env)")
+ wire.send({"op": "loaded"})
+ wire.recv()
+ mod.solve(env)
+ except SystemExit as e:
+ status["error"] = f"SystemExit: {e}"
+ except BaseException: # noqa: BLE001 — the solution's own exception: its progress so far is still graded
+ status["error"] = traceback.format_exc()[-8000:]
+ status["calls"] = conn.calls
+ for f in (sys.stdout, sys.stderr): # before "done": the trusted side ends this process right after it
+ try:
+ f.flush()
+ except Exception: # noqa: BLE001
+ pass
+ try:
+ wire.send(status)
+ except Exception: # noqa: BLE001
+ pass
+ os._exit(0)
+
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv))
diff --git a/embodied_first_exam/benchmarks/embodiedswe/esw_submit.py b/embodied_first_exam/benchmarks/embodiedswe/esw_submit.py
new file mode 100755
index 0000000000..41cf8beffe
--- /dev/null
+++ b/embodied_first_exam/benchmarks/embodiedswe/esw_submit.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python3
+"""`submit "note"`: freeze a checkpoint of /app/output/solution/ (EmbodiedSWE's harbor `submit`, adapted to this
+container's paths). The copy goes to /app/output/submissions/NNNNNN/solution/ with a receipt, submission.json
+(schema_version, created_at, note, files = {path: sha256} of every regular file, sha256 of that inventory). Concurrent
+submits are serialized with flock. At most 64 checkpoints; the final /app/output/solution/ is graded as well. Every
+distinct checkpoint is graded in a fresh simulator; the best one is the result (tests/grade.py).
+
+In the image at /opt/efe/esw_submit.py, linked as /usr/local/bin/submit. Standard library only.
+"""
+import argparse
+import fcntl
+import hashlib
+import json
+import os
+import shutil
+import stat
+import tempfile
+from datetime import datetime, timezone
+from pathlib import Path
+
+SOLUTION = Path("/app/output/solution")
+SUBMISSIONS = Path("/app/output/submissions")
+LIMIT = 64
+MAX_FILES, MAX_BYTES = 20_000, 2 << 30 # the grader's limits on a solution folder
+
+
+def inventory(root: Path) -> dict[str, str]:
+ """{relative path: sha256} of every regular file under `root`; a link or a special file is an error."""
+ if root.is_symlink() or not root.is_dir():
+ raise ValueError(f"expected a real directory: {root}")
+ out, size = {}, 0
+ for path in sorted(root.rglob("*")):
+ mode = path.lstat().st_mode
+ if stat.S_ISDIR(mode):
+ continue
+ if not stat.S_ISREG(mode):
+ raise ValueError(f"symbolic link or special file not supported: {path}")
+ size += path.lstat().st_size
+ if len(out) >= MAX_FILES or size > MAX_BYTES:
+ raise ValueError("solution larger than 20,000 files or 2 GiB")
+ with path.open("rb") as f:
+ out[path.relative_to(root).as_posix()] = hashlib.file_digest(f, "sha256").hexdigest()
+ return out
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def snapshot(solution: Path, submissions: Path, note: str, limit: int = LIMIT) -> Path:
+ if not (solution / "solve.py").is_file():
+ raise ValueError(f"no solve.py in {solution}")
+ submissions.mkdir(parents=True, exist_ok=True)
+ with (submissions / ".submit.lock").open("a") as lock:
+ fcntl.flock(lock, fcntl.LOCK_EX)
+ existing = [p for p in submissions.iterdir() if p.name.isdecimal()]
+ if len(existing) >= limit:
+ raise ValueError(f"submission limit ({limit}) reached; the final solution/ is still graded")
+ number = max((int(p.name) for p in existing), default=0) + 1
+ target = submissions / f"{number:06d}"
+ before = inventory(solution)
+ temp = Path(tempfile.mkdtemp(prefix=".pending-", dir=submissions))
+ try:
+ shutil.copytree(solution, temp / "solution", symlinks=True)
+ copied = inventory(temp / "solution")
+ if copied != before or inventory(solution) != before:
+ raise ValueError("solution/ changed during submit; stop writing to it and submit again")
+ (temp / "submission.json").write_text(json.dumps({
+ "schema_version": 1, "created_at": datetime.now(timezone.utc).isoformat(), "note": note[:2000],
+ "files": copied, "sha256": content_hash(copied)}, indent=2, sort_keys=True) + "\n")
+ os.chmod(temp, 0o755)
+ temp.rename(target)
+ finally:
+ if temp.exists():
+ shutil.rmtree(temp)
+ return target
+
+
+def main() -> None:
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ parser.add_argument("note", nargs="*", help="a short description of this checkpoint")
+ args = parser.parse_args()
+ try:
+ path = snapshot(SOLUTION, SUBMISSIONS, " ".join(args.note))
+ except (OSError, ValueError) as exc:
+ parser.exit(1, f"submit: {exc}\n")
+ print(f"Submitted {path.name} ({path}). Continue working; the final solution/ is also graded.")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/embodied_first_exam/benchmarks/embodiedswe/rcb_embodiedswe.py b/embodied_first_exam/benchmarks/embodiedswe/rcb_embodiedswe.py
new file mode 100644
index 0000000000..473243549c
--- /dev/null
+++ b/embodied_first_exam/benchmarks/embodiedswe/rcb_embodiedswe.py
@@ -0,0 +1,1249 @@
+"""EmbodiedSWE tasks in Embodied First Exam: frozen instances, the graded rollout of a delivered `solve(env)` and the
+video. One file, in the image at /opt/efe/rcb_embodiedswe.py (with esw_proxy.py and esw_submit.py beside it).
+
+Development (the agent, privileged mode: the full simulator):
+
+ from rcb_embodiedswe import make_env
+ env = make_env() # launches Isaac Sim (headless, GPU PhysX as EmbodiedSWE grades), builds and
+ # resets the task's env from /app/instance.json exactly as grading does
+ import solve; solve.solve(env) # anything goes in development
+
+ python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+ # the graded flow without the hidden grader: solve runs as `nobody` in its own
+ # process against a proxy env; prints the task's success predicate at the end
+ submit "note" # freeze a checkpoint of solution/ (esw_submit.py; every checkpoint is graded)
+
+Grading (the verifier, tests/grade.py; root; no network), once per distinct candidate, each in a fresh process:
+
+ rcb_embodiedswe.py rollout --instance I --grader G --solution DIR --out OUT the graded run (trusted sim process)
+ rcb_embodiedswe.py video --instance I --traj OUT/trajectory.npz --video V.mp4 the selected one's video
+
+Building the task (maintainers): `rcb_embodiedswe.py make-instance --preset P --seed S --out instance.json`.
+
+The rollout: build the env from the frozen instance (EmbodiedSWE's own build + seeded reset, `device="cuda:0"`: GPU
+PhysX, as EmbodiedSWE grades), compare its start state with the frozen one (bit for bit on the GPU model that froze
+it; on another model the difference is recorded, never an error), construct the task's grader on it (EmbodiedSWE's
+rubric, recorded after every step as their GradedEnv does), then start the solution process (esw_proxy.py) as
+`nobody` and serve its requests: reads answered with copies, `env.step(action)` executed and recorded, everything else
+refused. The candidate's time limit (EmbodiedSWE's rollout limit, 1800 s) runs from the start of this process, so the
+simulator's start-up and the import of solve.py count, as in EmbodiedSWE; at the limit (or on SIGTERM from the
+verifier) the solution's processes are killed and the verdict is read from the state at that moment, as EmbodiedSWE's
+grader does at its budget kill. Every process of `nobody` is killed before the verdict is read. Verdict: success = the
+grader's `check_success` on the final state (their end predicate); progress = the grader's rubric score (its peak
+recorded progress); a task with a tool-only rule (puzzle.spatula: the hand or a finger touching the bread disqualifies
+the episode) scores success 0 and progress 0 once PhysX reports such a contact (ToolOnlyMonitor, read after every
+physics substep). An exception from `env.step` is raised in `solve`, as EmbodiedSWE's GradedEnv lets it propagate: the
+rollout goes on if `solve` handles it. Actions are applied as given (robobench's controllers scale task-space deltas by
+pos_scale / rot_scale without clipping); only the shape and finiteness of an action are checked. The trajectory
+(OUT/trajectory.npz) holds every action and the scene's state every few control steps (Recorder). The video poses
+those recorded states on the bodies and draws them (no physics); it never changes the verdict.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import re
+import signal
+import subprocess
+import sys
+import threading
+import time
+import traceback
+from pathlib import Path
+
+HERE = Path(__file__).resolve().parent
+BENCH_ROOT = os.environ.get("ESW_BENCH_ROOT", "/opt/embodiedswe")
+NOBODY = 65534
+DEVICE = "cuda:0" # GPU PhysX, EmbodiedSWE's device
+MAX_STEPS = 400_000 # runaway guard on control steps in one rollout (a technical cap, not a budget)
+ROLLOUT_TIMEOUT_S = 1800.0 # EmbodiedSWE's rollout limit: the whole candidate process (start-up, import, solve)
+START_TOL = 1e-4 # start-state tolerance on another GPU model (max abs difference; a diagnostic)
+MAX_FRAMES = 3000 # recorded states per trajectory (the cadence doubles when full)
+FRAME_DT = 0.1 # their target spacing in simulated seconds (the video's 10 fps)
+T_START = time.monotonic() # this process's start: the candidate's time limit runs from here
+INSTANCE_FORMAT = "esw-instance/1"
+
+# The tasks of this benchmark: preset -> the module and class of the grader its tests/ ship, and the scene's own
+# public success function (what `check` reports without the hidden grader; equal to the grader's check_success).
+TASKS = {
+ "assembly.bulb.franka.osc": {"grader": "BulbAssemblyGrader", "check": "success"},
+ "puzzle.stack_blocks.g1.pink_ik": {"grader": "StackBlocksGrader", "check": "success"},
+ "locomanip.fruit_delivery.g1.loco_pink_ik": {"grader": "FruitDeliveryGrader", "check": "success"},
+ "assembly.allen_bolt.franka.osc": {"grader": "AllenBoltAssemblyGrader", "check": "success"},
+ "assembly.ikea_table.bimanual_franka.osc": {"grader": "IkeaTableAssemblyGrader", "check": "success"},
+ "assembly.nut_thread.franka.osc": {"grader": "NutThreadAssemblyGrader", "check": "success"},
+ "assembly.pc_gpu.franka.osc": {"grader": "PcGpuAssemblyGrader", "check": "success"},
+ "assembly.pc_gpu_ram.franka.osc": {"grader": "PcGpuRamAssemblyGrader", "check": "success"},
+ "assembly.pc_motherboard.franka.osc": {"grader": "PcMotherboardAssemblyGrader", "check": "success"},
+ "assembly.pc_ram.franka.osc": {"grader": "PcRamAssemblyGrader", "check": "success"},
+ "packing.pen_holder.franka.osc": {"grader": "PenHolderGrader", "check": "success"},
+ "packing.tool_packing.franka.osc": {"grader": "ToolPackingGrader", "check": "success"},
+ "packing.egg_carton.g1.pink_ik": {"grader": "EggCartonGrader", "check": "success"},
+ "packing.clear_organic_objects.g1.pink_ik": {"grader": "ClearOrganicObjectsGrader", "check": "success"},
+ "puzzle.coffee.franka.osc": {"grader": "CoffeeServiceGrader", "check": "success"},
+ "puzzle.syringe.bimanual_franka.osc": {"grader": "SyringeDosingGrader", "check": "success"},
+ "puzzle.push_shapes.g1.pink_ik": {"grader": "PushShapesGrader", "check": "success"},
+ "puzzle.classify_objects.g1.pink_ik": {"grader": "ClassifyObjectsGrader", "check": "success"},
+ "cutting.slice.franka.osc": {"grader": "SliceFoodGrader", "check": "cut_success"}, # the scene has no success()
+ "cutting.dice.franka.osc": {"grader": "DiceFoodGrader", "check": "cut_success"},
+ "locomanip.box_to_bin.g1.loco_pink_ik": {"grader": "BoxToBinGrader", "check": "success"},
+ "locomanip.wheel_carry.g1.loco_pink_ik": {"grader": "WheelCarryGrader", "check": "success"},
+ "assembly.so101.bimanual_franka.osc": {"grader": "SO101AssemblyGrader", "check": "so101_success"}, # no success()
+ # the scene states a TOOL-ONLY rule (finger or gripper contact with the bread disqualifies the episode) and leaves
+ # it to the harness (its module docstring); the tooling enforces it (ToolOnlyMonitor)
+ "puzzle.spatula.franka.osc": {"grader": "SpatulaFlipServeGrader", "check": "success",
+ "tool_only": {"payload": "Bread_", "hand": ("panda_hand", "panda_leftfinger",
+ "panda_rightfinger")}},
+}
+
+
+def cut_success(scene):
+ """The cutting scenes' public end predicate (they have no success()): the food is in at least its target number
+ of pieces (`cfg.target_pieces`, 0 = every piece) and every piece's root is still on the chopping board, inside its
+ footprint (`cfg.board_size`, centred on the env origin) and above its top. `(num_envs,)` bool."""
+ import torch
+ target = scene.cfg.target_pieces or len(scene.pieces)
+ hx, hy = scene.cfg.board_size[0] / 2, scene.cfg.board_size[1] / 2
+ ok = torch.ones(scene.env.num_envs, dtype=torch.bool, device=scene.env.device)
+ for pc in scene.pieces:
+ rel = pc.data.root_pos_w - scene.env_origins
+ ok &= (rel[:, 0].abs() < hx) & (rel[:, 1].abs() < hy) & (rel[:, 2] > scene._board_top)
+ return (scene.pieces_count() >= target) & ok
+
+
+def so101_success(scene):
+ """The SO101 scene's end predicate (it has no success()), exactly EmbodiedSWE's grader's (SO101AssemblyGrader.
+ check_success): every loose screw fastened (`fastened >= 0` for all twelve; the scene's `state == 2`), the servo
+ in the upper arm's pocket (its body frame on the upper_arm link frame within `cfg.motor_align_pos` and
+ `cfg.motor_align_deg`) and the forearm on the horn (the lower_arm at its elbow seat on the motor within
+ `motor_align_pos`, its orientation off the horn axis within `motor_align_deg`; any elbow angle). `(num_envs,)`."""
+ import math
+
+ from isaaclab.utils.math import quat_error_magnitude
+ c = scene.cfg
+ ap, aq = scene.upper_arm_pose()
+ motor = (((scene.motor.data.root_pos_w - ap).norm(dim=-1) < c.motor_align_pos)
+ & (quat_error_magnitude(scene.motor.data.root_quat_w, aq) < math.radians(c.motor_align_deg)))
+ lp, lq = scene.lower_arm_pose()
+ seat_p, seat_q = scene.lower_arm_seat_w()
+ _, off_axis = scene._elbow_angle_split(lq, seat_q)
+ fork = ((lp - seat_p).norm(dim=-1) < c.motor_align_pos) & (off_axis < math.radians(c.motor_align_deg))
+ return (scene.fastened >= 0).all(dim=1) & motor & fork
+
+
+CHECKS = {"cut_success": cut_success, "so101_success": so101_success}
+
+
+class ToolOnlyMonitor:
+ """A task's TOOL-ONLY rule, in the trusted process: contact between the robot's hand (`spec["hand"]`: the hand
+ body and its fingers) and the payload (the scene's present bread) disqualifies the episode. PhysX reports the
+ contacts of the payload's rigid bodies (PhysxContactReportAPI, threshold 0, plus omni.physx's contact processing,
+ both set before the simulation starts; they report, they do not change the dynamics), and after EVERY physics
+ substep (the scene's post_step) the monitor reads the contact-force matrix between them and the hand's links:
+ any pair with a nonzero force is a touch. Contacts with the absent (parked) bread sizes do not count."""
+
+ def __init__(self, env, spec: dict):
+ import torch
+ self.env, self.spec = env, spec
+ self.scene = env.scene
+ self.payload = list(self.scene.breads.values())
+ from pxr import UsdPhysics
+ root = env.stage.GetPrimAtPath(f"/World/envs/env_0/{env.robot.prim_name}")
+ links, todo = [], [root] if root.IsValid() else []
+ while todo: # the hand's rigid links under the robot's prim
+ p = todo.pop(0)
+ if p.HasAPI(UsdPhysics.RigidBodyAPI) and p.GetName() in spec["hand"]:
+ links.append(str(p.GetPath()))
+ todo += p.GetChildren()
+ if sorted(p.rsplit("/", 1)[-1] for p in links) != sorted(spec["hand"]):
+ raise RuntimeError(f"tool-only rule: hand links {spec['hand']} not all found ({links})")
+ sensors = [p for b in self.payload for p in b.root_physx_view.prim_paths]
+ if len(sensors) != len(self.payload):
+ raise RuntimeError(f"tool-only rule: expected one rigid body per payload, got {sensors}")
+ self.view = env.sim.physics_sim_view.create_rigid_contact_view(
+ sensors, filter_patterns=[links] * len(sensors), max_contact_data_count=64 * len(sensors) * len(links))
+ self.links, self.sensors = links, sensors
+ self.substeps = 0
+ self.touch_substeps = 0
+ self.first_touch_step = None # control step (0-based) of the first touch
+ self.max_force = 0.0
+ self.touched_links: set = set()
+ orig = self.scene.post_step
+ period = int(env.robot.control_period)
+
+ def post_step(*a, **k): # the scene's own mechanics first, then the contact read
+ orig(*a, **k)
+ f = self.view.get_contact_force_matrix(dt=env.dt)
+ f = torch.as_tensor(f).reshape(len(sensors), len(links), 3).norm(dim=-1)
+ present = self.scene._present[0].reshape(-1).to(torch.bool).cpu()
+ hit = f.cpu()[present]
+ if bool((hit > 0).any()):
+ self.touch_substeps += 1
+ if self.first_touch_step is None:
+ self.first_touch_step = self.substeps // period
+ self.max_force = max(self.max_force, float(hit.max()))
+ for j in torch.nonzero((hit > 0).any(dim=0)).reshape(-1).tolist():
+ self.touched_links.add(links[j].rsplit("/", 1)[-1])
+ self.substeps += 1
+ self.scene.post_step = post_step
+
+ @property
+ def touched(self) -> bool:
+ return self.touch_substeps > 0
+
+ def report(self) -> dict:
+ return {"tool_only": 1, "tool_contact": int(self.touched), "tool_contact_substeps": self.touch_substeps,
+ "tool_contact_first_step": self.first_touch_step, "tool_contact_max_force": round(self.max_force, 6),
+ "tool_contact_links": sorted(self.touched_links)}
+
+
+def _enable_contact_reports(payload_prefix: str) -> None:
+ """Before the simulation starts: PhysX contact reports (threshold 0) on every rigid body of every prim of each env
+ whose name starts with `payload_prefix`, and omni.physx's contact processing on (Isaac Lab turns it off for CPU
+ physics and back on when it creates a contact sensor, as here). Only reporting: no sleep threshold or other
+ physics attribute changes."""
+ import carb
+ import omni.usd
+ from pxr import PhysxSchema, UsdPhysics
+ carb.settings.get_settings().set_bool("/physics/disableContactProcessing", False)
+ stage = omni.usd.get_context().get_stage()
+ n = 0
+ envs = stage.GetPrimAtPath("/World/envs")
+ for e in (envs.GetChildren() if envs.IsValid() else []):
+ for top in e.GetChildren():
+ if not top.GetName().startswith(payload_prefix):
+ continue
+ todo = [top]
+ while todo:
+ p = todo.pop(0)
+ if p.HasAPI(UsdPhysics.RigidBodyAPI):
+ PhysxSchema.PhysxContactReportAPI.Apply(p).CreateThresholdAttr().Set(0.0)
+ n += 1
+ else:
+ todo += p.GetChildren()
+ if not n:
+ raise RuntimeError(f"tool-only rule: no rigid body named {payload_prefix}* on the stage")
+
+
+def tool_contact(env) -> dict | None:
+ """The tool-only rule's record of this env so far (None for a task without the rule)."""
+ mon = getattr(env, "_esw_tool_only", None)
+ return mon.report() if mon is not None else None
+
+
+def task_success(env, preset: str):
+ """The task's public end predicate, `(num_envs,)` bool: the scene's own method, or the tooling's for scenes
+ without one (CHECKS)."""
+ name = TASKS[preset]["check"]
+ return CHECKS[name](env.scene) if name in CHECKS else getattr(env.scene, name)()
+
+
+def log(*a) -> None:
+ print("[esw]", *a, file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ simulator
+_APP = None
+
+
+def launch(cameras: bool = False):
+ """Isaac Sim headless (once per process). pinocchio first: the pink_ik presets need it imported before Kit."""
+ global _APP
+ if _APP is not None:
+ return _APP
+ try:
+ import pinocchio # noqa: F401
+ except ImportError as exc:
+ log(f"pinocchio not importable ({exc}): a pink_ik preset will fail to build")
+ from isaaclab.app import AppLauncher
+ kw = dict(headless=True, device=DEVICE)
+ if cameras:
+ kw["enable_cameras"] = True
+ _APP = AppLauncher(**kw).app
+ return _APP
+
+
+def build(instance: dict, before_reset=None, reset_impl=None):
+ """The env exactly as EmbodiedSWE's grader builds it (registered preset, seed, one trajectory), GPU PhysX. A task
+ with a tool-only rule gets its contact monitor (ToolOnlyMonitor). `before_reset` / `reset_impl`: the video's
+ camera (see _build_with_camera)."""
+ if BENCH_ROOT not in sys.path:
+ sys.path.insert(0, BENCH_ROOT)
+ import robobench
+ robobench.discover()
+ from robobench.core.registries import ENVS
+ seed = int(instance["seed"])
+ if instance.get("device", DEVICE) != DEVICE:
+ raise ValueError(f"instance built on {instance.get('device')!r}; these tasks run PhysX (and the G1 locomotion "
+ f"policy) on {DEVICE!r}, as EmbodiedSWE grades them")
+ spec = TASKS[instance["preset"]].get("tool_only")
+ hooks = [lambda: _enable_contact_reports(spec["payload"])] if spec else []
+ if before_reset:
+ hooks.append(before_reset)
+ if hooks or reset_impl is not None:
+ # run the hooks right before the env's one `sim.reset()` (what must be on the stage when PhysX starts), and
+ # take that reset from `reset_impl` if given; nothing else of the build changes
+ from isaaclab.sim import SimulationContext
+ orig = SimulationContext.reset
+ pending = list(hooks)
+
+ def reset(self, soft: bool = False):
+ while pending:
+ pending.pop(0)()
+ return (reset_impl or orig)(self, soft=soft)
+
+ SimulationContext.reset = reset
+ try:
+ env = ENVS.get(instance["preset"])().build(num_envs=1, seed=seed, device=DEVICE)
+ finally:
+ SimulationContext.reset = orig
+ if pending:
+ raise RuntimeError("the env build did not reset the simulation")
+ else:
+ env = ENVS.get(instance["preset"])().build(num_envs=1, seed=seed, device=DEVICE)
+ if str(env.device) != DEVICE:
+ raise RuntimeError(f"the env was built on {env.device}, not {DEVICE}")
+ if spec:
+ env._esw_tool_only = ToolOnlyMonitor(env, spec)
+ env.reset(seed=seed)
+ return env
+
+
+def _leaves(obj, prefix=""):
+ """(path, tensor-or-scalar) leaves of a nested state, in a fixed order."""
+ if isinstance(obj, dict):
+ for k in sorted(obj, key=str):
+ yield from _leaves(obj[k], f"{prefix}/{k}")
+ elif isinstance(obj, (list, tuple)):
+ for i, x in enumerate(obj):
+ yield from _leaves(x, f"{prefix}/{i}")
+ else:
+ yield prefix, obj
+
+
+def full_state(env) -> dict:
+ """Everything that defines where the episode is: every asset's state in Isaac Lab's scene (root poses and
+ velocities, joint positions and velocities) and robobench's own `get_states()` (scene + robot)."""
+ return {"iscene": env.iscene.get_state(is_relative=False), "robobench": env.get_states()}
+
+
+def state_sha(env) -> str:
+ import numpy as np
+ import torch
+ h = hashlib.sha256()
+ for path, v in _leaves(full_state(env)):
+ h.update(path.encode())
+ if isinstance(v, torch.Tensor):
+ a = v.detach().to("cpu").contiguous()
+ h.update(str(a.dtype).encode() + str(tuple(a.shape)).encode())
+ h.update(a.numpy().tobytes() if a.dtype != torch.bfloat16 else a.float().numpy().tobytes())
+ elif isinstance(v, np.ndarray):
+ h.update(np.ascontiguousarray(v).tobytes())
+ else:
+ h.update(repr(v).encode())
+ return h.hexdigest()
+
+
+def scene_vector(env) -> tuple[list, "object"]:
+ """Isaac Lab's scene state (every asset's root pose and velocity, joint positions and velocities, world frame) as
+ ([(path, shape)], one float64 vector)."""
+ import numpy as np
+ import torch
+ layout, parts = [], []
+ for path, v in _leaves(env.iscene.get_state(is_relative=False)):
+ if isinstance(v, torch.Tensor):
+ layout.append((path, list(v.shape)))
+ parts.append(v.detach().to("cpu").double().reshape(-1).numpy())
+ return layout, (np.concatenate(parts) if parts else np.zeros(0))
+
+
+def gpu_model() -> str:
+ try:
+ import torch
+ return torch.cuda.get_device_name(0)
+ except Exception: # noqa: BLE001
+ return "unknown"
+
+
+def check_start(env, inst: dict) -> dict:
+ """The start state against the frozen instance: `instance_ok` = the same state hash (expected on the GPU model that
+ froze it, `instance_gpu`); otherwise `instance_max_abs_diff` over the scene state vector and `instance_within_tol`
+ (START_TOL), a diagnostic. `instance_mismatch` = 1 only when the hash differs on the freezing GPU model."""
+ import numpy as np
+ sha = state_sha(env)
+ model = gpu_model()
+ out = {"instance_sha": sha, "instance_ok": int(sha == inst["state_sha"]), "gpu_model": model,
+ "instance_gpu": inst.get("gpu_model"), "instance_same_gpu": int(model == inst.get("gpu_model"))}
+ if out["instance_ok"]:
+ out.update(instance_max_abs_diff=0.0, instance_within_tol=1, instance_mismatch=0)
+ return out
+ layout, vec = scene_vector(env)
+ ref = inst.get("start_state") or {}
+ if [list(x) for x in ref.get("layout", [])] == [list(x) for x in layout] and len(ref.get("vector", [])) == len(vec):
+ d = float(np.max(np.abs(vec - np.asarray(ref["vector"], dtype=np.float64)))) if len(vec) else 0.0
+ else:
+ d = float("inf") # another scene layout
+ out.update(instance_max_abs_diff=d if d != float("inf") else -1.0, instance_within_tol=int(d <= START_TOL),
+ instance_mismatch=int(bool(out["instance_same_gpu"])))
+ return out
+
+
+class Recorder:
+ """The run's trajectory: every action (recorded before its step) and the scene state (scene_vector, float32) every
+ `every` control steps, the start and the end included. At most MAX_FRAMES states: when full, the cadence doubles and
+ every other kept state goes. Written by `save` to an npz (trajectory.npz)."""
+
+ def __init__(self, env, preset: str, seed: int):
+ import numpy as np
+ self.np = np
+ self.env, self.preset, self.seed = env, preset, seed
+ self.control_dt = float(env.dt * env.robot.control_period)
+ self.every = max(1, int(round(FRAME_DT / self.control_dt)))
+ self.actions: list = []
+ self.steps: list[int] = []
+ self.rows: list = []
+ self.layout = None
+
+ def frame(self) -> None:
+ n = len(self.actions)
+ if self.steps and self.steps[-1] == n:
+ return
+ layout, vec = scene_vector(self.env)
+ if self.layout is None:
+ self.layout = layout
+ elif layout != self.layout:
+ raise RuntimeError("the scene state changed layout during the run")
+ self.rows.append(vec.astype(self.np.float32))
+ self.steps.append(n)
+ if len(self.rows) > MAX_FRAMES:
+ self.every *= 2
+ keep = [i for i, s in enumerate(self.steps) if s % self.every == 0 or i == len(self.steps) - 1]
+ self.rows = [self.rows[i] for i in keep]
+ self.steps = [self.steps[i] for i in keep]
+
+ def after_step(self) -> None:
+ if len(self.actions) % self.every == 0:
+ self.frame()
+
+ def save(self, path: Path, **extra) -> None:
+ np = self.np
+ A = np.stack(self.actions).astype(np.float32) if self.actions else np.zeros((0, self.env.robot.action_dim),
+ np.float32)
+ S = np.stack(self.rows) if self.rows else np.zeros((0, 0), np.float32)
+ np.savez(path, task=np.array(self.preset), seed=np.array(self.seed), actions=A,
+ frame_step=np.asarray(self.steps, dtype=np.int64), frame_state=S,
+ state_layout=np.array(json.dumps(self.layout or [])), control_dt=np.array(self.control_dt),
+ **{k: np.array(v) for k, v in extra.items()})
+
+
+def load_instance(path) -> dict:
+ inst = json.loads(Path(path).read_text())
+ if inst.get("format") != INSTANCE_FORMAT or inst.get("preset") not in TASKS:
+ raise ValueError(f"{path}: not an instance of this benchmark")
+ return inst
+
+
+def load_grader(path: str, preset: str):
+ """The task's grader module (from the verifier's tests/, never from the agent's image), by file path."""
+ import importlib.util
+ spec = importlib.util.spec_from_file_location("esw_task_grader", path)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
+ return getattr(mod, TASKS[preset]["grader"])
+
+
+def stop_app(rc: int = 0):
+ sys.stdout.flush()
+ sys.stderr.flush()
+ os._exit(rc) # Kit can hang on close; everything is written by now
+
+
+# ------------------------------------------------------------------------------------------------ the proxy server
+WRITE_RE = re.compile(r"^_*(set|write|reset|apply|step|update|bind|post_step|close|clear|spawn|add|remove|delete|"
+ r"create|enable|disable|load|save|play|pause|stop|render|teleport|register|attach|detach|define|"
+ r"init|initialize|sim_cfg|assets|compute|record|verdict|seal|kill|exec|run|start|open|"
+ r"to_isaaclab|build|fetch|ensure|prepare|wait|override|patch|swap|replace|move|push|pop|"
+ r"insert|append|extend|fill|zero|copy_|scale|mul|div|sub|clamp_|index_|scatter|put|resize)",
+ re.IGNORECASE)
+READ_RE = re.compile(r"^_*(get|is|has|find|describe|seated|success|score|tower_height|level_counts|slots|upright|"
+ r"block_tensors|fruits_|nonfruits_|on_plate|placed|speed|ground_z|yaw_quat|grid_names|slot_xy|"
+ r"fixed_pose|radial|plate_|bulb_|in_socket|stand_xy|keys|values|items|names|count|num|name|"
+ r"prim_name|action_dim|control_period|control_dt|actuator_limits|joint_names|body_names|"
+ r"bread_r|bread_h)",
+ re.IGNORECASE)
+# Calls the proxy answers: a method whose name says it reads (READ_RE) and not that it writes (WRITE_RE), on any object
+# reachable from the env, plus ENV_CALLS on the env itself. A whitelist: an unknown verb is refused. Audited against
+# the three tasks' scene and robot classes (and BaseScene, BaseRobot); on_bind / actuator_sink / build_controller are
+# refused (they rebind or hand out the write path).
+ENV_CALLS = {"describe", "describe_stage", "get_states"}
+
+# Strict, audited read-method allowlist for the privileged objects that hold ground truth (scene, robot).
+# Default deny: a method on a scene/robot that is not listed here is refused even if its name looks like a
+# read (the regex above is kept only as a secondary gate for leaf objects such as configs and articulations).
+# Maintainers EXTEND these per task after auditing the new scene/robot class (not a code change for each run).
+READ_METHODS_SCENE = {
+ "get_state", "describe", "seated", "success", "score", "tower_height",
+ "_bulb_offsets_in_socket", "_bulb_axis_cos", "_block_tensors", "_upright", "_slots", "_level_counts",
+ # assembly scenes (allen_bolt, ikea_table, nut_thread, pc_gpu, pc_gpu_ram, pc_motherboard, pc_ram)
+ "grasp_sites", "engaged", "gpu_engaged", "gpu_seated", "ram_engaged", "ram_seated",
+ "_bolt_offsets_in_platform", "_bolt_axis_cos", "_bolt_offsets_in_case", "_leg_offsets_in_table", "_leg_axis_cos",
+ "_weld_targets", "_nut_offsets_in_bolt", "_nut_axis_cos", "_card_offset_in_case", "_ram_offsets_in_case",
+ "_axis_cos", "_part_axis_cos",
+ # packing scenes (pen_holder, tool_packing, egg_carton, clear_organic_objects)
+ "holder_up", "inserted", "settled", "counted", "all_inserted", "holder_placed", "_pen_tensors", "_pen_ends_local",
+ "drawer_pos", "door_pos", "stowed", "drawers_closed", "doors_closed", "_slot_xy", "_item_in_tray",
+ "lid_pos", "lid_closed", "occupied", "_seat_candidates", "_stages_complete",
+ "cleared", "placed_on_tray", "stage_flags", "organics_cleared", "distractors_in_bin", "organics_present",
+ "_in_bin", "_on_tray", "_speed",
+ # puzzle scenes (coffee, syringe, push_shapes, classify_objects); syringe's fixture() writes and stays refused
+ "cover_pos", "cover_closed", "cover_open", "button_depth", "pod_seated", "cup_under_spout", "cup_on_tray",
+ "cup_settled", "running", "filled", "stage_flags",
+ "barrel_axis", "travel", "tip_pos", "plunger_top_w", "seated_reservoir", "well_mouths", "seated_well", "liquid",
+ "doses", "spilled", "drawn", "doses_ok", "parked",
+ "position_error", "orientation_error", "block_bottom_z", "not_lifted", "dropped", "yaw_matched", "stage_live",
+ "sorted_mask", "n_sorted",
+ # cutting scenes (slice, dice); knife_edge only fills a lazy cache of edge samples
+ "pieces_count", "knife_edge", "food_height", "plane_aim_w", "plane_axis_w",
+ # locomanip scenes (box_to_bin, wheel_carry)
+ "placed", "carried_fraction", "box_pose", "wheel_pose",
+ # assembly.so101: frames and seats (pure reads); set_elbow_target and the fastening mechanics stay refused
+ "upper_arm_pose", "lower_arm_pose", "lower_arm_seat_w", "elbow_screw_seats_w", "elbow_horn_screw_seats_w",
+ "_hole_frames_w", "_seats_w", "_elbow_angle_split",
+ # puzzle.spatula: the instantaneous predicates and the blade-frame helpers (pure reads)
+ "tool_lifted_now", "on_blade", "on_pan", "flipped_now", "on_plate", "on_bare_surface", "loaded_now",
+ "served_now", "carry_tilt_deg", "_bread_tensors", "_bread_up", "_blade_up", "_bread_in_blade_frame",
+ "_stage_table",
+}
+READ_METHODS_ROBOT = {
+ "get_state", "describe", "name", "prim_name", "action_dim", "control_period", "control_dt",
+ "actuator_limits", "joint_names", "body_names",
+}
+MAX_HANDLES = 500_000 # cap the trusted-side handle table (a solution cannot grow it without bound)
+
+
+class Refused(Exception):
+ pass
+
+
+class Server:
+ """Answers one solution process's requests on the trusted env. Objects stay here; the other side gets copies of
+ data and integer handles for everything else."""
+
+ def __init__(self, env, on_step):
+ self.env = env
+ self.on_step = on_step # callable(action tensor) -> None; raises StopRollout to end
+ self.objs: dict[int, tuple] = {0: ("obj", env)}
+ self.ids: dict[int, int] = {id(env): 0}
+ self.method_ids: dict[tuple, int] = {}
+ self.n_requests = 0
+ self.n_refused = 0
+ self.refusals: list[str] = []
+ from robobench.core.scene import BaseScene
+ from robobench.core.robot import BaseRobot
+ self._scene_types = (BaseScene,)
+ self._robot_types = (BaseRobot,)
+
+ # -- handles
+ def handle_of(self, obj) -> dict:
+ import types
+ if isinstance(obj, types.ModuleType):
+ raise Refused("modules are not reachable from the graded env")
+ key = id(obj)
+ h = self.ids.get(key)
+ if h is None or self.objs[h][1] is not obj:
+ if len(self.objs) >= MAX_HANDLES:
+ raise StopRollout(f"handle_cap ({MAX_HANDLES} handles)")
+ h = len(self.objs)
+ self.objs[h] = ("obj", obj)
+ self.ids[key] = h
+ return {"__h__": h, "type": type(obj).__name__, "callable": callable(obj)}
+
+ def method_handle(self, owner, name: str) -> dict:
+ key = (id(owner), name) # dedup: reading the same method twice reuses its handle
+ h = self.method_ids.get(key)
+ if h is None or self.objs.get(h) != ("method", owner, name):
+ if len(self.objs) >= MAX_HANDLES:
+ raise StopRollout(f"handle_cap ({MAX_HANDLES} handles)")
+ h = len(self.objs)
+ self.objs[h] = ("method", owner, name)
+ self.method_ids[key] = h
+ return {"__h__": h, "type": f"{type(owner).__name__}.{name}", "callable": True}
+
+ def resolve(self, d: dict):
+ h = int(d["__h__"])
+ if h not in self.objs:
+ raise Refused(f"unknown handle {h}")
+ ent = self.objs[h]
+ if ent[0] == "method":
+ raise Refused("a method cannot be passed as an argument")
+ return ent[1]
+
+ def value(self, v):
+ from esw_proxy import encode
+ return encode(v, self.handle_of)
+
+ # -- policy
+ def allowed_call(self, owner, name: str) -> bool:
+ if owner is self.env:
+ return name in ENV_CALLS
+ if name in ("on_bind", "actuator_sink", "build_controller"):
+ return False
+ # privileged ground-truth objects: the audited exact-name allowlist alone decides (a listed read such as
+ # `settled` or `inserted` must not fall to the write-verb regex)
+ if isinstance(owner, self._scene_types):
+ return name in READ_METHODS_SCENE
+ if isinstance(owner, self._robot_types):
+ return name in READ_METHODS_ROBOT
+ if WRITE_RE.match(name): # leaf objects (configs, articulations): name heuristic
+ return False
+ return bool(READ_RE.match(name))
+
+ def getattr(self, obj, name: str):
+ if not isinstance(name, str) or (name.startswith("__") and name.endswith("__")) or name in ("_grader", "_env"):
+ raise Refused(f"attribute {name!r} is not readable during grading")
+ v = getattr(obj, name)
+ import inspect
+ if inspect.ismethod(v) or inspect.isbuiltin(v) or inspect.ismethoddescriptor(v) or inspect.isfunction(v) \
+ or type(v).__name__ in ("method-wrapper", "builtin_function_or_method"):
+ return self.method_handle(obj, name)
+ return self.value(v)
+
+ def handle(self, req: dict):
+ from esw_proxy import decode
+ self.n_requests += 1
+ op = req.get("op")
+ if op == "step":
+ import torch
+ a = decode(req.get("action"), self.resolve)
+ a = torch.as_tensor(a, dtype=torch.float32, device="cpu")
+ return self.on_step(a)
+ h = int(req.get("h", -1))
+ if h not in self.objs:
+ raise Refused(f"unknown handle {h}")
+ ent = self.objs[h]
+ if op == "call":
+ if ent[0] != "method":
+ raise Refused(f"{type(ent[1]).__name__} objects are not callable during grading")
+ owner, name = ent[1], ent[2]
+ if owner is self.env and name == "step":
+ args = decode(req.get("args"), self.resolve)
+ return self.on_step(__import__("torch").as_tensor(args[0], dtype=__import__("torch").float32))
+ if owner is self.env and name in ("reset", "set_states"):
+ raise PermissionError("blocked during grading — solve may only step forward")
+ if not self.allowed_call(owner, name):
+ raise PermissionError(f"blocked during grading: {type(owner).__name__}.{name}() is not a read")
+ args = decode(req.get("args"), self.resolve)
+ kwargs = decode(req.get("kwargs"), self.resolve)
+ return self.value(getattr(owner, name)(*args, **kwargs))
+ if ent[0] == "method":
+ raise Refused("a method handle supports calls only")
+ obj = ent[1]
+ if op == "getattr":
+ return self.getattr(obj, req.get("name"))
+ if op == "getitem":
+ return self.value(obj[decode(req.get("key"), self.resolve)])
+ if op == "len":
+ return len(obj)
+ if op == "iter":
+ import itertools
+ return self.value(list(itertools.islice(obj, 100_000))) # never materialize the whole iterable
+ if op == "contains":
+ return decode(req.get("item"), self.resolve) in obj
+ if op == "bool":
+ return bool(obj)
+ if op == "repr":
+ return repr(obj)[:20000]
+ if op == "dir":
+ return self.value([n for n in dir(obj) if not (n.startswith("__") and n.endswith("__"))])
+ raise Refused(f"unknown operation {op!r}")
+
+
+class StopRollout(Exception):
+ pass
+
+
+def _hide_other_procs() -> None:
+ """Belt to Landlock's suspenders: give the solution a private mount namespace with /proc remounted
+ hidepid=2, so other processes' /proc entries (cmdline, environ, fd, mem of the trusted sim) are hidden
+ even on a kernel where Landlock is weaker or absent. Best effort: a verifier container without
+ CAP_SYS_ADMIN gets EPERM and this is a no-op (Landlock stays the guarantee, re-checked by
+ esw_proxy._verify_sandbox). Runs while still root, before the setuid below."""
+ import ctypes
+ libc = ctypes.CDLL(None, use_errno=True)
+ CLONE_NEWNS = 0x00020000
+ MS_REC, MS_PRIVATE = 0x4000, 1 << 18
+ if libc.unshare(CLONE_NEWNS) != 0:
+ return
+ libc.mount(None, b"/", None, MS_REC | MS_PRIVATE, None)
+ libc.mount(b"proc", b"/proc", b"proc", 0, b"hidepid=2")
+
+
+def _preexec_nobody():
+ os.setsid()
+ try:
+ _hide_other_procs()
+ except Exception: # noqa: BLE001 — best effort; Landlock + _verify_sandbox are the guarantee
+ pass
+ os.setgroups([])
+ os.setgid(NOBODY)
+ os.setuid(NOBODY)
+
+
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (the solution and anything it started), from a child that runs as that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def prepare_solution(src: Path, dst: Path) -> None:
+ """Copy the solution's regular files (no links, no special files) to a root-owned tree `nobody` can only read."""
+ import shutil
+ if dst.exists():
+ shutil.rmtree(dst)
+ dst.mkdir(parents=True)
+ n = size = 0
+ for root, dirs, files in os.walk(src, followlinks=False):
+ rel = Path(root).relative_to(src)
+ for d in dirs:
+ p = Path(root) / d
+ if not p.is_symlink():
+ (dst / rel / d).mkdir(exist_ok=True)
+ for f in files:
+ p = Path(root) / f
+ if p.is_symlink() or not p.is_file():
+ continue
+ n += 1
+ size += p.stat().st_size
+ if n > 20_000 or size > (2 << 30):
+ raise ValueError("solution larger than 20,000 files or 2 GiB")
+ shutil.copyfile(p, dst / rel / f)
+ for root, dirs, files in os.walk(dst):
+ os.chmod(root, 0o755)
+ for f in files:
+ os.chmod(Path(root) / f, 0o644)
+
+
+TERM = threading.Event() # SIGTERM from the verifier at the candidate's time limit (cmd_rollout)
+
+
+def run_solution(env, solution: Path, work: Path, on_step, deadline: float, log_path: Path) -> dict:
+ """Start the solution process as `nobody` and serve it until solve ends, it dies, the monotonic clock passes
+ `deadline` or TERM is set (status "timeout" for the last two)."""
+ from esw_proxy import LANDLOCK_ABI_MIN, Wire, landlock_abi
+ if landlock_abi() < LANDLOCK_ABI_MIN:
+ raise RuntimeError(f"this kernel offers no Landlock ABI >= {LANDLOCK_ABI_MIN}: the solution cannot be sandboxed")
+ sol = work / "solution"
+ prepare_solution(solution, sol)
+ scratch = work / "scratch"
+ scratch.mkdir(parents=True, exist_ok=True)
+ root = os.geteuid() == 0
+ if root:
+ os.chown(scratch, NOBODY, NOBODY)
+ os.chmod(work, 0o711) # `nobody` may pass through to solution/ and scratch/, not list
+ # the solution's two pipes: it reads requests' answers on c_in, writes requests on c_out
+ p_r, c_w = os.pipe() # child -> parent
+ c_r, p_w = os.pipe() # parent -> child
+ envv = {"PATH": "/opt/robolab/.venv/bin:/usr/local/bin:/usr/bin:/bin", "HOME": str(scratch),
+ "TMPDIR": str(scratch), "LANG": "C.UTF-8", "PYTHONDONTWRITEBYTECODE": "1", "PYTHONHASHSEED": "0",
+ "CUDA_VISIBLE_DEVICES": "", "NVIDIA_VISIBLE_DEVICES": "", "OMP_NUM_THREADS": "4",
+ "MKL_NUM_THREADS": "4", "OPENBLAS_NUM_THREADS": "4"}
+ logf = open(log_path, "ab")
+ os.chmod(log_path, 0o600)
+ cmd = [sys.executable, "-I", "-B", str(HERE / "esw_proxy.py"), str(c_r), str(c_w), str(sol), BENCH_ROOT]
+ proc = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=logf, stderr=logf, env=envv, cwd=str(scratch),
+ pass_fds=(c_r, c_w), preexec_fn=_preexec_nobody if root else os.setsid)
+ os.close(c_r)
+ os.close(c_w)
+ wire = Wire(p_r, p_w)
+ srv = Server(env, on_step)
+ out = {"solve_status": "running", "requests": 0, "refused": 0}
+ t_start = time.monotonic()
+ timer_fired = threading.Event()
+
+ def watchdog():
+ while proc.poll() is None:
+ if time.monotonic() > deadline or TERM.is_set():
+ timer_fired.set()
+ try:
+ os.killpg(proc.pid, signal.SIGKILL)
+ except (ProcessLookupError, PermissionError):
+ pass
+ kill_uid()
+ return
+ time.sleep(0.2)
+ threading.Thread(target=watchdog, daemon=True).start()
+ t0 = None
+ try:
+ wire.send({"op": "hello", "root": srv.handle_of(env), "protocol": "esw-proxy/1", "scratch": str(scratch)})
+ while True:
+ try:
+ req = wire.recv()
+ except (EOFError, ValueError, OSError) as exc:
+ out["solve_status"] = "timeout" if timer_fired.is_set() else "process_ended"
+ out["solve_error"] = None if timer_fired.is_set() else f"connection: {exc}"
+ break
+ if not isinstance(req, dict):
+ wire.send({"error": "malformed request", "kind": "ValueError"})
+ continue
+ op = req.get("op")
+ if op == "loaded":
+ t0 = time.monotonic()
+ out["load_s"] = round(t0 - t_start, 3)
+ wire.send({"value": None})
+ continue
+ if op == "done":
+ if req.get("sandbox_failed"):
+ out["solve_status"] = "sandbox_failed"
+ out["sandbox_error"] = str(req["sandbox_failed"])[:500]
+ break
+ out["solve_status"] = "error" if req.get("error") else "returned"
+ out["solve_error"] = req.get("error")
+ out["sandbox"] = req.get("sandbox")
+ break
+ try:
+ v = srv.handle(req)
+ wire.send({"value": v if op != "step" else None})
+ except StopRollout as exc:
+ out["solve_status"] = str(exc)
+ wire.send({"error": str(exc), "kind": "RuntimeError", "stop": True})
+ break
+ except (Refused, PermissionError) as exc:
+ srv.n_refused += 1
+ if len(srv.refusals) < 50:
+ srv.refusals.append(f"{req.get('op')}:{req.get('name', '')}: {exc}"[:300])
+ wire.send({"error": str(exc), "kind": "PermissionError"})
+ except Exception as exc: # noqa: BLE001 — the solve's error (a bad attribute, a bad index) is its own
+ wire.send({"error": f"{type(exc).__name__}: {exc}"[:4000], "kind": type(exc).__name__})
+ if time.monotonic() > deadline or TERM.is_set():
+ out["solve_status"] = "timeout"
+ break
+ finally:
+ try:
+ os.killpg(proc.pid, signal.SIGKILL)
+ except (ProcessLookupError, PermissionError):
+ pass
+ kill_uid() # every process the solution started ends before the verdict
+ try:
+ proc.wait(timeout=10)
+ except subprocess.TimeoutExpired:
+ pass
+ logf.close()
+ out.update(requests=srv.n_requests, refused=srv.n_refused, refusals=srv.refusals,
+ solve_wall_s=round(time.monotonic() - t0, 3) if t0 else 0.0)
+ if out["solve_status"] == "running":
+ out["solve_status"] = "process_ended"
+ return out
+
+
+# ------------------------------------------------------------------------------------------------ commands
+def cmd_make_instance(a) -> int:
+ """Freeze an instance: the preset, the seed, the device, the start state's hash, its scene state vector (for the
+ comparison on another GPU model) and the GPU model it was frozen on."""
+ launch()
+ inst = {"format": INSTANCE_FORMAT, "preset": a.preset, "seed": int(a.seed), "device": DEVICE}
+ try:
+ env = build(inst)
+ except Exception: # noqa: BLE001 — a failed build writes no instance and exits non-zero
+ traceback.print_exc()
+ stop_app(1)
+ inst["state_sha"] = state_sha(env)
+ inst["gpu_model"] = gpu_model()
+ layout, vec = scene_vector(env)
+ inst["start_state"] = {"layout": layout, "vector": [float(x) for x in vec]}
+ inst["action_dim"] = int(env.robot.action_dim)
+ inst["control_dt"] = round(float(env.dt * env.robot.control_period), 6)
+ inst["physics_dt"] = float(env.dt)
+ Path(a.out).write_text(json.dumps(inst, indent=1, sort_keys=True) + "\n")
+ if a.describe:
+ Path(a.describe).write_text(env.describe().strip() + "\n")
+ print(json.dumps({k: v for k, v in inst.items() if k != "start_state"}), flush=True)
+ stop_app()
+ return 0
+
+
+def _graded_env(inst: dict, grader_path: str | None):
+ env = build(inst)
+ grader = load_grader(grader_path, inst["preset"])(env) if grader_path else None
+ return env, grader
+
+
+def _final(env, grader, inst: dict) -> dict:
+ if grader is not None:
+ v = grader.verdict()[0]
+ success, score = bool(v["success"]), float(v["score"])
+ else:
+ success, score = bool(task_success(env, inst["preset"])[0]), None
+ out = {"success": success, "progress": score, "final_sha": state_sha(env)}
+ tc = tool_contact(env)
+ if tc is not None:
+ out.update(tc, disqualified=tc["tool_contact"])
+ if tc["tool_contact"]: # the episode is disqualified: no success, no progress
+ out.update(success=False, progress=0.0 if score is not None else None)
+ return out
+
+
+def _unreadable_final(env, grader, exc) -> dict:
+ """The verdict when the grader cannot read the state (after a failed step): success 0, progress = the rubric's
+ peak recorded before (0 when a tool-only rule disqualified the episode)."""
+ out = {"success": False, "progress": _peak(grader), "final_sha": None,
+ "final_error": f"{type(exc).__name__}: {exc}"[:500]}
+ tc = tool_contact(env)
+ if tc is not None:
+ out.update(tc, disqualified=tc["tool_contact"])
+ if tc["tool_contact"]:
+ out["progress"] = 0.0
+ return out
+
+
+def _peak(grader) -> float:
+ try:
+ return max((float(step[0]["progress"]) for step in grader.history), default=0.0)
+ except Exception: # noqa: BLE001
+ return 0.0
+
+
+_PHASE = ["boot"]
+
+
+def _set_phase(out: Path, phase: str) -> None:
+ """The rollout's phase, in OUT/phase.json: the verifier reads it when the process ends without a result (killed at
+ the time limit): in "solve" that is the candidate's 0, in any other phase the verifier's error."""
+ _PHASE[0] = phase
+ (out / "phase.json").write_text(json.dumps({"phase": phase}) + "\n")
+
+
+def _on_term(signum, frame) -> None:
+ if _PHASE[0] != "solve":
+ return # finalizing: the verdict is on its way (the verifier allows a grace period)
+ TERM.set() # run_solution ends the solve; the verdict is read on the state at this moment
+
+
+def cmd_rollout(a) -> int:
+ """The graded run of one candidate. Prints one JSON line (also written to OUT/rollout.json); the trajectory goes to
+ OUT/trajectory.npz. The time limit (`--timeout`) runs from this process's start (T_START)."""
+ import torch
+ out = Path(a.out)
+ out.mkdir(parents=True, exist_ok=True)
+ res: dict = {"phase": "boot", "label": a.label or ""}
+ deadline = T_START + float(a.timeout)
+ _set_phase(out, "boot")
+ try:
+ launch()
+ inst = load_instance(a.instance)
+ env, grader = _graded_env(inst, a.grader)
+ res.update(check_start(env, inst), boot_s=round(time.monotonic() - T_START, 1))
+ if res["instance_mismatch"]:
+ res.update(phase="instance_mismatch", infra_error=1)
+ raise StopRollout("instance_mismatch")
+ if time.monotonic() > deadline:
+ res.update(phase="boot_timeout", infra_error=1)
+ raise StopRollout("boot_timeout")
+ rec = Recorder(env, inst["preset"], int(inst["seed"]))
+ rec.frame() # the start state
+ step_s = [0.0]
+ bad = [0]
+ step_err: list = [] # (index, message) of every env.step that raised
+
+ def on_step(act):
+ if act.numel() != env.num_envs * env.robot.action_dim:
+ bad[0] += 1
+ raise ValueError(f"action has {act.numel()} values; the env takes ({env.num_envs}, "
+ f"{env.robot.action_dim})")
+ if not bool(torch.isfinite(act).all()):
+ bad[0] += 1
+ raise ValueError("action contains NaN or inf")
+ if len(rec.actions) >= MAX_STEPS:
+ raise StopRollout(f"step_cap ({MAX_STEPS} control steps)")
+ act = act.reshape(env.num_envs, env.robot.action_dim).contiguous()
+ rec.actions.append(act[0].numpy().copy()) # recorded BEFORE the step: a step that raises is in the record
+ t = time.perf_counter()
+ try:
+ env.step(act.to(env.device))
+ if grader is not None:
+ grader.record()
+ except Exception as exc: # noqa: BLE001 — the env could not take this action (e.g. a controller
+ # singularity). As in EmbodiedSWE's GradedEnv, the error reaches solve: the rollout goes on if solve
+ # handles it, and ends (verdict on the state then) if it does not.
+ step_err.append((len(rec.actions) - 1, f"{type(exc).__name__}: {exc}"[:1000]))
+ raise
+ finally:
+ step_s[0] += time.perf_counter() - t
+ rec.after_step()
+ return None
+
+ res["phase"] = "solve"
+ _set_phase(out, "solve")
+ signal.signal(signal.SIGTERM, _on_term)
+ run = run_solution(env, Path(a.solution), out / "work", on_step, deadline, Path(a.solve_log))
+ _set_phase(out, "finalize")
+ res.update(run, terminated=int(TERM.is_set()))
+ if run.get("solve_status") == "sandbox_failed":
+ res.update(phase="sandbox_failed", infra_error=1)
+ raise StopRollout("sandbox_failed")
+ if step_err:
+ res.update(step_errors=len(step_err), step_error_at=step_err[0][0], step_error=step_err[0][1])
+ try:
+ res.update(_final(env, grader, inst))
+ except Exception as exc: # noqa: BLE001 — the env may be unusable after the failed step: success 0,
+ # progress = the rubric's peak recorded before it (the grader's own record of the run)
+ res.update(_unreadable_final(env, grader, exc))
+ else:
+ res.update(_final(env, grader, inst))
+ try:
+ rec.frame() # the final state
+ except Exception as exc: # noqa: BLE001 — an env broken by a failed step: the trajectory ends at its last frame
+ res["final_frame_error"] = f"{type(exc).__name__}: {exc}"[:300]
+ rec.save(out / "trajectory.npz", label=a.label or "", final_sha=res.get("final_sha") or "")
+ n = len(rec.actions)
+ res.update(phase="done", n_actions=n, n_frames=len(rec.steps), frame_every=rec.every, bad_actions=bad[0],
+ sim_step_s=round(step_s[0], 3), ms_per_step=round(1000 * step_s[0] / max(1, n), 3), infra_error=0)
+ _set_phase(out, "done")
+ except StopRollout:
+ pass
+ except Exception: # noqa: BLE001
+ res.update(infra_error=1, error=traceback.format_exc()[-4000:])
+ res["wall_s"] = round(time.monotonic() - T_START, 1)
+ (out / "rollout.json").write_text(json.dumps(res, indent=1) + "\n")
+ print(json.dumps(res), flush=True)
+ stop_app()
+ return 0
+
+
+def _load_actions(path: str, preset: str, action_dim: int):
+ import numpy as np
+ d = np.load(path, allow_pickle=False)
+ if str(d["task"]) != preset:
+ raise ValueError("trajectory of another task")
+ A = np.asarray(d["actions"], dtype=np.float32)
+ if A.ndim != 2 or A.shape[1] != action_dim or len(A) > MAX_STEPS or not np.isfinite(A).all():
+ raise ValueError("malformed trajectory")
+ return A
+
+
+def _build_with_camera(inst: dict, make_camera):
+ """`build(inst)` exactly as grading builds it, plus a camera: the camera prim is added just before the env's own
+ (single) `sim.reset()`, and that reset skips Isaac Lab's two warm-up renders (they and an extra `sim.reset()`
+ change later physics bits), so the camera's env starts from the graded start state. Frames drawn between steps can
+ still change GPU PhysX's later bits (measured in the stack scene; not in SO101's). `make_camera()` is called once
+ and its result returned with the env."""
+ from isaaclab.sim import SimulationContext
+ made: list = []
+
+ def reset(self, soft: bool = False): # Isaac Lab's reset minus the warm-up renders
+ self._disable_app_control_on_stop_handle = True
+ super(SimulationContext, self).reset(soft=soft)
+ if self.physics_sim_view:
+ self.physics_sim_view._backend.initialize_kinematic_bodies()
+ self._disable_app_control_on_stop_handle = False
+
+ env = build(inst, before_reset=lambda: made or made.append(make_camera()), reset_impl=reset)
+ if not made:
+ raise RuntimeError("the env build did not reset the simulation: no camera")
+ return env, made[0]
+
+
+def _unflatten(row, layout: list, device):
+ """Isaac Lab's scene-state dict from one recorded state vector (Recorder) for `InteractiveScene.reset_to`."""
+ import torch
+ st: dict = {}
+ i = 0
+ for path, shape in layout:
+ n = 1
+ for d in shape:
+ n *= int(d)
+ node = st
+ keys = path.strip("/").split("/")
+ for k in keys[:-1]:
+ node = node.setdefault(k, {})
+ node[keys[-1]] = torch.as_tensor(row[i:i + n], dtype=torch.float32, device=device).reshape(shape)
+ i += n
+ if i != len(row):
+ raise ValueError("a recorded state does not match its layout")
+ return st
+
+
+def load_trajectory(path: str, preset: str, action_dim: int) -> dict:
+ import numpy as np
+ d = np.load(path, allow_pickle=False)
+ A = _load_actions(path, preset, action_dim)
+ steps = np.asarray(d["frame_step"], dtype=np.int64)
+ S = np.asarray(d["frame_state"], dtype=np.float32)
+ layout = json.loads(str(d["state_layout"]))
+ if S.ndim != 2 or len(S) != len(steps) or len(S) > MAX_FRAMES + 1 \
+ or (len(steps) and (steps.min() < 0 or steps.max() > len(A) or (np.diff(steps) <= 0).any())):
+ raise ValueError("malformed trajectory states")
+ return {"actions": A, "steps": steps, "states": S, "layout": layout,
+ "label": str(d["label"]) if "label" in d else "", "final_sha": str(d["final_sha"]) if "final_sha" in d else ""}
+
+
+def cmd_video(a) -> int:
+ """The selected candidate's video, from its trajectory, in this fresh process (never part of a verdict):
+ 1. the camera replay, a diagnostic: the recorded actions re-executed with the camera drawing at the recorded
+ frames, as a live recording would (drawing can change GPU PhysX's later bits, so it may end elsewhere):
+ `camera_replay` (done / budget / error), `camera_replay_match` (its final state hash equals the graded run's),
+ `camera_replay_success` (the task's public predicate at its end); at most `--replay-budget` seconds;
+ 2. the video: each recorded state posed on the bodies (InteractiveScene.reset_to, no physics step) and drawn, so
+ the video shows the graded run's own states (Isaac Lab's scene state: poses and joints; a scene's non-physical
+ visuals are not part of it); a recorded state with a non-finite value is skipped (`frames_nonfinite`)."""
+ import numpy as np
+ import torch
+ res: dict = {}
+ try:
+ launch(cameras=True)
+ import imageio.v2 as imageio
+ import isaaclab.sim as sim_utils
+ from isaaclab.sensors import Camera, CameraCfg
+ inst = load_instance(a.instance)
+ env, cam = _build_with_camera(inst, lambda: Camera(CameraCfg(
+ prim_path="/World/esw_cam", update_period=0.0, height=a.height, width=a.width, data_types=["rgb"],
+ spawn=sim_utils.PinholeCameraCfg(focal_length=18.0, clipping_range=(0.01, 100.0)))))
+ st = check_start(env, inst)
+ res.update(camera_instance_ok=st["instance_ok"], camera_instance_max_abs_diff=st["instance_max_abs_diff"])
+ eye, target = (env.room or {}).get("camera") or ((1.6, -1.6, 1.4), (0.3, 0.0, 0.5))
+ if a.eye and a.target:
+ eye, target = [float(v) for v in a.eye.split(",")], [float(v) for v in a.target.split(",")]
+ cam.set_world_poses_from_view(torch.tensor([list(eye)], device=env.device),
+ torch.tensor([list(target)], device=env.device))
+ tr = load_trajectory(a.traj, inst["preset"], env.robot.action_dim)
+ A, steps = tr["actions"], tr["steps"]
+ final_sha = a.final_sha or tr["final_sha"]
+ res["label"] = tr["label"]
+ drawn = [0]
+
+ def draw():
+ for _ in range(1 if drawn[0] else 3): # the renderer's first 2 frames are dark
+ env.sim.render()
+ cam.update(env.dt)
+ drawn[0] += 1
+ return cam.data.output["rgb"][0].detach().cpu().numpy()[..., :3]
+
+ # 1. the camera replay
+ status, t1 = "done", time.monotonic()
+ try:
+ at = set(int(s) for s in steps)
+ if 0 in at:
+ draw()
+ for i, row in enumerate(A):
+ if time.monotonic() - t1 > a.replay_budget:
+ status = "budget"
+ break
+ try:
+ env.step(torch.from_numpy(row).reshape(1, -1).to(env.device))
+ except Exception: # noqa: BLE001 — the graded run raised on this step too and went on
+ res.setdefault("camera_replay_step_error_at", i)
+ continue
+ if i + 1 in at:
+ draw()
+ if status == "done":
+ fsha = state_sha(env)
+ res.update(camera_replay_match=int(bool(final_sha) and fsha == final_sha),
+ camera_replay_success=int(bool(task_success(env, inst["preset"])[0])))
+ except Exception as exc: # noqa: BLE001
+ status = "error"
+ res["camera_replay_error"] = f"{type(exc).__name__}: {exc}"[:500]
+ res.update(camera_replay=status, camera_replay_s=round(time.monotonic() - t1, 1),
+ camera_replay_frames=drawn[0])
+ # 2. the video: the recorded states, posed and drawn
+ w = imageio.get_writer(a.video, fps=a.fps, codec="libx264", quality=7, macro_block_size=8)
+ n = skipped = 0
+ t2 = time.monotonic()
+ for row in tr["states"]:
+ if not np.isfinite(row).all(): # a state the run's physics blew up (NaN): nothing to pose
+ skipped += 1
+ continue
+ env.iscene.reset_to(_unflatten(row, tr["layout"], env.device), is_relative=False)
+ env.sim.forward()
+ f = draw()
+ if f.size and f.any():
+ w.append_data(f)
+ n += 1
+ w.close()
+ res.update(video=a.video, frames=n, video_ok=int(n > 0), video_source="recorded_states",
+ frames_nonfinite=skipped, pose_s=round(time.monotonic() - t2, 1))
+ except Exception: # noqa: BLE001
+ res.update(video_ok=0, error=traceback.format_exc()[-4000:])
+ res["wall_s"] = round(time.monotonic() - T_START, 1)
+ print(json.dumps(res), flush=True)
+ stop_app()
+ return 0
+
+
+def cmd_check(a) -> int:
+ """The graded flow without the hidden grader (development): solve as `nobody` through the proxy."""
+ a.grader = None
+ a.out = a.out or "/tmp/esw_check"
+ a.solve_log = a.solve_log or str(Path(a.out) / "solve.log")
+ Path(a.out).mkdir(parents=True, exist_ok=True)
+ return cmd_rollout(a)
+
+
+# ------------------------------------------------------------------------------------------------ development API
+def make_env(instance: str = "/app/instance.json", cameras: bool = False):
+ """The task's env for development, built and reset exactly as grading builds it (then yours to use freely).
+ Launches Isaac Sim (headless, GPU PhysX) first if this process has not."""
+ launch(cameras=cameras)
+ inst = load_instance(instance)
+ env = build(inst)
+ st = check_start(env, inst)
+ if not st["instance_ok"]:
+ log(f"note: the start state differs from the frozen instance's hash (GPU {st['gpu_model']!r}, frozen on "
+ f"{st['instance_gpu']!r}; max abs difference {st['instance_max_abs_diff']:.3g})")
+ return env
+
+
+def main(argv=None) -> int:
+ ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ sub = ap.add_subparsers(dest="cmd", required=True)
+ p = sub.add_parser("make-instance")
+ p.add_argument("--preset", required=True, choices=sorted(TASKS))
+ p.add_argument("--seed", type=int, default=0)
+ p.add_argument("--out", required=True)
+ p.add_argument("--describe", default=None, help="also write env.describe() here (the task's instruction text)")
+ for name in ("rollout", "check"):
+ p = sub.add_parser(name)
+ p.add_argument("--instance", default="/app/instance.json")
+ if name == "rollout":
+ p.add_argument("--grader", required=True)
+ p.add_argument("--solution", default="/app/output/solution")
+ p.add_argument("--out", default=None if name == "check" else "/var/lib/esw/rollout")
+ p.add_argument("--timeout", type=float, default=ROLLOUT_TIMEOUT_S,
+ help="the time limit from this process's start (start-up and import count)")
+ p.add_argument("--solve-log", default=None)
+ p.add_argument("--label", default="", help="the candidate's name, kept in the trajectory")
+ p = sub.add_parser("video")
+ p.add_argument("--instance", default="/app/instance.json")
+ p.add_argument("--traj", required=True)
+ p.add_argument("--video", required=True)
+ p.add_argument("--final-sha", default="", help="the graded run's final state hash (default: the trajectory's)")
+ p.add_argument("--replay-budget", type=float, default=1800.0, help="seconds for the camera replay (0: skip it)")
+ p.add_argument("--fps", type=float, default=10.0)
+ p.add_argument("--width", type=int, default=960)
+ p.add_argument("--height", type=int, default=540)
+ p.add_argument("--eye", default=None, help="camera eye x,y,z (env frame); default: the room's camera")
+ p.add_argument("--target", default=None, help="camera target x,y,z")
+ a = ap.parse_args(argv)
+ if a.cmd == "rollout" and not a.solve_log:
+ a.solve_log = str(Path(a.out) / "solve.log")
+ if HERE.as_posix() not in sys.path:
+ sys.path.insert(0, HERE.as_posix())
+ return {"make-instance": cmd_make_instance, "rollout": cmd_rollout, "video": cmd_video, "check": cmd_check}[a.cmd](a)
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/images/embodiedswe-files/FILES.json b/images/embodiedswe-files/FILES.json
new file mode 100644
index 0000000000..0cea471008
--- /dev/null
+++ b/images/embodiedswe-files/FILES.json
@@ -0,0 +1,9 @@
+{
+ "image": "ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b",
+ "source": "embodied_first_exam/benchmarks/embodiedswe",
+ "files": {
+ "esw_proxy.py": "4481f808beaf323aaf6aa02de9c859434e8d614a53e132ab9fc28318d68d271e",
+ "esw_submit.py": "076b47e8657568344ff571c628ac489872578128253e0b440ab02736fe41dc49",
+ "rcb_embodiedswe.py": "79d4f44d2b9b3ccf20185b9195151b9122a8cd510261c17ec1f58ee38fcf7149"
+ }
+}
diff --git a/images/embodiedswe-files/VERSION b/images/embodiedswe-files/VERSION
new file mode 100644
index 0000000000..0d91a54c7d
--- /dev/null
+++ b/images/embodiedswe-files/VERSION
@@ -0,0 +1 @@
+0.3.0
diff --git a/images/embodiedswe/BUILD_ONLY b/images/embodiedswe/BUILD_ONLY
new file mode 100644
index 0000000000..6779dd6f8a
--- /dev/null
+++ b/images/embodiedswe/BUILD_ONLY
@@ -0,0 +1,41 @@
+BUILD_ONLY: ghcr.io/mll-lab-nu/efe-private:embodiedswe-<images/embodiedswe/VERSION> is never public (docs/protocol/README.md
+§2.4, D5). Built locally only, not pushed anywhere yet; the EmbodiedSWE tasks name it in their FROM.
+
+Why
+ It contains NVIDIA Isaac Sim 5.1 / Omniverse Kit and the Isaac Lab 2.3.2 wheels (RoboLab's recipe, images/robolab/):
+ NVIDIA licenses them for use, not for redistribution. EmbodiedSWE's asset bundle (Hugging Face
+ EmbodiedSWE/robobench-assets) mixes licences, some non-commercial or store-licensed (CC BY-NC, Fab / Objaverse
+ models): see the bundle's NOTICE / per-asset licence files under /opt/embodiedswe; redistributing the built image
+ would redistribute those too. EmbodiedSWE's code is Apache-2.0 (LICENSE in /opt/embodiedswe).
+
+What the builder accepts
+ - the NVIDIA Isaac Sim / Omniverse licence agreement and NVIDIA's terms for the isaacsim / isaaclab wheels;
+ - RoboLab's Apache-2.0 licence (its code and asset library come with the recipe);
+ - EmbodiedSWE's Apache-2.0 licence and the licences of the assets in its bundle.
+ No account, key or token is needed: everything is downloaded anonymously.
+
+Inputs (all pinned)
+ RoboLab's recipe verbatim (images/robolab/Dockerfile: its inputs are listed in images/robolab/BUILD_ONLY); pin 2.7.0,
+ pin-pink 3.1.0, daqp 0.8.5, numpy 1.26.0, warp-lang 1.11.0 from pypi.org; EmbodiedSWE at commit
+ 67f44e8a2ca51c3e133867e5e669377778e8f97d (git, no history kept); its asset bundle at Hugging Face revision
+ 62fab5b70ccb0103c60c4ca39236abae2cc8e900, every file checked against robobench/assets_manifest.json (sha256) by
+ robobench's own fetch_assets (the deformable suite's bundles excluded).
+
+What the build changes in EmbodiedSWE (scrub_embodiedswe.py, in this folder; upstream is not edited)
+ Keeps robobench/, LICENSE and pyproject.toml only; removes every suite's grader/ and smokes/ (the verifier ships the
+ task's grader from its own tests/), the deformable suite and caches; strips all comments and non-module docstrings
+ from the suites' binding files (configs/envs.py: calibration notes of solved bindings); rewrites the solve-calibrated
+ comments and pointers in the shipped tasks' scene modules and text assets (stances, grasp cells and windows, release
+ recipes, pointers to removed smokes and solutions; a `.usda` edit may touch only `#` lines); removes the working
+ poses from two describe() texts (box_to_bin, wheel_carry: code confined to describe()) and
+ robobench/scripts/robot_binding_smoke.py (a working reach driver). It checks that the code is unchanged otherwise
+ (AST equality without docstrings) and that no banned phrase survives (`--check`).
+
+Data
+ None beyond the image: HF_HUB_OFFLINE=1; nothing is downloaded at run time. Frozen instances live in the task dirs.
+
+Host
+ As RoboLab's (an RTX-class NVIDIA GPU, NVIDIA Container Toolkit, driver 580.x checked); PhysX runs on the CPU.
+
+Build (from the repository root)
+ docker build -t ghcr.io/mll-lab-nu/efe-private:embodiedswe-$(cat images/embodiedswe/VERSION) images/embodiedswe
diff --git a/images/embodiedswe/Dockerfile b/images/embodiedswe/Dockerfile
new file mode 100644
index 0000000000..3acc3e2afa
--- /dev/null
+++ b/images/embodiedswe/Dockerfile
@@ -0,0 +1,115 @@
+# embodiedswe: EmbodiedSWE-Bench (`robobench`, github.com/EmbodiedSWE/EmbodiedSWE at commit 67f44e8a2c) on Isaac Sim 5.1 /
+# Isaac Lab 2.3.2: the PhysX tasks. Two stages:
+# 1. robolab-base: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe, verbatim (images/robolab/Dockerfile; builds from
+# public sources, shares Docker's build cache with the RoboLab tasks). Its RoboLab code and assets are unused here.
+# 2. embodiedswe: robobench at the pinned commit (scrubbed: images/embodiedswe/scrub_embodiedswe.py), its whole-body IK
+# dependencies and Warp at the versions EmbodiedSWE validated its PhysX stack with, its Hugging Face assets checked
+# file by file against the commit's own SHA-256 manifest (robobench/assets_manifest.json), and this benchmark's
+# tooling (/opt/efe: rcb_embodiedswe.py, esw_proxy.py). Nothing is downloaded at run time (HF_HUB_OFFLINE=1).
+# Contains NVIDIA Isaac Sim (no redistribution) and CC BY-NC / Fab-licensed assets: BUILD_ONLY (images/embodiedswe/BUILD_ONLY).
+# >>> images/robolab/Dockerfile
+# robolab: NVIDIA RoboLab v0.3.1 (Isaac Lab 2.3.2.post1 / Isaac Sim 5.1.0, the `isaac51` extra) installed from OUR lockfile
+# (images/robolab/uv.lock, generated with `uv lock` from RoboLab's pyproject at v0.3.1: torch 2.7.0+cu128, numpy 1.26.0,
+# isaacsim 5.1.0.0), RoboLab's Apache-2.0 asset library (~6 GB, git LFS) and the remote files its USD layers reference.
+# Infrastructure only, no benchmark code; nothing is mounted or downloaded at run time. Isaac Sim needs an RTX-class GPU even
+# headless: a task's compose reserves it and mounts a trial-scoped cache volume at /cache (shader/extension cache).
+# Every RoboLab task's Dockerfile starts with this recipe (scripts/task_conventions.py normalize copies it there) and builds
+# it when the runner cannot pull ghcr.io/mll-lab-nu/efe-private:robolab-<VERSION>, the same recipe built with inline cache.
+# The recipe needs no build context: the repository's files come by URL at a pinned commit, each checked by its sha256
+# (a commit a tag keeps reachable; a change to uv.lock, mirror_remote_assets.py or remote_assets.sha256 = a new commit and
+# checksum here + a new VERSION).
+# Building it accepts the NVIDIA Isaac Sim / Omniverse licence (images/robolab/BUILD_ONLY).
+FROM docker.io/nvidia/cuda:12.8.1-base-ubuntu22.04@sha256:001469ea0f3dec85a1ca929aeea3b58ae369d4c11228b10aec1f642bb6ca7a6f AS robolab-base
+ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 UV_LINK_MODE=copy \
+ NVIDIA_DRIVER_CAPABILITIES=all VK_DRIVER_FILES=/etc/vulkan/icd.d/nvidia_icd.json \
+ OMNI_KIT_ACCEPT_EULA=YES ACCEPT_EULA=Y OMNI_KIT_ALLOW_ROOT=1
+# system libraries from the Ubuntu archive as it was on 2026-10-01 (snapshot.ubuntu.com), and the NVIDIA Vulkan / EGL loader entries
+RUN rm -f /etc/apt/sources.list.d/cuda*.list && \
+ sed -i -e 's|http://archive.ubuntu.com/ubuntu/|http://snapshot.ubuntu.com/ubuntu/20261001T000000Z/|' \
+ -e 's|http://security.ubuntu.com/ubuntu/|http://snapshot.ubuntu.com/ubuntu/20261001T000000Z/|' /etc/apt/sources.list && \
+ apt-get -o Acquire::Retries=10 update && apt-get -o Acquire::Retries=10 install -y --no-install-recommends \
+ curl ca-certificates git git-lfs ffmpeg \
+ libvulkan1 libegl1 libgl1 libglvnd0 libglu1-mesa libx11-6 libxt6 libxext6 libxrender1 libxi6 libxrandr2 libxinerama1 \
+ libxcursor1 libsm6 libice6 libgomp1 libglib2.0-0 libxkbcommon0 libxkbcommon-x11-0 libfontconfig1 libfreetype6 && \
+ rm -rf /var/lib/apt/lists/* && mkdir -p /etc/vulkan/icd.d /etc/vulkan/implicit_layer.d /usr/share/glvnd/egl_vendor.d && \
+ printf '{\n "file_format_version" : "1.0.0",\n "ICD" : {\n "library_path" : "libGLX_nvidia.so.0",\n "api_version" : "1.3.194"\n }\n}\n' > /etc/vulkan/icd.d/nvidia_icd.json && \
+ printf '{\n "file_format_version" : "1.0.0",\n "layer": {\n "name": "VK_LAYER_NV_optimus",\n "type": "INSTANCE",\n "library_path": "libGLX_nvidia.so.0",\n "api_version" : "1.3.194",\n "implementation_version" : "1",\n "description" : "NVIDIA Optimus layer",\n "functions": {\n "vkGetInstanceProcAddr": "vk_optimusGetInstanceProcAddr",\n "vkGetDeviceProcAddr": "vk_optimusGetDeviceProcAddr"\n },\n "enable_environment": {\n "__NV_PRIME_RENDER_OFFLOAD": "1"\n },\n "disable_environment": {\n "DISABLE_LAYER_NV_OPTIMUS_1": ""\n }\n }\n}\n' > /etc/vulkan/implicit_layer.d/nvidia_layers.json && \
+ printf '{\n "file_format_version" : "1.0.0",\n "ICD" : {\n "library_path" : "libEGL_nvidia.so.0"\n }\n}\n' > /usr/share/glvnd/egl_vendor.d/10_nvidia.json
+COPY --from=ghcr.io/astral-sh/uv:0.13.0@sha256:cdc6093146eb3ff6a40107b38f008b789e050e77ad87865e381d9917da55a168 /uv /uvx /root/.local/bin/
+ENV PATH="/root/.local/bin:${PATH}"
+# RoboLab's code at v0.3.1 (LFS pointers only), then the asset library as its own layer (every LFS file present)
+RUN git init -q /opt/robolab && cd /opt/robolab && git remote add origin https://github.com/NVlabs/RoboLab && \
+ git fetch -q --depth 1 origin 9db0aaf09d9fe5d4f37b168320788258c7012463 && GIT_LFS_SKIP_SMUDGE=1 git checkout -q FETCH_HEAD && \
+ test "$(git rev-parse HEAD)" = 9db0aaf09d9fe5d4f37b168320788258c7012463
+WORKDIR /opt/robolab
+RUN git lfs pull && test -z "$(git lfs ls-files | grep -v '^[0-9a-f]* \* ')" && \
+ (git lfs prune -f --verify-remote=false >/dev/null 2>&1 || true) && rm -rf /opt/robolab/.git/lfs
+# lockfile-exact install of RoboLab + the Isaac 5.1 stack (isaacsim wheels from pypi.nvidia.com, declared in RoboLab's pyproject)
+ADD --chmod=644 --checksum=sha256:8e7ff47350cbce86ba30ec9cf59dcb5737efdbfc367a30144a9a7ea857e7c588 https://raw.githubusercontent.com/mll-lab-nu/embodied-first-exam/ce96d0f0ad5ae48c818deb1ad770cf5d89abb08b/images/robolab/uv.lock /opt/robolab/uv.lock
+RUN uv python install 3.11.17 && uv venv -p 3.11.17 .venv && uv sync --frozen --extra isaac51 && rm -rf /root/.cache/uv
+ENV PATH="/opt/robolab/.venv/bin:${PATH}" VIRTUAL_ENV=/opt/robolab/.venv
+# Kit caches (shaders, extension registry, user data) live under /cache so a task's compose can keep them in a volume
+RUN mkdir -p /cache/ov-cache /cache/ov-data /cache/ov-logs /root/.cache /root/.local/share /root/.nvidia-omniverse /app/output && \
+ ln -s /cache/ov-cache /root/.cache/ov && ln -s /cache/ov-data /root/.local/share/ov && ln -s /cache/ov-logs /root/.nvidia-omniverse/logs
+# the remote files RoboLab's USD layers reference on NVIDIA's public Omniverse content bucket, copied to
+# /opt/robolab/assets/_remote, each checked against remote_assets.sha256, and the layers pointed at the copies (tasks run offline)
+ADD --chmod=644 --checksum=sha256:05492bd92e016b68d00a4bcf7e0530964480f430e271970f330ca2bea8908694 https://raw.githubusercontent.com/mll-lab-nu/embodied-first-exam/ce96d0f0ad5ae48c818deb1ad770cf5d89abb08b/images/robolab/mirror_remote_assets.py /opt/robolab/mirror_remote_assets.py
+ADD --chmod=644 --checksum=sha256:c4ae7e62d3d7285e26218e9aec8d5cd8c92fe3d2c1f81d6d931c536a8550f998 https://raw.githubusercontent.com/mll-lab-nu/embodied-first-exam/ce96d0f0ad5ae48c818deb1ad770cf5d89abb08b/images/robolab/remote_assets.sha256 /opt/robolab/remote_assets.sha256
+RUN python /opt/robolab/mirror_remote_assets.py /opt/robolab/assets /opt/robolab/assets/_remote --check /opt/robolab/remote_assets.sha256
+# apt read the Ubuntu archive snapshot above, so the build's packages stay pinned; the image itself points apt back at the
+# Ubuntu archive (the base image's sources.list, byte for byte): an `apt-get update` at run time is fast and reliable
+RUN sed -i -e '/ jammy-security /s|http://snapshot.ubuntu.com/ubuntu/20261001T000000Z/|http://security.ubuntu.com/ubuntu/|' \
+ -e 's|http://snapshot.ubuntu.com/ubuntu/20261001T000000Z/|http://archive.ubuntu.com/ubuntu/|' /etc/apt/sources.list && \
+ echo "15a39563d491def84446c8a5304e873a6b6509d56e2b54edce8eea154e1290a0 /etc/apt/sources.list" | sha256sum -c -
+WORKDIR /app
+# <<< images/robolab/Dockerfile
+
+FROM robolab-base AS embodiedswe
+ARG ESW_COMMIT=67f44e8a2ca51c3e133867e5e669377778e8f97d
+# whole-body IK for the G1 pink_ik bindings (EmbodiedSWE README), Warp as EmbodiedSWE's validated PhysX stack (1.11.0)
+RUN uv pip install --python /opt/robolab/.venv/bin/python "pin==2.7.0" "pin-pink==3.1.0" "daqp==0.8.5" "numpy==1.26.0" \
+ "warp-lang==1.11.0" && rm -rf /root/.cache/uv && \
+ python -c "import numpy, warp, pink, pinocchio; assert numpy.__version__ == '1.26.0', numpy.__version__; print('warp', warp.__version__, 'pin', pinocchio.__version__)"
+# robobench at the pinned commit. Only robobench/, LICENSE and pyproject.toml are kept; .git goes in the same RUN (the
+# repository's history holds solve-calibrated configurations), and the scrub removes the graders, the smoke probes and
+# the solve-calibrated notes before anything is compiled.
+COPY scrub_embodiedswe.py /opt/efe/build/scrub_embodiedswe.py
+RUN git init -q /tmp/esw && cd /tmp/esw && git remote add origin https://github.com/EmbodiedSWE/EmbodiedSWE && \
+ git fetch -q --depth 1 origin ${ESW_COMMIT} && git checkout -q FETCH_HEAD && test "$(git rev-parse HEAD)" = "${ESW_COMMIT}" && \
+ rm -rf .git && mkdir -p /opt/embodiedswe && cp -a . /opt/embodiedswe/ && cd / && rm -rf /tmp/esw && \
+ python -I /opt/efe/build/scrub_embodiedswe.py /opt/embodiedswe && \
+ python -I /opt/efe/build/scrub_embodiedswe.py /opt/embodiedswe --check
+ENV PYTHONPATH=/opt/embodiedswe:/opt/efe COSIGEN_ASSET_DIR=/opt/embodiedswe
+# the Hugging Face assets of the PhysX suites and their rooms at the manifest's pinned dataset revision, every file
+# checked against its SHA-256 (robobench's own fetch, run once here); the download caches go in the same RUN
+RUN cd /opt/embodiedswe && python -I -c "import sys; sys.path.insert(0, '/opt/embodiedswe'); \
+from robobench.scripts import fetch_assets as f; \
+roots = sorted(r for r in f.load_manifest()['bundles'] if '/deformable/' not in r); print(roots); \
+sys.exit(1 if f.fetch(prefixes=roots) else 0)" && \
+ rm -rf /opt/embodiedswe/.cache /root/.cache/huggingface && \
+ ! grep -rlaE "https?://[A-Za-z0-9.-]*(amazonaws|nvidia|huggingface)" /opt/embodiedswe/robobench --include=*.usda --include=*.mdl
+# Isaac Lab's default ground plane, which puzzle.spatula, puzzle.syringe, cutting.slice and cutting.dice spawn
+# (`GroundPlaneCfg()`: {ISAAC_NUCLEUS_DIR}/Environments/Grid/default_environment.usd), and its whole USD dependency closure
+# (the three textures it references; OmniPBR.mdl is Kit's own), from NVIDIA's public Omniverse content bucket, each checked by
+# its sha256, at the bucket's key layout under /opt/isaac_assets. Isaac Lab's experience files then point the asset root
+# (/persistent/isaac/asset_root/{default,cloud,nvidia}, read by isaaclab.utils.assets) at that mirror, so the scenes load
+# unchanged and offline. Closure + checksums: images/embodiedswe/isaac_assets.json (fetch_isaac_assets.py).
+ADD --chmod=644 --checksum=sha256:deab39088eaf39ed7be951966c5e6bd5e58b90ab64743b0cdc8e5579fd5a99d9 https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png /opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png
+ADD --chmod=644 --checksum=sha256:44fc0e82007bb0bd94631cd7ec45986a71ed74b9413899fbffac13efe151be4b https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png /opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png
+ADD --chmod=644 --checksum=sha256:940b96ee8c8e53bd1acbc770d4ca0ac98bed9c96439ab386d1b27dbc9790cc4e https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png /opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png
+ADD --chmod=644 --checksum=sha256:8a21c317d638d33a4e6c20c958a7ed8f4d8c5195efd7e20f1b85178b4a15638a https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd /opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd
+RUN A=/opt/robolab/.venv/lib/python3.11/site-packages/isaaclab/apps && \
+ sed -i '/^persistent\.isaac\.asset_root\.\(default\|cloud\|nvidia\) = /s#"https://omniverse-content-production\.s3-us-west-2\.amazonaws\.com/Assets/Isaac/5\.1"$#"/opt/isaac_assets/Assets/Isaac/5.1"#' $A/*.kit && \
+ test "$(grep -h '^persistent\.isaac\.asset_root\.\(default\|cloud\|nvidia\) = "/opt/isaac_assets/Assets/Isaac/5\.1"$' $A/*.kit | wc -l)" = 18 && \
+ ! grep -n 'asset_root.*https://' $A/*.kit && chmod -R a+rX /opt/isaac_assets && \
+ test -f /opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd
+ENV HF_HUB_OFFLINE=1 OMNI_KIT_ALLOW_ROOT=1
+# the graded solution process runs as `nobody`: it must reach the interpreter (under /root, traverse only) and read the
+# package trees, never write them. The tooling (rcb_embodiedswe.py, esw_proxy.py) is not in this image: each task copies
+# it to /opt/efe from the files image ghcr.io/mll-lab-nu/efe:embodiedswe-files (source embodied_first_exam/benchmarks/embodiedswe).
+RUN chmod 711 /root && chmod -R a+rX /opt/embodiedswe /root/.local/share/uv && mkdir -p /opt/efe && \
+ python -I -B -c "import sys; sys.path[:0] = ['/opt/embodiedswe']; import robobench; robobench.discover(); \
+from robobench.core.registries import ENVS; [ENVS.get(p) for p in ('assembly.bulb.franka.osc', 'puzzle.stack_blocks.g1.pink_ik', 'locomanip.fruit_delivery.g1.loco_pink_ik')]; print('tasks ok')" && \
+ find /opt/embodiedswe -name __pycache__ -prune -exec rm -rf {} + && \
+ python -I -B /opt/efe/build/scrub_embodiedswe.py /opt/embodiedswe --check && mkdir -p /app/output
+WORKDIR /app
diff --git a/images/embodiedswe/VERSION b/images/embodiedswe/VERSION
new file mode 100644
index 0000000000..0d91a54c7d
--- /dev/null
+++ b/images/embodiedswe/VERSION
@@ -0,0 +1 @@
+0.3.0
diff --git a/images/embodiedswe/fetch_isaac_assets.py b/images/embodiedswe/fetch_isaac_assets.py
new file mode 100644
index 0000000000..8ea93ad625
--- /dev/null
+++ b/images/embodiedswe/fetch_isaac_assets.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python3
+"""fetch_isaac_assets.py: mirror the Isaac Sim 5.1 cloud assets EmbodiedSWE's scenes read, with their full USD dependency
+closure, for an offline image.
+
+Some EmbodiedSWE scenes (puzzle.spatula, puzzle.syringe, cutting.slice, cutting.dice) spawn Isaac Lab's default
+`sim_utils.GroundPlaneCfg()`, whose `usd_path` is `f"{ISAAC_NUCLEUS_DIR}/Environments/Grid/default_environment.usd"`, with
+ISAAC_NUCLEUS_DIR = carb setting `/persistent/isaac/asset_root/cloud` + "/Isaac" (isaaclab.utils.assets, read once at
+import). The image keeps a mirror of exactly those files under MIRROR (= the bucket's key layout) and sets the asset
+root to MIRROR; the scene code stays unchanged.
+
+Usage (needs network and `pxr`, e.g. `pip install usd-core`):
+ fetch_isaac_assets.py --out DIR [--manifest ASSETS.json] [--dockerfile-lines FILE]
+ download the closure of SEEDS into DIR/<key>, write the manifest (path, url, sha256, bytes) and, if asked, the
+ Dockerfile `ADD --checksum` lines that put each file at MIRROR/<key>.
+ fetch_isaac_assets.py --check DIR --manifest ASSETS.json
+ verify DIR holds exactly the manifest's files with their sha256 (no network, no pxr).
+
+Closure rule: every layer is opened with pxr; its sublayers, references, payloads and asset-valued attributes
+(UsdUtils.ExtractExternalReferences) are resolved against the layer's URL and fetched; fetched USD layers are walked
+the same way. A bare MDL module name with no directory (e.g. `OmniPBR.mdl`) is a Kit core MDL resolved from Kit's own
+MDL search path (shipped in the image's Isaac Sim wheels), so it is listed as `builtin` and not fetched.
+"""
+import argparse
+import hashlib
+import json
+import os
+import posixpath
+import sys
+import urllib.request
+
+BUCKET = "https://omniverse-content-production.s3-us-west-2.amazonaws.com"
+ROOT_KEY = "Assets/Isaac/5.1" # the asset_root's key in the bucket (Isaac Lab 2.3.2 kit files)
+MIRROR = "/opt/isaac_assets/" + ROOT_KEY # in the image: /persistent/isaac/asset_root/{default,cloud,nvidia}
+SEEDS = ["Isaac/Environments/Grid/default_environment.usd"] # relative to the asset root
+USD_EXT = (".usd", ".usda", ".usdc", ".usdz")
+
+
+def sha256(path):
+ h = hashlib.sha256()
+ with open(path, "rb") as f:
+ for b in iter(lambda: f.read(1 << 20), b""):
+ h.update(b)
+ return h.hexdigest()
+
+
+def download(url, dst):
+ os.makedirs(os.path.dirname(dst), exist_ok=True)
+ tmp = dst + ".part"
+ with urllib.request.urlopen(url, timeout=60) as r, open(tmp, "wb") as f:
+ if r.status != 200:
+ raise RuntimeError(f"{url}: HTTP {r.status}")
+ while True:
+ b = r.read(1 << 20)
+ if not b:
+ break
+ f.write(b)
+ os.replace(tmp, dst)
+
+
+def deps(local_path):
+ from pxr import UsdUtils
+ sub, refs, payloads = UsdUtils.ExtractExternalReferences(local_path)
+ return [("sublayer", p) for p in sub] + [("reference", p) for p in refs] + [("payload", p) for p in payloads]
+
+
+def fetch(out, manifest_path, lines_path):
+ files, builtin, seen = {}, {}, set()
+ queue = [(k, "seed", None) for k in SEEDS]
+ while queue:
+ rel, kind, parent = queue.pop(0)
+ rel = posixpath.normpath(rel)
+ if rel in seen:
+ continue
+ seen.add(rel)
+ url = f"{BUCKET}/{ROOT_KEY}/{rel}"
+ dst = os.path.join(out, rel)
+ download(url, dst)
+ files[rel] = {"path": f"{MIRROR}/{rel}", "url": url, "sha256": sha256(dst), "bytes": os.path.getsize(dst),
+ "kind": kind, "referenced_by": parent}
+ print(f"fetched {rel} ({files[rel]['bytes']} B, {kind} of {parent})", file=sys.stderr)
+ if rel.lower().endswith(USD_EXT):
+ for k, p in deps(dst):
+ if "://" in p or p.startswith("omniverse:"):
+ raise SystemExit(f"{rel}: absolute URL dependency {p!r}: extend the mirror rule")
+ if p.lower().endswith(".mdl") and "/" not in p:
+ builtin.setdefault(p, []).append(rel)
+ continue
+ if p.startswith("/"):
+ raise SystemExit(f"{rel}: absolute path dependency {p!r}")
+ queue.append((posixpath.join(posixpath.dirname(rel), p), k, rel))
+ man = {"bucket": BUCKET, "root_key": ROOT_KEY, "mirror": MIRROR, "seeds": SEEDS,
+ "files": [dict(rel=r, **files[r]) for r in sorted(files)],
+ "builtin_mdl": {k: sorted(set(v)) for k, v in sorted(builtin.items())},
+ "total_bytes": sum(f["bytes"] for f in files.values())}
+ if manifest_path:
+ with open(manifest_path, "w") as f:
+ json.dump(man, f, indent=1)
+ f.write("\n")
+ if lines_path:
+ with open(lines_path, "w") as f:
+ for e in man["files"]:
+ f.write(f"ADD --chmod=644 --checksum=sha256:{e['sha256']} {e['url']} {e['path']}\n")
+ print(json.dumps({"files": len(files), "bytes": man["total_bytes"], "builtin_mdl": sorted(builtin)}))
+
+
+def check(root, manifest_path):
+ man = json.load(open(manifest_path))
+ want = {e["rel"]: e for e in man["files"]}
+ have = set()
+ for d, _, fs in os.walk(root):
+ for n in fs:
+ have.add(os.path.relpath(os.path.join(d, n), root).replace(os.sep, "/"))
+ bad = sorted(have ^ set(want))
+ for r in sorted(set(want) & have):
+ p = os.path.join(root, r)
+ if sha256(p) != want[r]["sha256"] or os.path.getsize(p) != want[r]["bytes"]:
+ bad.append(r)
+ if bad:
+ raise SystemExit(f"mirror mismatch: {bad}")
+ print(f"mirror ok: {len(want)} files under {root}")
+
+
+if __name__ == "__main__":
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--out")
+ ap.add_argument("--check")
+ ap.add_argument("--manifest")
+ ap.add_argument("--dockerfile-lines")
+ a = ap.parse_args()
+ if a.check:
+ check(a.check, a.manifest)
+ elif a.out:
+ fetch(a.out, a.manifest, a.dockerfile_lines)
+ else:
+ ap.error("--out or --check")
diff --git a/images/embodiedswe/isaac_assets.json b/images/embodiedswe/isaac_assets.json
new file mode 100644
index 0000000000..b390bf8635
--- /dev/null
+++ b/images/embodiedswe/isaac_assets.json
@@ -0,0 +1,52 @@
+{
+ "bucket": "https://omniverse-content-production.s3-us-west-2.amazonaws.com",
+ "root_key": "Assets/Isaac/5.1",
+ "mirror": "/opt/isaac_assets/Assets/Isaac/5.1",
+ "seeds": [
+ "Isaac/Environments/Grid/default_environment.usd"
+ ],
+ "files": [
+ {
+ "rel": "Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png",
+ "path": "/opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png",
+ "url": "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png",
+ "sha256": "deab39088eaf39ed7be951966c5e6bd5e58b90ab64743b0cdc8e5579fd5a99d9",
+ "bytes": 436257,
+ "kind": "reference",
+ "referenced_by": "Isaac/Environments/Grid/default_environment.usd"
+ },
+ {
+ "rel": "Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png",
+ "path": "/opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png",
+ "url": "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png",
+ "sha256": "44fc0e82007bb0bd94631cd7ec45986a71ed74b9413899fbffac13efe151be4b",
+ "bytes": 1474958,
+ "kind": "reference",
+ "referenced_by": "Isaac/Environments/Grid/default_environment.usd"
+ },
+ {
+ "rel": "Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png",
+ "path": "/opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png",
+ "url": "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png",
+ "sha256": "940b96ee8c8e53bd1acbc770d4ca0ac98bed9c96439ab386d1b27dbc9790cc4e",
+ "bytes": 111895,
+ "kind": "reference",
+ "referenced_by": "Isaac/Environments/Grid/default_environment.usd"
+ },
+ {
+ "rel": "Isaac/Environments/Grid/default_environment.usd",
+ "path": "/opt/isaac_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd",
+ "url": "https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd",
+ "sha256": "8a21c317d638d33a4e6c20c958a7ed8f4d8c5195efd7e20f1b85178b4a15638a",
+ "bytes": 13622,
+ "kind": "seed",
+ "referenced_by": null
+ }
+ ],
+ "builtin_mdl": {
+ "OmniPBR.mdl": [
+ "Isaac/Environments/Grid/default_environment.usd"
+ ]
+ },
+ "total_bytes": 2036732
+}
diff --git a/images/embodiedswe/scrub_embodiedswe.py b/images/embodiedswe/scrub_embodiedswe.py
new file mode 100644
index 0000000000..5f20ea6ce6
--- /dev/null
+++ b/images/embodiedswe/scrub_embodiedswe.py
@@ -0,0 +1,593 @@
+"""Scrub an EmbodiedSWE checkout down to what the agent's image may hold (docs/protocol/leakage.md, PROTOCOL H.2).
+
+ python -I scrub_embodiedswe.py /opt/embodiedswe [--check]
+
+Run in the image build, on a fresh checkout of EmbodiedSWE at the pinned commit, after its `.git` is gone (its history
+holds solve-calibrated configurations). Idempotent: a second run changes nothing, and `--check` fails when any rule
+would still change something or a banned pointer is left.
+
+What it removes, and why:
+- Everything but `robobench/`, `LICENSE` and `pyproject.toml`: `eval/` (prompts, hints, skills, example solutions,
+ their Harbor adapter), `data_engine/`, `vla/` (names the public demonstration datasets, e.g. the bulb dataset),
+ `rl/`, `sim_gen/`, `real_to_sim/`, `experiments/`, `scripts/`, `tests/`, `docs/`.
+- Every suite's `grader/` (the hidden rubric; the verifier gets its task's grader back from the task's `tests/`) and
+ `smokes/` (scripted teleport probes and their calibration printouts), and the `deformable` suite (Newton, VLM judge;
+ not shipped).
+- Every comment and every docstring but the module's in each suite's `configs/envs.py` (the bindings): they are the
+ developers' calibration notes (reach envelopes measured with an IK probe, calibrated grasp and release stances,
+ grasp-approach azimuth bands, "load-bearing calibrated constants"). A stripped docstring becomes a neutral one.
+- In the shipped tasks' scene modules and their text assets (`.usda` layers, provenance notes), the comments that hand
+ the agent solve-calibrated numbers or recipes (the calibrated grasp and placing stances, the measured grasp windows,
+ release recipes, pointers to removed smokes and solutions): replaced by a neutral line. A `.usda` edit may change
+ only `#` comment lines.
+Code is never changed: the scrub asserts that every module's AST without docstrings is unchanged.
+"""
+from __future__ import annotations
+
+import argparse
+import ast
+import shutil
+import sys
+from pathlib import Path
+
+KEEP_TOP = {"robobench", "LICENSE", "pyproject.toml"}
+DROP_SUITE_DIRS = ("grader", "smokes")
+DROP_SUITES = ("deformable",)
+
+# (file, old text, new text): each old text must occur exactly once on a fresh checkout and never after the scrub.
+EDITS: list[tuple[str, str, str]] = [
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ "distance is now the hard part: pick-side geometry reproduces the fixed-base tier's measured\n"
+ "grasp cell, so the NEW skill this task grades on top of it is the carry.\n",
+ "distance is now the hard part: the NEW skill this task grades on top of it is the carry.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " * PICK ZONE (robot's side, y < 0): the fruit at the calibrated stance spot, the produce\n",
+ " * PICK ZONE (robot's side, y < 0): the fruit, the produce\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " * FAR SIDE (y > 0): the clay plate, centred at `plate_pos`, inset from the far edge so a\n"
+ " placing stance on the far side reproduces the fixed-base tier's plate reach.\n",
+ " * FAR SIDE (y > 0): the clay plate, centred at `plate_pos`, inset from the far edge.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " The G1-tier manifest keeps the fruits this hand measurably grasps (the fixed-base tier's\n"
+ " findings carry over: the lemon is dependable; near-spheres roll out of the three-finger\n"
+ " pinch) and ALL SEVEN non-fruit distractors, because the crowd is what makes the scene read\n"
+ " like the original — and what makes the identification non-trivial.\n",
+ " The G1-tier manifest keeps one fruit and ALL SEVEN non-fruit distractors, because the crowd\n"
+ " is what makes the scene read like the original — and what makes the identification non-trivial.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " #: separation from the closest pick-side shoulder is 0.93 m (asserted below). The inset\n"
+ " #: is chosen so a FAR-side stance with the pelvis 0.13 m off the far edge (torso clear)\n"
+ " #: sees the dish centre ~0.38 m from its shoulder, comfortably inside the arm's\n"
+ " #: measured 0.20-0.46 m release annulus; at 0.24 the same stance was 0.44 m out.\n",
+ " #: separation from the closest pick-side shoulder is 0.93 m (asserted below).\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " #: pick zone on the NEAR side: the fruit line sits 0.28 m ahead of a shoulder whose\n"
+ " #: pelvis stands clear of the near edge — the fixed-base tier's calibrated grasp\n"
+ " #: distance, reproduced at the walking stance.\n",
+ " #: pick zone on the NEAR side.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " #: G1 tier: ONE fruit — the dependable lemon — and the full distractor set. The task\n"
+ " #: is one complete delivery: pick, carry around the table, place from the far side.\n"
+ " #: Near-spherical fruit stays excluded — measured to roll out of the pinch — and the\n"
+ " #: small lemon (40 mm, under the hand's ~50 mm minimum) with it.\n",
+ " #: G1 tier: ONE fruit (a lemon) and the full distractor set. The task is one complete\n"
+ " #: delivery: pick, carry around the table, place from the far side.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " #: for the one-lemon tier; kept as the hook for re-admitting the small lemon (x1.3 puts\n"
+ " #: its 40 mm short axis at ~52 mm, inside the hand's measured 50-64 mm window).\n",
+ " #: for the one-lemon tier.\n"),
+ ("robobench/suites/locomanip/scenes/fruit_delivery.py",
+ " #: Reset regime of the fixed-base G1 tier (`_fruits_on_plate_g1_cfg`), whose measured grasp\n"
+ " #: this task inherits: the fruit's long axis along +y (narrow axis at the hand's azimuth\n"
+ " #: 180, dead centre of its reachable band) with +/-30 deg of yaw and +/-15 mm of xy\n"
+ " #: jitter, spawned essentially at rest so the commanded orientation survives settling.\n",
+ " #: Reset regime: the fruit's long axis along +y with +/-30 deg of yaw and +/-15 mm of xy\n"
+ " #: jitter, spawned essentially at rest so the commanded orientation survives settling.\n"),
+ # BEGIN generated scene edits (leakage review)
+ ('robobench/suites/assembly/scenes/allen_bolt_assembly.py',
+ " # the force-driven key smoke sets this True (no hand to bear the handle's weight)",
+ ' # True = the key ignores gravity'),
+ ('robobench/suites/assembly/scenes/allen_bolt_assembly.py',
+ " # Contact offsets add PER PAIR: the key<->socket clearance is 0.75 mm/side, so the key's and the\n # bolt's authored offsets together must stay well under that, or speculative contacts seal the\n # socket mouth — a key teleported INTO the recess still works (the force smoke), but a carried\n # key can never ENTER from outside. The bolt previously had no authored offset at all, and the\n # engine default on its head SDF sealed the mouth outright.\n",
+ " # Contact offsets add PER PAIR: the key<->socket clearance is 0.75 mm/side, so the key's and the\n # bolt's authored offsets together must stay well under it.\n"),
+ ('robobench/suites/assembly/scenes/allen_bolt_assembly.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward _gw_* reads to the composed grasp contract.\n'),
+ ('robobench/suites/assembly/scenes/ikea_table_assembly.py',
+ 'Embodiment-agnostic — it knows nothing about who turns the legs. A Franka grips and screws them; a\nfloating-leg debug robot drives them by force; either way the legs are *scene* objects the robot\nreaches through `env.scene`.\n',
+ 'Embodiment-agnostic: the legs are *scene* objects the robot reaches through `env.scene`.\n'),
+ ('robobench/suites/assembly/scenes/nut_thread_assembly.py',
+ " # Calibrated to the asset (the nut USD's origin sits 10 mm below its bottom face): 12 mm puts the\n # nut's top face at/below the bolt's thread top — fully threaded on. Resting on the bolt top is\n # ~25 mm, true bottom-out ~1 mm; gripper pads graze the bolt head below ~4 mm.\n",
+ " # The nut USD's origin sits 10 mm below its bottom face: 12 mm puts the nut's top face\n # at/below the bolt's thread top (fully threaded on). Resting on the bolt top is ~25 mm.\n"),
+ ('robobench/suites/assembly/scenes/pc_gpu_assembly.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward _gw_* reads to the composed grasp contract.\n'),
+ ('robobench/suites/assembly/scenes/pc_gpu_ram_assembly.py',
+ 'here, no task layer): install the card the way `pc_gpu` proved — place it inside the case\nforward of the rear panel, slide it rearward so the bracket/ports pass through the cutout, press\nit straight down to seat — and press each stick straight down into its DIMM slot the way\n`pc_ram` proved, into the outermost and second-from-socket slots (the alternating pair a 2-stick\ndual-channel kit populates).\n',
+ 'here, no task layer): install the card as in `pc_gpu` (place it inside the case forward of the\nrear panel, slide it rearward so the bracket/ports pass through the cutout, press it straight\ndown to seat) and press each stick straight down into its DIMM slot as in `pc_ram`, into the\noutermost and second-from-socket slots (the alternating pair a 2-stick dual-channel kit populates).\n'),
+ ('robobench/suites/assembly/scenes/pc_gpu_ram_assembly.py',
+ 'the union of the two proven invisible fixtures',
+ 'the union of the two invisible fixtures'),
+ ('robobench/suites/assembly/scenes/pc_gpu_ram_assembly.py',
+ "single-task scenes' proven values verbatim",
+ "single-task scenes' values verbatim"),
+ ('robobench/suites/assembly/scenes/pc_gpu_ram_assembly.py',
+ ' # keeps the press PD/solver in the proven stability class',
+ ' # stick mass (kg)'),
+ ('robobench/suites/assembly/scenes/pc_gpu_ram_assembly.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward _gw_* reads to the composed grasp contract.\n'),
+ ('robobench/suites/assembly/scenes/pc_motherboard_assembly.py',
+ '(xy on the z=0 board face), serpentine drive order.',
+ '(xy on the z=0 board face).'),
+ ('robobench/suites/assembly/scenes/pc_motherboard_assembly.py',
+ " # the force-driven key smoke sets this True (no hand to bear the handle's weight)",
+ ' # True = the key ignores gravity'),
+ ('robobench/suites/assembly/scenes/pc_motherboard_assembly.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward _gw_* reads to the composed grasp contract.\n'),
+ ('robobench/suites/assembly/scenes/pc_ram_assembly.py',
+ 'The stick asset authors an inflated rotational inertia (1e-3 kg m^2 diagonal vs the real\n~2.8e-5): the smoke\'s force-only PD "hand" reuses the pc_gpu rotation gains, which are unstable\nat dt=1/120 on the true inertia; the inflation is invisible on camera and irrelevant to the\npress regime.\n',
+ 'The stick asset authors an inflated rotational inertia (1e-3 kg m^2 diagonal vs the real\n~2.8e-5); the inflation is invisible on camera and irrelevant to the press regime.\n'),
+ ('robobench/suites/assembly/scenes/pc_ram_assembly.py',
+ " # Uniform +/- XY jitter of the WHOLE CASE at reset (m; 0 = pinned at spawn, the historical\n # behavior). Translation only — solves and the grader read seat positions as case_pos +\n # seat_pos[k] with the case's IDENTITY orientation, so yaw must stay 0. Nonzero values give\n # image->press-location covariance (the grounding VLA distillation needs); the demos' solve\n # tracks the shifted case automatically (its waypoints derive from the live case pose).\n",
+ " # Uniform +/- XY jitter of the WHOLE CASE at reset (m; 0 = pinned at spawn). Translation only:\n # seat positions are case_pos + seat_pos[k] with the case's identity orientation, so yaw must stay 0.\n"),
+ ('robobench/suites/assembly/scenes/pc_ram_assembly.py',
+ ' ram_mass: float = 0.25 # a real stick is ~45 g; 0.25 kg keeps the PD/solver in the\n # proven stability class (the asset also authors an inflated rotational inertia — see module\n # docstring)\n',
+ ' ram_mass: float = 0.25 # a real stick is ~45 g; the asset also authors an inflated rotational\n # inertia (see the module docstring)\n'),
+ ('robobench/suites/assembly/scenes/pc_ram_assembly.py',
+ " #: L4 per-env physics bands (data_engine sampler grammar; nominal = the cfg default, slot 0\n #: of every batch keeps it). The friction pair brackets the designed slick-stick / grippy-case\n #: ratio the second stick's gravity-seat rides on (stock 0.3 / 0.75 — the pc_ram IK campaign's\n #: robustness probe); mass ±20% around the 0.25 kg the PD/solver stability class was tuned at.\n",
+ ' #: L4 per-env physics bands (data_engine sampler grammar; nominal = the cfg default, slot 0\n #: of every batch keeps it). The friction pair brackets the slick-stick / grippy-case ratio\n #: (stock 0.3 / 0.75); mass +/-20% around the 0.25 kg nominal.\n'),
+ ('robobench/suites/assembly/scenes/pc_ram_assembly.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward _gw_* reads to the composed grasp contract.\n'),
+ ('robobench/suites/packing/scenes/pen_holder.py',
+ 'This task is deliberately SOLVABLE — a graded 0-100 rubric so weak agents rank\ninstead of flatlining — while still honest bimanual manipulation (the source robot\npicks the holder up with one hand and fills it with the other; every insertion\ntargets a compliant, moving cup).\n',
+ 'This task is scored 0-100 by the staged rubric in score().\n'),
+ ('robobench/suites/packing/scenes/pen_holder.py',
+ 'Grasp the ~1.5 mm rim with any jaw, or palm the ~69 mm body.',
+ 'Rim ~1.5 mm thick, body ~69 mm across flats.'),
+ ('robobench/suites/packing/scenes/tool_packing.py',
+ '`scripts/vendor_tool_packing_assets.py` in cap-x:',
+ '`scripts/vendor_tool_packing_assets.py`:'),
+ ('robobench/suites/packing/scenes/tool_packing.py',
+ 'Embodiment-agnostic: items and joints are scene objects the robot reaches through\n`env.scene`; a NullRobot smoke drives drawers/doors by joint writes and items by kinematic\nstaging. Heavy imports (isaaclab, pxr) are deferred so importing this module stays app-free.\n',
+ 'Embodiment-agnostic: items and joints are scene objects the robot reaches through\n`env.scene`. Heavy imports (isaaclab, pxr) are deferred so importing this module stays app-free.\n'),
+ ('robobench/suites/packing/scenes/egg_carton.py',
+ " # Eggs scatter around the scatter frame's own yaw, lying roughly parallel. The\n # full-circle (180) jitter made the tableau unsolvable for a fixed-base arm on many reset\n # seeds: a side-lying egg whose long axis points at the robot presents only its blunt end\n # to a top-down pinch, and no wrist attitude reachable from this shoulder can cage such an\n # egg. +/-30 degrees keeps visible per-seed variety (combined with frame yaw, carton\n # pose, and egg position jitter) while every egg stays physically pinchable from above.\n",
+ " # Eggs scatter around the scatter frame's own yaw, lying roughly parallel (+/-30 degrees).\n"),
+ ('robobench/suites/packing/scenes/egg_carton.py',
+ 'to the deliberate two-stage closing push.',
+ 'to a deliberate closing push.'),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ '`packing.clear_organic_objects.g1.{joint,pink_ik}` (the G1 humanoid works a resized cell — a\nsmaller bin and the four smallest organics — because its pinch hand and fixed pelvis are not an\n80 mm jaw on a 0.8 m arm; see `_clear_organic_objects_g1_cfg`).\n',
+ '`packing.clear_organic_objects.g1.{joint,pink_ik}` (the G1 humanoid works its own resized cell).\n'),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ ' # lemon_02 uses the SAME mesh as lemon_01 (was the lemon2 mesh at 1.2): the lemon1 mesh\n # is the one object the G1 hand grasps AND releases reliably, so every sort target is it.\n',
+ ' # lemon_02 uses the SAME mesh as lemon_01 (was the lemon2 mesh at 1.2).\n'),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ " # Two more lemon-mesh produce, coloured lime-green (their own asset, below): the\n # sort tier's TRAY targets. The lemon mesh is the ONE object class the G1 hand grasps\n # and releases reliably (76x50 / 72x48 mm, ~700-point faceted collider); every other\n # candidate was measured out -- oranges crushed at the cage, hull avocado/onion/lime\n # seated well and slid out on the lift, faceted limes launched, bottle and pen holder\n # geometrically impossible. A lime is a green lemon-shaped fruit, so the sort still\n # reads naturally: yellow into the crate, green onto the tray.\n # `lemon_g` and `lime_g` are the lemon1 mesh in their OWN usds, the latter tinted\n # lime-green (scripts/make_lime_from_lemon.py). Own files for two measured reasons:\n # extra instances of the SAME usd were launched hundreds of metres whenever a sibling\n # instance was lifted 8-10 cm away (shared cooked collision data), and this tier's\n # grasp needs a coarser lemon collider than `fruits_on_plate` -- which reads produce\n # from this same directory -- was calibrated against.\n",
+ " # Two more lemon-mesh produce, coloured lime-green (their own asset, below): the sort\n # tier's TRAY targets. `lemon_g` and `lime_g` are the lemon1 mesh in their OWN usds, the\n # latter tinted lime-green (scripts/make_lime_from_lemon.py).\n"),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ " # oranges: the sort tier's TRAY targets, at their shipped 63 mm. Their collider is a\n # single convex hull (scripts/fix_clear_organic_colliders.py): with the source\n # decomposition of the 9.9k-point scan they blew up whenever the G1's fingers pressed a\n # seam (9.5 m, then a numerical explosion), and a 45 mm version slipped out of the hand\n # (lift 24-39 mm) -- the two stacked fingers need something they can both bear on.\n",
+ " # oranges: the sort tier's TRAY targets, at their shipped 63 mm. Their collider is a\n # single convex hull (scripts/fix_clear_organic_colliders.py).\n"),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ 'the lemons are pinched across their 50/40 mm short axis.',
+ 'the lemons are 50/40 mm across their short axis.'),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ " # 0.85 / 0.8 and LAID ON THEIR SIDE (fixed_layout roll): 50x51x77 and 49x49x74 mm --\n # the lemon's shape, which is the one shape the G1 hand holds (a ~50 mm cross-section\n # with length along the fingers). Their old explosive behaviour was the sliver-hull\n # decomposition of their scans, replaced by one convex hull (see\n # scripts/fix_clear_organic_colliders.py). These are the sort tier's TRAY targets.\n",
+ " # 0.85 / 0.8 and LAID ON THEIR SIDE (fixed_layout roll): 50x51x77 and 49x49x74 mm; single\n # convex-hull colliders (scripts/fix_clear_organic_colliders.py). The sort tier's TRAY targets.\n"),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ ' # (The G1 sort tier raises these to 2.0 / 1.8 in its own cfg: its palm CAGE holds a fruit by\n # friction against the palm rather than by squeezing it, and at 1.1 a hulled lemon slid out\n # of the cage during the lift-and-roll. That is a property of THAT grasp, not of the produce,\n # so it lives in the binding — the franka tier keeps the pads it was measured with.)\n',
+ ' # (The G1 sort tier raises these to 2.0 / 1.8 in its own cfg.)\n'),
+ ('robobench/suites/packing/scenes/clear_organic_objects.py',
+ " # HALF the angle — a z-yaw quaternion is (cos(yaw/2), 0, 0, sin(yaw/2)). This wrote\n # (cos yaw, 0, 0, sin yaw), which silently DOUBLED every commanded orientation. Free\n # +/-180 hid it (a doubled uniform circle is still a uniform circle) and it only bit\n # once a binding pinned the yaw: `reset_yaw_center_deg=90` presented items at 180 deg,\n # putting a lemon's 50 mm narrow axis at azimuth 90 rather than the 180 the G1 binding\n # was steering for. Found while porting the same reset into the fruits_on_plate scene,\n # by tabulating the settled OBB spans instead of trusting the commanded pose.\n",
+ ' # HALF the angle -- a z-yaw quaternion is (cos(yaw/2), 0, 0, sin(yaw/2)).\n'),
+ ('robobench/suites/packing/scenes/fruits_on_plate.py',
+ " # HALF the angle — a z-yaw quaternion is (cos(yaw/2), 0, 0, sin(yaw/2)). Writing\n # (cos yaw, 0, 0, sin yaw) silently DOUBLES every commanded orientation, which is\n # invisible for a free +/-180 range (it still covers the circle) and wrong the moment\n # a binding pins the yaw: `reset_yaw_center_deg=90` then lands the item at 180 deg, so\n # the axis a solver was told to expect at azimuth 180 actually presents at 90. Caught\n # here by measuring the settled OBB spans — the lemon's 50 mm narrow axis showed up at\n # az 90 with a 76 mm span at az 180, exactly the doubled pose.\n",
+ ' # HALF the angle -- a z-yaw quaternion is (cos(yaw/2), 0, 0, sin(yaw/2)).\n'),
+ ('robobench/suites/packing/__init__.py',
+ 'Structure mirrors the assembly suite: `scenes/` (each scene IS one task), `configs/`\n(named ENVS bindings), `smokes/` (NullRobot smoke/oracle runs).\n',
+ 'Structure mirrors the assembly suite: `scenes/` (each scene IS one task), `configs/`\n(named ENVS bindings).\n'),
+ ('robobench/robots/g1.py',
+ ' # the work area, resting the hands among (or into) the props; solves then have to\n # special-case their first move away from home ("re-homing rakes the hand through the\n # produce", the clear_organics lesson). A binding can instead park the arms bent and\n # retracted here.\n',
+ ' # the work area, resting the hands among (or into) the props. A binding can instead park\n # the arms bent and retracted here.\n'),
+ ('robobench/suites/packing/assets/egg_carton/g1_rubber_fingers.usda',
+ "# Task-specific pads for the stock G1 three-finger hand. Distal links get the\n# high-friction grip compound. The two distal pads sit 1 mm further apart than in the\n# author's first calibration (45 mm between the inner faces vs the egg's 43 mm): a 43 mm\n# egg then wedges lightly enough to slide out under gravity when the palm turns down\n# over a pocket, instead of having to be pried out by retracting a finger, which flicked it. Index/middle proximal links use a release\n# compound with high static but much lower dynamic friction: they help establish\n# the pinch, then slide once finger retraction starts instead of carrying the egg\n# out of its pocket. Binding at each instanceable collision root makes every\n# referenced convex collider inherit the material without modifying the asset.\n",
+ '# Task-specific pads for the stock G1 three-finger hand. Distal links get a high-friction\n# grip compound (distal pad inner faces 45 mm apart); index/middle proximal links get a\n# compound with high static but lower dynamic friction. Binding at each instanceable\n# collision root makes every referenced convex collider inherit the material.\n'),
+ ('robobench/suites/packing/assets/egg_carton/egg_holder/g1_guided.usda',
+ "# slim rails restore the visible separator as collision geometry. A local upper-row guard is\n# taller because an upright egg protrudes above the scanned base and otherwise lets a withdrawing\n# fingertip tip its occupied neighbour over the visual separator. Keeping the high section away\n# from the lower-row-to-upper-row chute preserves the first placement's gravity settling path.\n# They are children\n",
+ '# slim rails restore the visible separator as collision geometry; a local upper-row guard is\n# taller. They are children\n'),
+ ('robobench/suites/packing/assets/egg_carton/SOURCE.md',
+ "These are the original authored/scanned assets used by RoboDojo's\n`fill_egg_holder` task. They come from the official\n[`RoboDojo-Benchmark/RoboDojo`](https://huggingface.co/datasets/RoboDojo-Benchmark/RoboDojo)\ndataset, whose dataset card declares the assets under Apache-2.0. CoSiGen itself also ships\nunder Apache-2.0; see the repository-root `LICENSE`.\n\nTask provenance: upstream\n[`fill_egg_holder.py`](https://github.com/RoboDojo-Benchmark/RoboDojo/blob/main/task/RoboDojo/tasks/fill_egg_holder.py)\nand\n[`fill_egg_holder.yml`](https://github.com/RoboDojo-Benchmark/RoboDojo/blob/main/task/RoboDojo/config/fill_egg_holder.yml).\n",
+ "These are the original authored/scanned assets of RoboDojo's `fill_egg_holder` task (RoboDojo\ndataset, Apache-2.0); see the repository-root `LICENSE`.\n"),
+ ('robobench/suites/puzzle/scenes/push_shapes.py',
+ " # Layout. Blocks sit nearer the robot than their stations so every piece is pushed away\n # from the body (+y), the stroke the G1's bench-contact workspace actually affords.\n",
+ ' # Layout. Blocks sit nearer the robot than their stations; every piece is pushed +y.\n'),
+ ('robobench/suites/puzzle/scenes/push_shapes.py',
+ ' # Station centres (pad poses), one per piece in PIECES order. MUST mirror STATIONS in\n # scripts/author_push_shapes_assets.py: the recessed board is authored with its cutouts\n # at exactly these poses, and that script also VALIDATES the layout (cutout separation,\n # spawn clearance, push corridors) before it will write assets. The x placement is\n # reach-derived -- the right hand completes at x in [0, +0.12], the leftmost station is\n # finished by the two-hand relay -- and depth is bound by RUNWAY: a piece must spawn\n # clear of its own cutout, so each lane needs a push of at least a piece depth plus\n # margins inside a workspace only ~150 mm deep.\n',
+ ' # Station centres (pad poses), one per piece in PIECES order; the recessed board is\n # authored with its cutouts at exactly these poses.\n'),
+ ('robobench/suites/puzzle/scenes/push_shapes.py',
+ " # Blocks spawn this far behind their station, straight down-lane (+y push). Per piece:\n # the T's and L's runways are trimmed to keep spawns inside the arms' proven contact\n # range (their stations sit in the workspace's deep corners).\n",
+ ' # Blocks spawn this far behind their station, straight down-lane (+y push).\n'),
+ ('robobench/suites/puzzle/scenes/push_shapes.py',
+ ' # The reorientation the task demands. 18 degrees proved to sit past what a single-contact\n # push can correct while also translating ~8 cm: the steering has authority to hold a\n # small error but the push induces yaw faster than it can shed a large one. 10 degrees\n # still exceeds the 7 degree success gate, so correcting it remains mandatory rather than\n # incidental, while leaving the task solvable. Raise it once a stronger controller exists.\n # 15 +/- 3 degrees: the worst-case start (12) must sit OUTSIDE yaw_stage_tolerance_deg\n # (10) or a yaw stage can latch at reset (caught by the smoke as a nonzero reset score\n # when 10 +/- 4 could jitter down to 6.7), and the best case (18) stays inside the range\n # the reference policy demonstrably corrects (it recovered 20-degree starts).\n',
+ " # The reorientation the task demands: each block starts this far off its pad's yaw\n # (sign alternating per lane, plus reset_yaw_jitter_deg).\n"),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ ' scene crashing (found by two datagen vectorize agents independently). Reuse the\n',
+ ' scene crashing. Reuse the\n'),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ " cup_r_tol: float = 0.050 # cup centre within this of the spout axis.\n # 5 cm (not 3): the spout axis sits only 13 mm in front of the nook's back wall\n # (measured 2026-08-09), so a mug's centre CANNOT reach the axis — machines pour\n # into a mug's back third. The staged target is cup_stage_y_off south of the axis.\n cup_stage_y_off: float = -0.040 # staged cup centre, y-offset from the spout\n",
+ ' cup_r_tol: float = 0.050 # cup centre within this of the spout axis.\n cup_stage_y_off: float = -0.040\n'),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ " # 0.125 (was 0.105): fully open, the plate's north edge sat only 10 mm south\n # of the pod pocket and dropped pods FLANGE-CAUGHT on it (v9 telemetry\n # 2026-08-10: settle z 0.411 = resting on the open cover's rim, never in the\n # pocket). 2 cm more travel puts the edge 3 cm clear; the cover overhangs\n # open air to the south by design, nothing to collide with.\n",
+ ' # the cover overhangs open air to the south by design, nothing to collide with.\n'),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ ' # 0.030 with 6 mm walls (was 0.026 with 12 mm): drop scatter (~13-15 mm\n # measured) caught the pod flange on the wide wall rims and the old z-band\n # counted rim-caught pods as seated (2026-08-10). Outer span 72 mm still\n # fits the real 75 mm top opening.\n',
+ ' # 6 mm walls; outer span 72 mm fits the real 75 mm top opening.\n'),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ " # 0.345 (scan said 0.352): a seated pod's dome ended flush with the cover's\n # underside (2 mm), and the CLOSING COVER SCOOPED THE POD onto its lid in 3\n # of 5 chain runs (gate probe 2026-08-10). The 7 mm deeper physics floor\n # sinks the pod visual slightly into the scanned pocket floor — hidden\n # inside the dark bay — and buys a 9 mm dome-to-cover margin.\n",
+ " # physics floor 7 mm below the scan's (a 9 mm dome-to-cover margin).\n"),
+ ('robobench/suites/puzzle/scenes/coffee_service.py',
+ ' # 64 (was 8): each weld/release consumes one pre-authored joint and the pool\n # never rewinds — 8 ran dry mid-session on the persistent coffee driver\n # (2026-08-09, "pool dry for cup"). This is the per-boot weld budget.\n',
+ ' # each weld/release consumes one pre-authored joint and the pool never\n # rewinds. This is the per-boot weld budget.\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ "Metrics for the brief: `max_carry_tilt_deg` (the blade's worst tilt while loaded — the\nfinesse number; the smoke's calibration sweep publishes the tilt budget the carry\ntolerates) and `spills` (payload-drop events: the bread at rest on the bare bench after\nhaving been loaded).\n",
+ "Metrics for the brief: `max_carry_tilt_deg` (the blade's worst tilt while loaded) and\n`spills` (payload-drop events: the bread at rest on the bare bench after having been loaded).\n"),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ ' rubric and any oracle work directly in blade coordinates. Colliders: three thin\n',
+ ' rubric works directly in blade coordinates. Colliders: three thin\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ ' board: its RIM (5.3 cm) walls the payload in, so the wedge becomes a pitched\n over-the-rim entry and the wall itself is the anchor a jab pins the bread against\n (a real pan-corner scoop), and every lift-out must clear the rim.\n',
+ ' board: its RIM (5.3 cm) walls the payload in, and every lift-out must clear the rim.\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ ' """Config for `SpatulaFlipServeScene`. Friction/mass are the brief\'s feasibility-spike\n knobs; the smoke\'s calibration sweep publishes the carry tilt budget they produce.\n',
+ ' """Config for `SpatulaFlipServeScene`. Friction/mass are the brief\'s feasibility-spike\n knobs.\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ ' # loaded step (5 s at 120 Hz — the no-toss/no-shove contact-history clause; covers the\n # lower-and-tip end game, where the payload dips under the lift gate). Sized for THIS\n # plate: the bamboo dish is a slope, and a slice tipped off the blade can slide/settle\n # for 3-4 s before it rests flat (measured) — a real toss still never counts, because\n # a thrown slice was never loaded near the plate at all.\n',
+ ' # loaded step (5 s at 120 Hz — the no-toss/no-shove contact-history clause).\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ " # Friction pair sized from BOTH ends (round-2 GPU lesson): PhysX combines by AVERAGE, so\n # blade-bread ~ (0.33 static / 0.29 dynamic). Low enough that the wedge SLIPS under the\n # payload instead of sticking to it and bulldozing; high enough that the carry has a real\n # tilt budget: atan(0.33) ~ 18 deg. Bread-pan stays grippier (the pan rig bakes the old\n # board's 0.6/0.55) so the pan anchors the payload while the blade slides beneath — and\n # the pan WALL is now a hard anchor no jab can shove the payload past.\n",
+ ' # Friction pair (PhysX combines by AVERAGE).\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ " # Legacy surface: the grasp contract's state used to live directly on the scene\n # (inline machinery era) and existing solutions read it there — forward to the\n # composed contract. `__getattr__` only fires for attributes not found normally.\n",
+ ' # Legacy surface: forward `_gw_*` reads to the composed grasp contract.\n # `__getattr__` only fires for attributes not found normally.\n'),
+ ('robobench/suites/puzzle/scenes/spatula_flip_serve.py',
+ " # Grasp-weld contract constants — the scene's public knobs (solutions read these off the\n # scene, e.g. `scene.GRASP_PINCH_OFFSET`); the composed GraspWeldContract consumes them.\n",
+ " # Grasp-weld contract constants — the scene's public knobs (e.g.\n # `scene.GRASP_PINCH_OFFSET`); the composed GraspWeldContract consumes them.\n"),
+ ('robobench/suites/assembly/scenes/so101_assembly.py',
+ " # option. The smokes read `surface_z` too, so their choreography rides along.\n",
+ " # option.\n"),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' # of capacity (relaxed from +/-5% — the tight band priced in kinematic-oracle\n # metering precision, not an arm pressing the plunger through o-ring friction)\n',
+ ' # of capacity\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ " # O-ring feel: the prismatic joint's Coulomb friction + viscous damping (the\n # plunger is a REAL body now — an arm hooks the thumb plate and pulls). The\n # friction holds the 0.06 kg plunger wherever it lands, including vertical.\n",
+ " # O-ring feel: the prismatic joint's Coulomb friction + viscous damping. The\n # friction holds the 0.06 kg plunger wherever it lands, including vertical.\n"),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' home_pos: tuple = (-0.06, -0.08) # lying syringe centre on the surface.\n # The syringe lies ALONG X (tip west, plate east): a y-lying syringe forces\n # its plate to y>=+0.09 where every wrist column hits the north guard rail —\n # unreachable by both arms in all orientation families (jobs 19-27,\n # 2026-08-11). Lying along x keeps the whole syringe south of the rail wall.\n',
+ ' home_pos: tuple = (-0.06, -0.08) # lying syringe centre on the surface (along x).\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ " rack_pos: tuple = (0.0, 0.14) # tube-rack centre (north strip, east\n # of the home column; the 1.02 m glass tubes must sit outside both arms'\n # LOW-reach sweeps — park carries dogleg south of them)\n",
+ ' rack_pos: tuple = (0.0, 0.14) # tube-rack centre (north strip)\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' res_pos: tuple = (0.14, -0.05) # reservoir beaker centre: EAST of\n # the home footprint (17 mm clear of the lying plate end — at x=0.02 the\n # beaker overlapped the boot pose) at the PROVEN south latitude (y=+0.03\n # sat in the rack shadow that kills the two-hand seat, job_0038/pod-8;\n # x=-0.16 jammed the left hand past its own base, job_0034). Warm-pod\n # validated: boot rest clean, grasp 8.0 mm, seat corridor 2.8 mm.\n',
+ ' res_pos: tuple = (0.14, -0.05) # reservoir beaker centre (east of the home footprint)\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' # The plunger is a real body with a rod + thumb-plate collider: a second\n # arm hooks under the plate and PULLS to draw (the earlier kinematic\n # plunger metered through a scene scalar, which made the pressing arm\n # cosmetic — user directive 2026-08-10: the fill must be physical).\n',
+ ' # The plunger is a real body with a rod + thumb-plate collider.\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' # setting; the prismatic joint IS the metering mechanism now: a second arm\n # hooks the plate and pulls, joint friction holds it wherever it lands.)\n',
+ ' # setting; the prismatic joint IS the metering mechanism.)\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' # lying home: tip west, thumb east; joint 0 = plunger fully pushed (its\n # rod still stands proud of the rim — the hook-grasp handle). Spawned a\n',
+ ' # lying home: tip west, thumb east; joint 0 = plunger fully pushed. Spawned a\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' """Plunger travel (m): + = drawn out, 0 = fully pushed. MEASURED — the\n prismatic joint position (a second arm pulling the plate moves it; joint\n friction holds it wherever it lands)."""\n',
+ ' """Plunger travel (m): + = drawn out, 0 = fully pushed: the prismatic joint\n position (joint friction holds it wherever it lands)."""\n'),
+ ('robobench/suites/puzzle/scenes/syringe_dosing.py',
+ ' """Thumb-plate centre (world) — the hook-grasp handle on the plunger link."""\n',
+ ' """Thumb-plate centre (world) on the plunger link."""\n'),
+ ('robobench/suites/puzzle/configs/envs.py',
+ ' - syringe: draw / triple-dose / re-park. Defining embodiment GR1-T2 (bimanual:\n one hand fixtures the barrel, the other meters the plunger); G1 for\n curriculum; franka / piper / wxai / bimanual_franka as arm bindings.\n',
+ ' - syringe: draw / triple-dose / re-park (GR1-T2, G1, franka, piper, wxai and\n bimanual_franka bindings).\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ 'and the edge level — a top-down pinch on the handle lifts it straight off). **Goal: pick up\n',
+ 'and the edge level). **Goal: pick up\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ 'of pieces** — graded by `grader.SliceFoodGrader`. Embodiment-agnostic: the scene knows\n',
+ 'of pieces**. Embodiment-agnostic: the scene knows\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ ' knife_mass: float = 0.18 # a 22 cm chef knife; heavier knives creep in a friction pinch\n',
+ ' knife_mass: float = 0.18 # a 22 cm chef knife\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ ' # tip (0.22,-0.134)): rest/hold it rotated by this about the blade normal so the EDGE\n # is level, else the tip grounds 6 cm before the mid-blade\n',
+ ' # tip (0.22,-0.134)): the rest lays it rotated by this about the blade normal\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ " # island height — an arm's reach wants its base ~0.55 m behind the cut, past the island's\n # y=-0.38 edge. None -> no stand.\n",
+ ' # island height. None -> no stand.\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ ' # firm, straight, 3.2 cm: release as the edge reaches the flesh centre — the\n # split forms mid-stroke and the knife need not drive on to the board\n',
+ ' # firm, straight, 3.2 cm\n'),
+ ('robobench/suites/cutting/scenes/slice_food.py',
+ ' # RIGID knife (no compliant contact — a strong pinch squashes through a compliant\n # plate; softness lives in the FOOD), lying edge-level on the rest\n',
+ ' # RIGID knife, lying edge-level on the rest\n'),
+ ('robobench/suites/cutting/scenes/dice_food.py',
+ " against (all of a plane's pairs released). `plane_aim_w` / `plane_axis_w` give drivers the\n live aim point and blade yaw for a plane.\n",
+ " against (all of a plane's pairs released).\n"),
+ ('robobench/suites/locomanip/scenes/box_to_bin.py',
+ "stand-off, and the bin sits to the robot's right where Arena's navigation waypoints send it. See\n",
+ "stand-off, and the bin sits to the robot's right. See\n"),
+ ('robobench/suites/locomanip/scenes/box_to_bin.py',
+ "the MIDDLE board (top 0.763) with 0.69 m of clear air to the board above, so the pick is a\nwaist-height front approach. The bin's",
+ "the MIDDLE board (top 0.763) with 0.69 m of clear air to the board above. The bin's"),
+ ('robobench/suites/locomanip/scenes/box_to_bin.py',
+ ' constraints — the pick pose is where the robot already starts (facing +y, the Arena\n stand-off), and the place pose is Arena\'s own navigation goal, rotated into this frame."""\n',
+ ' constraints — the pick pose is where the robot already starts (facing +y)."""\n'),
+ ('robobench/suites/locomanip/scenes/box_to_bin.py',
+ ' #: Stage-wide look knobs for visual replay (data_engine render.py --visual_draw).\n',
+ ' #: Stage-wide look knobs for visual replay.\n'),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ "substrate. Each station reproduces `wheel_pick_place`'s validated standing geometry exactly — a\nrobot at the station's `stand_xy` sees precisely the layout it saw there — so any failure here is\nattributable to the transit, not to a new reach problem.\n",
+ 'substrate.\n'),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ 'their own feet instead — the work surfaces do not move, but they become a 0.994 m chest-height pick\nand the inherited reach calibration no longer applies.\n',
+ 'their own feet instead — the work surfaces do not move, but they become a 0.994 m chest-height pick.\n'),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ ' # interior, so it is a genuine "in the bin", not "near it". Inherited verbatim from\n # `assembly.wheel_pick_place`, where they were measured.\n',
+ ' # interior, so it is a genuine "in the bin", not "near it".\n'),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ ' # flattens them to one value, and the nominal is the LEATHER rim, so the contact an end effector\n # meets on the outside of the wheel is unchanged from the asset.\n',
+ " # flattens them to one value (the nominal is the leather rim's).\n"),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ " #: Where the wheel lies, in the PICK TABLE's frame — the same spot it occupies in\n #: `assembly.wheel_pick_place`, so the grasp transfers.\n",
+ " #: Where the wheel lies, in the PICK TABLE's frame.\n"),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ ' These are not constraints — nothing checks them — but they are the two spots at which this\n scene reproduces `assembly.wheel_pick_place`\'s validated geometry, which is what\n `describe()` hands the agent as a starting guess."""\n',
+ ' These are not constraints — nothing checks them — and `describe()` hands them to the agent\n as a starting guess."""\n'),
+ ('robobench/suites/locomanip/scenes/wheel_carry.py',
+ ' #: Stage-wide look knobs for visual replay (data_engine render.py --visual_draw).\n',
+ ' #: Stage-wide look knobs for visual replay.\n'),
+ ('robobench/suites/locomanip/__init__.py',
+ '`assembly.wheel_pick_place` (same assets, same measured reach geometry at both ends, one basket\nmoved out of range)',
+ '`assembly.wheel_pick_place` (same assets, one basket\nmoved out of range)'),
+ ('robobench/suites/cutting/configs/envs.py',
+ ' - "cutting.<scene>.franka.joint" — direct joint position targets (the first slice\n solution ran its own IK on top of this)\n',
+ ' - "cutting.<scene>.franka.joint" — direct joint position targets\n'),
+ ('robobench/core/grader.py',
+ ' # would poison a "once" milestone for the rest of the run (seen 2026-09-04, box_to_bin\n # `carried` when scoring reached-state logs).\n',
+ ' # would poison a "once" milestone for the rest of the run.\n'),
+ # END generated scene edits
+]
+# Code edits, each confined by its kind: "describe" may change only the scene's describe() method (the task text the
+# agent reads: it states the goal and the API, never working poses), "string" only string constants.
+B2B, WHC = "robobench/suites/locomanip/scenes/box_to_bin.py", "robobench/suites/locomanip/scenes/wheel_carry.py"
+CODE_EDITS: list[tuple[str, str, str, str]] = [
+ (B2B, "describe",
+ " f\"robot itself does — and the table stands off the shelf's axis, so the route turns. \"\n"
+ " f\"Working poses (x, y, heading): about ({px:.2f}, {py:.2f}, {ph:+.2f}) for the pick — \"\n"
+ " f\"the start pose already faces the shelf squarely — and ({tx:.2f}, {ty:.2f}, {th:+.2f}) \"\n"
+ " f\"for the place; they are a starting guess, not a requirement.\"\n",
+ " f\"robot itself does — and the table stands off the shelf's axis, so the route turns.\"\n"),
+ (B2B, "string",
+ "corrugated board's friction varies \"\n"
+ " \"down from that with surface wear/dust, not up; the low end is \"\n"
+ " \"where the two-palm grip actually has to work\"},\n",
+ "corrugated board's friction varies \"\n"
+ " \"down from that with surface wear/dust, not up\"},\n"),
+ (WHC, "describe",
+ " f\"there if the robot itself does. Working positions that face each table squarely are \"\n"
+ " f\"about ({sx:.2f}, {sy:.2f}) for the pick and ({tx:.2f}, {ty:.2f}) for the place; they \"\n"
+ " f\"are a starting guess, not a requirement.\"\n",
+ " f\"there if the robot itself does.\"\n"),
+]
+# Shipped files that are not task code and hand out a working controller (a reach driver whose example is a task).
+DROP_FILES = ("robobench/scripts/robot_binding_smoke.py",)
+# Phrases that must not survive in the files the scrub edits (a pointer to a solve-calibrated number).
+STRIP_GLOB = "robobench/suites/*/configs/envs.py"
+NEUTRAL_DOC = '"""(binding notes removed from this image)"""'
+BANNED = ("calibrated grasp", "calibrated stance", "release annulus", "pink_probe", "reach envelope", "reach map",
+ "azimuth\n #: 180", "pick radius", "grasp cell", "REORIENT_STUCK", "robot_binding_smoke before",
+ "existing solutions", "demos' solve", "gravity-seat", "IK campaign", "solves and the grader",
+ "grasps and releases reliably", "grasps AND releases reliably", "palm CAGE", "steering for",
+ "first calibration", "force smoke", "key smoke", "smokes read")
+
+
+# every scene module the shipped tasks build (the check fails when one is missing)
+SCENE_MODULES = tuple(f"robobench/suites/{m}.py" for m in (
+ "assembly/scenes/bulb_assembly", "puzzle/scenes/stack_blocks", "locomanip/scenes/fruit_delivery",
+ "packing/scenes/fruits_on_plate", "assembly/scenes/allen_bolt_assembly", "assembly/scenes/ikea_table_assembly",
+ "assembly/scenes/nut_thread_assembly", "assembly/scenes/pc_gpu_assembly", "assembly/scenes/pc_gpu_ram_assembly",
+ "assembly/scenes/pc_motherboard_assembly", "assembly/scenes/pc_ram_assembly", "packing/scenes/pen_holder",
+ "packing/scenes/tool_packing", "packing/scenes/egg_carton", "packing/scenes/clear_organic_objects",
+ "puzzle/scenes/classify_objects", "puzzle/scenes/push_shapes", "puzzle/scenes/coffee_service",
+ "puzzle/scenes/syringe_dosing", "cutting/scenes/slice_food", "cutting/scenes/dice_food",
+ "locomanip/scenes/box_to_bin", "locomanip/scenes/wheel_carry", "assembly/scenes/so101_assembly",
+ "puzzle/scenes/spatula_flip_serve"))
+
+
+def code_fingerprint(src: str) -> str:
+ """The module's AST without docstrings: a comment or docstring edit leaves it unchanged."""
+ tree = ast.parse(src)
+ for node in ast.walk(tree):
+ body = getattr(node, "body", None)
+ if isinstance(body, list) and body and isinstance(body[0], ast.Expr) \
+ and isinstance(getattr(body[0], "value", None), ast.Constant) and isinstance(body[0].value.value, str):
+ body[0] = ast.Pass()
+ return ast.dump(tree)
+
+
+def _outside_describe(src: str) -> str:
+ """The module's AST with every describe() method's body emptied (an edit inside describe() leaves it unchanged)."""
+ tree = ast.parse(src)
+ for node in ast.walk(tree):
+ if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name == "describe":
+ node.body = [ast.Pass()]
+ return ast.dump(tree)
+
+
+def _without_strings(src: str) -> str:
+ """The module's AST with every string constant blanked (an edit of string text only leaves it unchanged)."""
+ tree = ast.parse(src)
+ for node in ast.walk(tree):
+ if isinstance(node, ast.Constant) and isinstance(node.value, str):
+ node.value = ""
+ return ast.dump(tree)
+
+
+def _usd_body(src: str) -> list[str]:
+ """A .usda layer without its `#` comment lines (a comment edit leaves it unchanged)."""
+ return [x for x in src.splitlines() if not x.lstrip().startswith("#")]
+
+
+def strip_comments(src: str) -> str:
+ """Remove every comment and replace every docstring but the module's with NEUTRAL_DOC; code unchanged."""
+ import io
+ import tokenize
+
+ lines = src.splitlines(keepends=True)
+ cut: dict[int, int] = {} # 1-based row -> column where its comment starts
+ for tok in tokenize.generate_tokens(io.StringIO(src).readline):
+ if tok.type == tokenize.COMMENT:
+ cut[tok.start[0]] = tok.start[1]
+ docs = [] # (first row, last row, indent) of each non-module docstring
+ for node in ast.walk(ast.parse(src)):
+ if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)) and node.body:
+ b = node.body[0]
+ if isinstance(b, ast.Expr) and isinstance(b.value, ast.Constant) and isinstance(b.value.value, str) \
+ and b.value.value != NEUTRAL_DOC.strip('"'):
+ docs.append((b.lineno, b.end_lineno, b.col_offset))
+ out, skip = [], set()
+ for first, last, col in docs:
+ skip.update(range(first + 1, last + 1))
+ doc_first = {first: col for first, _last, col in docs}
+ for i, line in enumerate(lines, start=1):
+ if i in skip:
+ continue
+ if i in doc_first:
+ out.append(" " * doc_first[i] + NEUTRAL_DOC + "\n")
+ continue
+ if i in cut:
+ head = line[:cut[i]].rstrip()
+ if not head:
+ continue # a comment-only line goes entirely
+ line = head + "\n"
+ out.append(line)
+ return "".join(out)
+
+
+def plan(root: Path) -> list[str]:
+ """What a run would still change (empty after a scrub)."""
+ todo = [f"remove {p.name}" for p in sorted(root.iterdir()) if p.name not in KEEP_TOP]
+ suites = root / "robobench" / "suites"
+ for s in sorted(suites.iterdir()) if suites.is_dir() else []:
+ if s.is_dir() and s.name in DROP_SUITES:
+ todo.append(f"remove suites/{s.name}")
+ for d in DROP_SUITE_DIRS:
+ if (s / d).exists():
+ todo.append(f"remove suites/{s.name}/{d}")
+ for rel, old, _new in EDITS:
+ if old in (root / rel).read_text():
+ todo.append(f"edit {rel}")
+ for rel, _kind, old, _new in CODE_EDITS:
+ if old in (root / rel).read_text():
+ todo.append(f"code edit {rel}")
+ todo += [f"remove {rel}" for rel in DROP_FILES if (root / rel).exists()]
+ for path in sorted(root.glob(STRIP_GLOB)):
+ src = path.read_text()
+ if strip_comments(src) != src:
+ todo.append(f"strip {path.relative_to(root)}")
+ todo += [f"pycache {p}" for p in root.rglob("__pycache__")]
+ return todo
+
+
+def scrub(root: Path) -> None:
+ for p in root.rglob("__pycache__"): # bytecode built before the removal keeps the old code
+ shutil.rmtree(p, ignore_errors=True)
+ for p in sorted(root.iterdir()):
+ if p.name not in KEEP_TOP:
+ shutil.rmtree(p) if p.is_dir() and not p.is_symlink() else p.unlink()
+ suites = root / "robobench" / "suites"
+ for s in sorted(suites.iterdir()):
+ if not s.is_dir():
+ continue
+ if s.name in DROP_SUITES:
+ shutil.rmtree(s)
+ continue
+ for d in DROP_SUITE_DIRS:
+ if (s / d).exists():
+ shutil.rmtree(s / d)
+ for rel, old, new in EDITS:
+ path = root / rel
+ src = path.read_text()
+ n = src.count(old)
+ if n == 0:
+ continue # already scrubbed (idempotent)
+ if n != 1:
+ raise SystemExit(f"scrub: {rel}: expected the block once, found {n}")
+ out = src.replace(old, new)
+ if rel.endswith(".py") and code_fingerprint(out) != code_fingerprint(src):
+ raise SystemExit(f"scrub: {rel}: an edit changed code, not only comments")
+ if rel.endswith(".usda") and _usd_body(out) != _usd_body(src):
+ raise SystemExit(f"scrub: {rel}: an edit changed USD content, not only `#` comments")
+ path.write_text(out)
+ for rel, kind, old, new in CODE_EDITS:
+ path = root / rel
+ src = path.read_text()
+ n = src.count(old)
+ if n == 0:
+ continue
+ if n != 1:
+ raise SystemExit(f"scrub: {rel}: expected the code block once, found {n}")
+ out = src.replace(old, new)
+ same = _outside_describe if kind == "describe" else _without_strings
+ if same(out) != same(src):
+ raise SystemExit(f"scrub: {rel}: a {kind} edit changed more than its {kind}")
+ path.write_text(out)
+ for rel in DROP_FILES:
+ if (root / rel).exists():
+ (root / rel).unlink()
+ for path in sorted(root.glob(STRIP_GLOB)):
+ src = path.read_text()
+ out = strip_comments(src)
+ if code_fingerprint(out) != code_fingerprint(src):
+ raise SystemExit(f"scrub: {path}: stripping changed code")
+ path.write_text(out)
+
+
+def check(root: Path) -> list[str]:
+ bad = plan(root)
+ for rel in sorted({e[0] for e in EDITS} | {e[0] for e in CODE_EDITS}
+ | {str(p.relative_to(root)) for p in root.glob(STRIP_GLOB)}):
+ txt = (root / rel).read_text()
+ bad += [f"banned phrase {b!r} in {rel}" for b in BANNED if b in txt]
+ # the suites still import (registration only; no simulator): every scene module the tasks need is present
+ for rel in SCENE_MODULES:
+ if not (root / rel).is_file():
+ bad.append(f"missing {rel}")
+ return bad
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("root", type=Path)
+ ap.add_argument("--check", action="store_true", help="change nothing; fail if a rule would still apply")
+ a = ap.parse_args()
+ root = a.root.resolve()
+ if not a.check:
+ # a fresh checkout must still carry every block (else upstream moved and the rules need a look)
+ for rel, old, _new in EDITS + [(e[0], e[2], e[3]) for e in CODE_EDITS]:
+ if old not in (root / rel).read_text() and _new not in (root / rel).read_text():
+ raise SystemExit(f"scrub: {rel}: neither the original nor the scrubbed block is present")
+ scrub(root)
+ bad = check(root)
+ for b in bad:
+ print(f"scrub check: {b}", file=sys.stderr)
+ print(f"scrub: {'FAILED' if bad else 'ok'} ({len(EDITS)} scene-comment edits, {len(CODE_EDITS)} describe/string "
+ f"edits, "
+ f"{len(list(root.glob(STRIP_GLOB)))} binding files stripped, graders/smokes removed)")
+ return 1 if bad else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/scripts/task_conventions.py b/scripts/task_conventions.py
index b034b6d1e2..85259b32a2 100644
--- a/scripts/task_conventions.py
+++ b/scripts/task_conventions.py
@@ -106,6 +106,7 @@ BENCHMARK_TABLE = [
("labutopia-", "LabUtopia", "labutopia"),
("autobio-", "AutoBio", "autobio"),
("abc-sim-", "ABC Sim", "abc-sim"),
+ ("embodiedswe-", "EmbodiedSWE", "embodiedswe"),
]
BENCHMARKS = [(p, label) for p, label, _ in BENCHMARK_TABLE] # (directory prefix, label): the first matching prefix wins
# Modes (PROTOCOL §3): a benchmark ships any subset of the modes. A standard or standard-realtime
diff --git a/scripts/task_resources.toml b/scripts/task_resources.toml
index 47535076be..b30755aa8d 100644
--- a/scripts/task_resources.toml
+++ b/scripts/task_resources.toml
@@ -819,3 +819,12 @@ sim = { cpus = 4, memory_gb = 13, pids = 8192, gpu_memory_gb = 5 }
recommended_gpu = "any NVIDIA GPU with EGL (RTX 4090 / L4)"
measured = "oracle trials of all 60 directories on an RTX 4090 workstation (docker stats every 3 s, the trial's resource monitor): the sim sidecar 2.1 GB and 0.83 GiB of GPU memory (standard, chess; realtime 0.8 GB and 0.72 GiB), the agent's container (the client) 0.03 GB; the collect hook renders the video inside the sidecar (EGL)"
caps_measured = "GPU memory (the sim service): at most 0.83 GiB in the oracle trials -> max(1.5 x peak, peak + 2), rounded up: 3 GiB; kept at the earlier cap (no per-container data): 5 GiB; processes and disk: defaults, not measured; the sim service's memory covers its largest legal call (4 cameras, 750 frames each (3000 images)): 8.4 GiB to build the response on top of the simulator's 2.4 GiB"
+
+# 24 task(s)
+[[cap]]
+match = "^embodiedswe-.*-privileged$"
+main = { cpus = 8, memory_gb = 29, pids = 16384, gpu_memory_gb = 16, disk_gb = 10 }
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+recommended_gpu = "L40S 48GB / L4 24GB / RTX 4090 24GB"
+measured = "GPU PhysX on an L40S (nvidia-smi every 2 s, one process on the card): a graded rollout process 3.2-4.6 GiB of GPU memory, a process with cameras (the video) 6.6-7.0 GiB; a fresh process starts and builds a scene in 13-27 s with a warm Kit cache"
+caps_measured = "GPU memory: 7.0 GiB (a process with cameras, L40S) -> max(1.5 x peak, peak + 2) = 10.5, at least 16 GiB for Isaac Sim: 16 GiB; disk: 0.9 GiB at most in 3 four-hour agent trials (the trial's resource monitor) -> at least 10 GiB: 10 GiB; memory, CPU, processes and threads: no reliable per-container measurement (those trials' monitor ran before GPU PhysX and saw under 2.5 GiB, less than one Isaac Sim process holds), kept at the earlier caps (29 GiB, 8 CPUs, 16384)"
diff --git a/tasks/embodiedswe/README.md b/tasks/embodiedswe/README.md
new file mode 100644
index 0000000000..e2bcf72dab
--- /dev/null
+++ b/tasks/embodiedswe/README.md
@@ -0,0 +1,136 @@
+# EmbodiedSWE
+
+EmbodiedSWE's robot benchmark (`robobench`, commit `67f44e8a2ca5`) on Isaac Lab 2.3.2 / Isaac Sim 5.1, PhysX on the
+GPU: the agent writes a program, `solution/solve.py` exposing `solve(env)`, that completes a manipulation or
+loco-manipulation task by stepping the env. `simulator = "embodiedswe"`. 24 tasks (assembly, packing, puzzle, cutting
+and loco-manipulation scenes, one frozen instance each), privileged mode, `task_type = "policy"`, in the full set only:
+EmbodiedSWE's 28 published tasks without its 4 deformable ones (they need Newton physics and a networked VLM judge).
+
+| Task | Preset | Robot |
+|---|---|---|
+| `embodiedswe-assembly-bulb-franka-osc-i00-privileged` | `assembly.bulb.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged` | `puzzle.stack_blocks.g1.pink_ik` | Unitree G1 (fixed pelvis), Pink IK |
+| `embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged` | `locomanip.fruit_delivery.g1.loco_pink_ik` | Unitree G1 (walking), Pink IK |
+| `embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged` | `assembly.allen_bolt.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged` | `assembly.ikea_table.bimanual_franka.osc` | two Franka Pandas, operational-space control |
+| `embodiedswe-assembly-nut-thread-franka-osc-i00-privileged` | `assembly.nut_thread.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged` | `assembly.pc_gpu.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged` | `assembly.pc_gpu_ram.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged` | `assembly.pc_motherboard.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-assembly-pc-ram-franka-osc-i00-privileged` | `assembly.pc_ram.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-packing-pen-holder-franka-osc-i00-privileged` | `packing.pen_holder.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-packing-tool-packing-franka-osc-i00-privileged` | `packing.tool_packing.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged` | `packing.egg_carton.g1.pink_ik` | Unitree G1 (fixed pelvis), Pink IK |
+| `embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged` | `packing.clear_organic_objects.g1.pink_ik` | Unitree G1 (fixed pelvis), Pink IK |
+| `embodiedswe-puzzle-coffee-franka-osc-i00-privileged` | `puzzle.coffee.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged` | `puzzle.syringe.bimanual_franka.osc` | two Franka Pandas, operational-space control |
+| `embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged` | `puzzle.push_shapes.g1.pink_ik` | Unitree G1 (fixed pelvis), Pink IK |
+| `embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged` | `puzzle.classify_objects.g1.pink_ik` | Unitree G1 (fixed pelvis), Pink IK |
+| `embodiedswe-cutting-slice-franka-osc-i00-privileged` | `cutting.slice.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-cutting-dice-franka-osc-i00-privileged` | `cutting.dice.franka.osc` | Franka Panda, operational-space control |
+| `embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged` | `locomanip.box_to_bin.g1.loco_pink_ik` | Unitree G1 (walking), Pink IK |
+| `embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged` | `locomanip.wheel_carry.g1.loco_pink_ik` | Unitree G1 (walking), Pink IK |
+| `embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged` | `assembly.so101.bimanual_franka.osc` | two Franka Pandas, operational-space control |
+| `embodiedswe-puzzle-spatula-franka-osc-i00-privileged` | `puzzle.spatula.franka.osc` | Franka Panda, operational-space control |
+
+## Grading
+
+The verifier grades as EmbodiedSWE's harbor verifier (`eval/harbor_support/verifier.py` at the pinned commit) does,
+one seed (the frozen instance, seed 0). The candidates are the checkpoints the agent froze with `submit` and the final
+`solution/` (see Checkpoints). Each distinct candidate runs in a fresh process: the trusted simulator builds the env
+from the frozen instance (EmbodiedSWE's own build and seeded reset, GPU PhysX), attaches the task's grader
+(EmbodiedSWE's, unchanged) and runs the candidate's `solve(env)` in a separate process as an unprivileged user,
+without network or GPU, behind a proxy env (`embodied_first_exam/benchmarks/embodiedswe/esw_proxy.py`): reads return
+copies, `env.step(action)` steps the simulator, everything else is refused. A candidate's process has EmbodiedSWE's
+rollout limit, 1800 s of wall clock from its start (the simulator's start-up and the import of `solve.py` count); then
+it gets SIGTERM, the solve is ended and the verdict is read on the state at that moment; 30 s later, SIGKILL. A process
+that ends without a verdict while solving scores 0; in any other phase it is the verifier's error (`infra_error`).
+The verdict is EmbodiedSWE's: success = the grader's end predicate (the cutting and SO101 scenes have no `success()`:
+their graders' predicates, enough pieces and all of them on the board, and every screw fastened with the servo and
+the forearm seated, are also the tooling's `cut_success` and `so101_success` for the development `check`);
+`progress` = its rubric score, the peak recorded progress, so progress made before an exception or the time limit
+counts. The spatula scene's tool-only rule (the hand or a finger touching the bread disqualifies the episode) is
+enforced by the verifier: PhysX contact reports on the bread, read after every physics substep against the hand and
+finger links; a contact with a nonzero force sets success and progress to 0 (`disqualified`, `tool_contact` in
+`reward.json`). An exception from `env.step` is raised in `solve`, as EmbodiedSWE's `GradedEnv` lets it propagate.
+Actions are applied as given: as in EmbodiedSWE, a Franka's operational-space controller scales the 6 pose deltas by
+`pos_scale` / `rot_scale` without clipping them and clamps the joint torques (100 N·m); only an action's shape and
+finite values are checked. A run in which no action reached the simulator scores 0.
+
+The result is one candidate, selected as EmbodiedSWE selects: the highest `progress` (their score), ties to higher
+success, then to the earliest (`final` is last); a candidate that ran wins a tie against one that never did (an
+invalid checkpoint, a missing `solve.py`). `reward.txt` and `reward.json` give that candidate's success and progress
+(`selected_submission`, `selected_final`); `results.json` lists every candidate with its status, score and success.
+The selected candidate's trajectory, `trajectory.npz` (every action, and Isaac Lab's scene state, each asset's root
+pose and velocity and joint positions and velocities, every 0.1 s of simulated time, at most 3,000 states: a longer
+run is kept at a coarser spacing), is the run's record; with it come its `rollout.json` and `solve.log`. The video,
+`replay.mp4`, is rendered after the verdict in a fresh process: each recorded state is posed on the bodies (no physics
+step) and drawn, so the video shows the graded run's own states (`video_source = "recorded_states"`; a scene's
+non-physical visuals, such as a liquid level, are not part of the state). Before it, the same process re-executes the
+selected trajectory's actions with the camera drawing, as a live recording would, and records whether that reaches
+the graded run's final state (`camera_replay_match`, `camera_replay_success` in `video.json`; at most 1800 s). Neither
+changes the verdict.
+
+### Checkpoints (a benchmark-specific exception)
+
+As in EmbodiedSWE, the agent may freeze up to 64 checkpoints of its deliverable while it works: `submit "note"`
+(`esw_submit.py`, in the image as `/usr/local/bin/submit`) copies `/app/output/solution/` to
+`/app/output/submissions/NNNNNN/solution/` with a receipt, `submission.json` (the sha256 of every file and of that
+inventory), serialized with flock. The verifier checks every receipt and freezes every candidate before any of them
+runs; a checkpoint whose files differ from its receipt, or a directory that is not a checkpoint, scores 0 and is not
+run. Byte-identical candidates (the same content hash) are graded once; a later copy takes the earlier one's result.
+The other benchmarks of this repository grade one deliverable once; this one keeps EmbodiedSWE's checkpoint
+protocol, so its result is comparable with EmbodiedSWE's own. The instruction states the limits.
+
+The verifier's time limit (`task.toml` `[verifier] timeout_sec`) covers the worst case, 64 checkpoints and the final
+folder, each distinct and each using its whole limit, then the video:
+
+ (64 + 1) x (1800 + 30) + (900 + 1800 + 600) + 300 = 122,550 s
+
+1800 + 30 is a candidate's limit and grace; 900 + 1800 + 600 the video process's (start-up with cameras, the camera
+replay's budget, posing and encoding); 300 the margin. A typical trial grades a few candidates and takes minutes.
+
+Differences from EmbodiedSWE's own grading, on purpose:
+- `solve` runs in a sandbox (a separate process as an unprivileged user, no network, no GPU) behind a proxy env, not
+ in the simulator's process.
+- One frozen instance per task, seed 0 (EmbodiedSWE's harbor protocol averages over its seeds).
+- The video poses the selected run's recorded states after the verdict; EmbodiedSWE renders live during the run when
+ asked to. Drawing frames between physics steps can change GPU PhysX's later bits (measured: in the stack scene a
+ rendered run ends elsewhere; in SO101's it does not), so the graded run draws nothing.
+- The spatula scene's tool-only rule is checked. EmbodiedSWE states it in the scene's description and leaves it to
+ the harness, whose grading does not check it.
+- A malformed submissions directory (an entry that is not a checkpoint, more than 64 checkpoints) leaves those entries
+ ungraded with score 0 instead of failing the whole evaluation.
+
+## Time budget
+
+The limit is EmbodiedSWE's rollout limit, 1800 s per candidate, start-up and import included. Measured on an L40S host
+(one env, GPU PhysX, `env.step` only): a fresh process starts and builds a scene in 13 to 27 s once the Kit cache is
+warm; the stack scene takes 26 ms per control step, fruit delivery 43 ms, spatula 138 ms, and SO101, the slowest (two
+arms, 16 physics substeps at 240 Hz, twelve screws with continuous collision detection), 377 to 394 ms, so 30 minutes
+hold about 4,500 SO101 control steps, 5 minutes of simulated time.
+
+## Device
+
+PhysX and the G1's frozen locomotion policy run on the GPU (`device="cuda:0"`), as in EmbodiedSWE, in the verifier and
+in the agent's development env alike (`make_env()` builds exactly as grading does). On one GPU model a fresh process
+repeats a run bit for bit (measured on L40S: the stack scene's closed-loop rollout twice and its recorded actions
+replayed twice, SO101 three times, the same final-state hash). The frozen instance records its start state's hash, its
+scene state vector and the GPU model that froze it (NVIDIA L40S). The rollout compares its start state: on that model
+the hash must match (a mismatch is the verifier's error, `instance_mismatch`); on another model the difference is
+recorded (`instance_ok`, `instance_same_gpu`, `instance_max_abs_diff`, `instance_within_tol` at 1e-4 in
+`reward.json`), never an error. A run on another GPU model may differ in its bits; a closed-loop solve that reads the
+state is robust to that, an open-loop action sequence may not be.
+
+## Image
+
+`ghcr.io/mll-lab-nu/efe-private:embodiedswe-<VERSION>` (`images/embodiedswe/`, BUILD_ONLY): RoboLab's recipe plus
+robobench at the pinned commit, scrubbed of graders, smoke probes and solve-calibrated comments, and its asset bundle
+by sha256. Isaac Lab's default ground plane and its 3 textures are mirrored into the image by sha256
+(`isaac_assets.json`), and the Isaac Lab kit files point their asset root there, so no scene reads the network. Some
+upstream binary USD assets carry "Generated from Composed Stage" doc strings with their authors' build paths; these
+hold no task content and are left as shipped.
+
+## Provenance
+
+EmbodiedSWE: github.com/EmbodiedSWE/EmbodiedSWE (Apache-2.0), assets on Hugging Face EmbodiedSWE/robobench-assets.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..aef37d77ed
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:39dbac0639151557aed5a7a7ab515fc90d0bffb7b6016e17830ec92fe6faa4ac
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..6b4f5246e8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.allen_bolt.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Drive an allen bolt home with an L-key (Franka, operational-space control). EmbodiedSWE's `assembly.allen_bolt.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Tool use under torque control: the L-key has to be picked up, its short arm seated in the bolt's 14 mm hex socket (0.75 mm clearance) and turned clockwise while pressing, re-gripping between turns, until the bolt seats.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/allen_bolt_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..431952b724
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,157 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.allen_bolt.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/key_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/key_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/platform_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/platform_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ 0.0,
+ 0.03310199826955795,
+ 0.9479636549949646,
+ 0.0,
+ 0.0,
+ 0.3183785080909729,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ 0.18000000715255737,
+ 0.007499999832361937,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "ead190de941f16a71c3118edd1ff72f1ed4820d1c204114e7978930c076ed7ce"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..2daf173be8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..e04b1d85ac
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Drive an allen bolt home with an L-key (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+1 small steel platform standing fixed on a sturdy table, each with an M16 threaded hole through its plate, and beside it: 1 L-shaped allen key lying on the table — the hole's M16 allen (socket-head) bolt already stands in it hand-started, a couple of turns captured. The hole carries real threads; the bolt head carries a 14 mm hex socket.
+Goal: seat the key in the bolt's socket and drive it down (turn clockwise while pressing) until it seats. A seated bolt locks in place. The task is complete once the bolt is seated. The key holds in a firm pinch: close the fingers across either arm's hex and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.allen_bolt.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..495af83467
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.allen_bolt.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "allen-key", "franka", "assembly.allen_bolt.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.allen_bolt.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grader/allen_bolt_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grader/allen_bolt_assembly.py
new file mode 100644
index 0000000000..59ac695768
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/grader/allen_bolt_assembly.py
@@ -0,0 +1,77 @@
+"""Grader for the allen_bolt scene: every bolt driven home with the key.
+
+Rubric stages (weights and modes live in RUBRIC):
+ key_grasped a key has been taken in the weld-on-closure grip (`scene.grasp_held`, any
+ key, either arm) — the scene's own grasp state; a milestone, latched. Also
+ true once every bolt is seated (a seated bolt was necessarily driven by
+ the key), so the rung nests under `driven`. Under an embodiment with no
+ gripper (the weld contract disabled, e.g. robot="null") the grasp state does
+ not exist and the rung reads from that implication alone
+ driven mean over bolts of the tip's depth from the start register to the seat —
+ `bolt_stage_depth` -> `seat_depth` when the bolts spawn hand-started
+ (`bolt_staged`, every robot binding), plate top (depth 0) -> `seat_depth`
+ for the lying spawn — counted only while the bolt is within `align_xy` of the
+ hole axis and `align_axis_deg` of upright, the scene's own non-depth seat
+ gates, so a bolt's value is 1.0 iff the scene calls it seated
+Both stages are per env. The key's own "seated in the hex socket" step is NOT a rung: the
+head/socket geometry is not in the scene cfg, so it cannot be read from state without an
+invented tolerance. Success is the scene's `success()` per env (every bolt `seated()`),
+read when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.allen_bolt_assembly import AllenBoltAssemblyScene
+
+
+class AllenBoltAssemblyGrader(BaseGrader):
+ """Every bolt seated — driven down to seat depth with the key, upright on the hole axis.
+
+ Ladder: key_grasped 0.50 · driven 1.00 — two equal rungs for the two measurable steps
+ (take the key, drive the bolt home); the second is a linear ramp of tip depth from the
+ bolt's start register (`bolt_stage_depth`, or the plate top for a lying spawn) to
+ `seat_depth`. With N bolts `driven` is the mean over bolts.
+ """
+
+ SCENE = AllenBoltAssemblyScene
+ RUBRIC = (("key_grasped", 1, "once"), ("driven", 1))
+ scene: AllenBoltAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ c = self.scene.cfg
+ self._depth0 = c.bolt_stage_depth if c.bolt_staged else 0.0 # tip depth at the start
+ # `grasp_held` exists only while the weld contract is live (a gripper on the stage).
+ self._has_grasp = hasattr(self.scene, "grasp_held")
+ self._grasped = torch.zeros(self.num_envs, dtype=torch.bool,
+ device=self.scene.engaged().device) # latch: a key ever held
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every bolt of that env seated
+
+ def _in_hole(self):
+ """(aligned, drive), each (num_envs, num_bolts): whether the bolt passes the scene's
+ xy + tilt seat gates in its nearest platform, and its tip-depth fraction from the
+ start register to the seat."""
+ c = self.scene.cfg
+ off = self.scene._bolt_offsets_in_platform() # (n, B, P, 3) — privileged read
+ near_dist = off[..., :2].norm(dim=-1).min(dim=-1).values
+ aligned = (near_dist <= c.align_xy) & (
+ self.scene._bolt_axis_cos() >= math.cos(math.radians(c.align_axis_deg)))
+ depth = self.scene.engaged() # (n, B) tip depth below the plate top (m)
+ drive = ((depth - self._depth0) / (c.seat_depth - self._depth0)).clamp(0.0, 1.0)
+ return aligned, drive
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def key_grasped(self):
+ if self._has_grasp:
+ self._grasped |= self.scene.grasp_held.any(dim=1)
+ return (self._grasped | self.scene.success()).float()
+
+ def driven(self):
+ aligned, drive = self._in_hole()
+ return (aligned * drive).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..431952b724
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,157 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.allen_bolt.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/key_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/key_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/platform_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/platform_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ 0.0,
+ 0.03310199826955795,
+ 0.9479636549949646,
+ 0.0,
+ 0.0,
+ 0.3183785080909729,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ 0.18000000715255737,
+ 0.007499999832361937,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "ead190de941f16a71c3118edd1ff72f1ed4820d1c204114e7978930c076ed7ce"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..2daf173be8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..0f995d38af
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-allen-bolt-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/allen_bolt_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..a8391f18a7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:4a2484ca6c4c8a1bcfbe1b1be4d4834519b4cb9babb465ee5be25c7f34eb2b0b
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..fc35ea1f5b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/README.md
@@ -0,0 +1,46 @@
+# embodiedswe-assembly-bulb-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.bulb.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Screw a light bulb into its socket (Franka, operational-space control). EmbodiedSWE's `assembly.bulb.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Contact-rich assembly: a grasp of a small round bulb, alignment on a threaded socket and a turn-while-pressing motion under torque control (OSC); EmbodiedSWE's GPT-6-class agents solve it within a few hours in their own runs.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/bulb_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
+
+## Details
+
+### Review notes
+- Solvability (no reference solution ships for this scene): the bulb is physically seatable. A development-only
+ probe that presses and twists the bulb directly seats it, so the thread works.
+- A scripted robot attempt stalls during the turn. Three properties of the controller and the gripper make
+ the turn hard: the rotational stiffness of the operational-space controller; its nullspace posture spring,
+ which pulls the last wrist joint back toward its rest angle; and the parallel jaw, which pivots on the round
+ glass instead of holding it rigidly.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..1166834925
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,144 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.bulb.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/socket_0/joint_position",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/socket_0/joint_velocity",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/socket_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/socket_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bulb_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bulb_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.4099999964237213,
+ 2.2737367544323206e-13,
+ 0.0,
+ 1.0,
+ -6.251449011229759e-13,
+ -5.737126268848258e-14,
+ 1.3771561668818322e-09,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25798091292381287,
+ 0.2503335773944855,
+ 0.024000000208616257,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "57ccacd9ddad53b98d180579a301c994eba44b77aa3db8c305ea515c10a17526"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..652e1bb048
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-bulb-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..9c9a64632b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Screw a light bulb into its socket (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+1 lamp socket standing upright, fixed on a sturdy table, and 1 loose light bulb lying on the table beside it, ready to be picked up and fitted. Each socket carries a real internal thread.
+Goal: pick up the bulb, set it on the socket, and screw it down (turn it clockwise while pressing down) until it seats. A seated bulb is held by its thread, and GLOWS ever brighter as it screws home — from a faint orange at first electrical contact to fully bright warm white exactly when seated. The task is complete once the bulb is seated.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.bulb.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..8214d06695
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-bulb-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.bulb.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "franka", "assembly.bulb.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.bulb.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grader/bulb_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grader/bulb_assembly.py
new file mode 100644
index 0000000000..a1451ab297
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/grader/bulb_assembly.py
@@ -0,0 +1,78 @@
+"""Grader for the bulb scene: every bulb seated.
+
+Rubric stages (weights and modes live in RUBRIC), each a fraction over that env's bulbs:
+ lifted bulbs ever raised to the socket's bore-mouth height — origin at/above
+ `socket_opening_z` in the nearest socket's frame, the height a cap-down bulb
+ has to clear before it can be set on the socket — or already in a bore (a bulb
+ in the bore was necessarily lifted there); a milestone, latched per bulb
+ engaged bulbs on/in a socket bore — within `align_xy` of the axis and at/below the
+ bore mouth (`socket_opening_z`)
+ threaded mean thread depth over the scene's own glow band, from `light_start_z` (free
+ rest on the thread, where the glow begins) to `seat_z` (seated), counted only
+ while the bulb is aligned in xy AND tilt exactly as the scene's `seated()`
+ demands — so a bulb's value is 1.0 iff the scene calls it seated
+The rungs nest (seated => engaged => lifted), so progress reaches 1.0 exactly when every
+bulb of the env is seated, and for a grader built after the pick as well as one that
+watched it. Success is the scene's `seated()` per env, read when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.bulb_assembly import BulbAssemblyScene
+
+
+class BulbAssemblyGrader(BaseGrader):
+ """Every bulb seated — threaded to depth, on the socket axis, upright.
+
+ Ladder: lifted 0.33 · engaged 0.67 · threaded 1.00 — three equal rungs for the three
+ steps of the task (pick the bulb up, set it on the socket, screw it home); the last
+ rung is a linear ramp of thread depth over the scene's own glow band
+ (`light_start_z` -> `seat_z`). With N bulbs every stage is the fraction of bulbs.
+ """
+
+ SCENE = BulbAssemblyScene
+ RUBRIC = (("lifted", 1, "once"), ("engaged", 1), ("threaded", 1))
+ scene: BulbAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ z, _, _, _ = self._in_socket()
+ self._lifted = torch.zeros_like(z, dtype=torch.bool) # per-bulb latch: ever lifted
+
+ def check_success(self):
+ return self.scene.seated().all(dim=1) # (num_envs,) — every bulb of that env
+
+ def _in_socket(self):
+ """(height, engaged, aligned, thread), each (num_envs, num_bulbs): the bulb origin's
+ height above its nearest socket's origin, whether it is in that bore, whether it
+ passes the scene's xy + tilt seat gates, and its thread-depth fraction."""
+ import torch
+
+ c = self.scene.cfg
+ off = self.scene._bulb_offsets_in_socket() # (n, N_bulb, B_socket, 3) — privileged read
+ near_dist, near = off[..., :2].norm(dim=-1).min(dim=-1)
+ z = torch.gather(off[..., 2], 2, near.unsqueeze(-1)).squeeze(-1)
+ xy_ok = near_dist <= c.align_xy
+ engaged = xy_ok & (z <= c.socket_opening_z)
+ aligned = xy_ok & (self.scene._bulb_axis_cos() >= math.cos(math.radians(c.align_axis_deg)))
+ thread = ((c.light_start_z - z) / (c.light_start_z - c.seat_z)).clamp(0.0, 1.0)
+ return z, engaged, aligned, thread
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that
+ # env's bulbs ------------------------------------------------------------
+ def lifted(self):
+ z, engaged, _, _ = self._in_socket()
+ self._lifted |= (z >= self.scene.cfg.socket_opening_z) | engaged
+ return self._lifted.float().mean(dim=1)
+
+ def engaged(self):
+ _, engaged, _, _ = self._in_socket()
+ return engaged.float().mean(dim=1)
+
+ def threaded(self):
+ _, _, aligned, thread = self._in_socket()
+ return (aligned * thread).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..1166834925
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,144 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.bulb.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/socket_0/joint_position",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/socket_0/joint_velocity",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/socket_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/socket_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bulb_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bulb_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.4099999964237213,
+ 2.2737367544323206e-13,
+ 0.0,
+ 1.0,
+ -6.251449011229759e-13,
+ -5.737126268848258e-14,
+ 1.3771561668818322e-09,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25798091292381287,
+ 0.2503335773944855,
+ 0.024000000208616257,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "57ccacd9ddad53b98d180579a301c994eba44b77aa3db8c305ea515c10a17526"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..652e1bb048
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-bulb-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..3747c7d32b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-bulb-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/bulb_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..f1dee2cc63
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:66b16b9880263e4b5ee39a544b52d5ec715bab4c7a1cd36abc4a28b905a54793
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..37e90b6811
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda-bimanual` |
+| Family / instance | `assembly.ikea_table.bimanual_franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Screw the four legs onto a side table (two Frankas, operational-space control). EmbodiedSWE's `assembly.ikea_table.bimanual_franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Long-horizon bimanual assembly: four legs lying on the bench are each picked up, stood on its corner stud and screwed down by repeated turn-and-press re-grasps; the two arms share one workspace and one 16-dim action.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/ikea_table_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..a164058fbd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,270 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "assembly.ikea_table.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tabletop/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tabletop/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.949999988079071,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25,
+ -0.25,
+ 0.9940000176429749,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.05000000074505806,
+ -0.029999999329447746,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.009999999776482582,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12999999523162842,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.44999998807907104,
+ 0.0,
+ 1.0440000295639038,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "9954e41df2fbc48d6634cfdced9ca59470055ad3cf589e595152eaa1bdc10385"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..01effc8b69
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..a92bc34d18
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,156 @@
+# Screw the four legs onto a side table (two Frankas, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+An IKEA-style side table, partly assembled, lying on a sturdy waist-high workbench. The free-standing tabletop slab (~0.55 x 0.55 m, 5 cm thick) carries 4 upright threaded studs at its corners (xy = (+0.25, +0.25), (-0.25, +0.25), (+0.25, -0.25), (-0.25, -0.25) m, relative to the slab centre). 4 loose legs — each a threaded nut on a graspable cylindrical shaft — lie on their side in a row near the centre of the workbench, ready to be picked up and fitted.
+Goal: screw every leg down onto its stud (turn it clockwise while pressing down) until it seats. A seated leg locks in place. The table is assembled once all 4 legs are seated.
+
+2 robots operating in the same workspace as one composite embodiment. The action vector is their actions concatenated in order ('left' dims [0:8), 'right' dims [8:16); total 16).
+[left] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+[right] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.ikea_table.bimanual_franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 16)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+This robot is bimanual: `env.robot.articulation` is `None`. Each arm is reached through
+`env.robot.robots['left']` and `env.robot.robots['right']` (their articulations, bodies and joints), and
+`env.robot.action_slices` says which part of the action vector drives which arm.
+
+Action range. In each arm's 8-value slice, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values of each slice are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..350718f7ff
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.ikea_table.bimanual_franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "bimanual", "franka", "assembly.ikea_table.bimanual_franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda-bimanual"
+family = "assembly.ikea_table.bimanual_franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grader/ikea_table_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grader/ikea_table_assembly.py
new file mode 100644
index 0000000000..c85f374a67
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/grader/ikea_table_assembly.py
@@ -0,0 +1,69 @@
+"""Grader for the ikea_table scene: all four legs screwed down onto the tabletop's studs.
+
+The four legs are identical sub-goals, so every rung is ONE stage whose value is the fraction
+of legs (k/4) that have reached it. The scene has no grasp contract and exposes no threshold
+for "lifted", so a grasped/lifted rung cannot be measured from state and is not one; per leg
+the ladder is aligned -> seated, equal weights, all measured in the tabletop's own frame
+(order-independent: any leg on any stud, as the scene's `seated()` is):
+ aligned legs standing on a stud — within `align_xy` of the nearest stud and screw axis
+ within `align_axis_deg` of the stud axis: the scene's own two non-depth seat gates
+ seated mean over legs of the screw-down from the stud-top rest height (`leg_start_z`, the
+ scene's on-stud spawn height) to the seat (`seat_z`), counted only while aligned —
+ so a leg's value is 1.0 iff the scene calls it `seated()`
+The rungs nest (seated => aligned), so progress reaches 1.0 exactly when every leg is seated.
+The scene welds a seated leg to the table, so a welded leg stays `seated()` however the
+assembly is later moved. Success is the scene's own `success()` (every leg `seated()`), read
+when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.ikea_table_assembly import IkeaTableAssemblyScene
+
+
+class IkeaTableAssemblyGrader(BaseGrader):
+ """All four legs seated on the studs — each threaded down to depth, on a stud axis, upright.
+
+ Ladder (per leg, each rung 1/8): aligned 1/8 · seated 2/8;
+ 1 leg 0.25 · 2 legs 0.50 · 3 legs 0.75 · 4 legs 1.00 — two equal rungs for the two
+ measurable steps of each leg (set it on its stud, screw it down); the second is a linear
+ ramp of the leg's height from the stud-top rest height (`leg_start_z`) to the seat (`seat_z`).
+ """
+
+ SCENE = IkeaTableAssemblyScene
+ # Equal weights: the two rungs of one leg's ladder; every stage is a k/4 fraction.
+ RUBRIC = (("aligned", 1), ("seated", 1))
+ scene: IkeaTableAssemblyScene
+
+ def setup(self) -> None:
+ pass # every rung reads the live state against the scene's cfg; nothing to capture
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every leg of that env seated
+
+ def _on_stud(self):
+ """(aligned, thread), each (num_envs, num_legs): whether the leg passes the scene's
+ xy + tilt seat gates at its nearest stud, and its screw-down fraction from the
+ stud-top rest height to the seat."""
+ import torch
+
+ c = self.scene.cfg
+ off = self.scene._leg_offsets_in_table() # (n, L, 3): leg position in the slab frame
+ studs = torch.tensor(c.slots, device=off.device, dtype=off.dtype) # (S, 2)
+ near = (off[:, :, None, :2] - studs[None, None]).norm(dim=-1).amin(dim=-1)
+ aligned = (near <= c.align_xy) & (
+ self.scene._leg_axis_cos() >= math.cos(math.radians(c.align_axis_deg)))
+ thread = ((c.leg_start_z - off[..., 2]) / (c.leg_start_z - c.seat_z)).clamp(0.0, 1.0)
+ return aligned, thread
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that env's legs -----------
+ def aligned(self):
+ aligned, _ = self._on_stud()
+ return aligned.float().mean(dim=1)
+
+ def seated(self):
+ aligned, thread = self._on_stud()
+ return (aligned * thread).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..a164058fbd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,270 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "assembly.ikea_table.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/leg_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/leg_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tabletop/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tabletop/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.949999988079071,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25,
+ -0.25,
+ 0.9940000176429749,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.05000000074505806,
+ -0.029999999329447746,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.009999999776482582,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12999999523162842,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.18000000715255737,
+ 1.0160000324249268,
+ 0.7071067690849304,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.44999998807907104,
+ 0.0,
+ 1.0440000295639038,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "9954e41df2fbc48d6634cfdced9ca59470055ad3cf589e595152eaa1bdc10385"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..01effc8b69
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..108370b32c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-ikea-table-bimanual-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/ikea_table_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..5267ad6784
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:3d4a7825f61049b1dd4a82eee977a528533278e401c0f8dca71651362d2a8734
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..d9778c39f7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-nut-thread-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.nut_thread.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Thread a nut onto a bolt (Franka, operational-space control). EmbodiedSWE's `assembly.nut_thread.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Contact-rich threading: pick up a loose M16 nut, set it square on a fixed bolt and screw it down on real threads with turn-while-pressing re-grasps under torque control.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/nut_thread_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..3e1cb13e36
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,144 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.0020833333333333333,
+ "preset": "assembly.nut_thread.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/bolt_0/joint_position",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/bolt_0/joint_velocity",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/nut_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/nut_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.5,
+ -3.637978807091713e-12,
+ -6.51925802230835e-09,
+ 1.0000001192092896,
+ -4.161558250781461e-12,
+ -5.29941888982588e-12,
+ -1.5299113087507976e-09,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.37798091769218445,
+ 0.00033358336077071726,
+ 0.019999999552965164,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "d3ace57f86b6b24c0ef9d94dd43400d34fcbff5a13905a3654061a4e6f657249"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..87fec9e20a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-nut-thread-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..5fd581a9fd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Thread a nut onto a bolt (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+1 M16 bolt standing upright, fixed on a sturdy table, and 1 loose M16 nut resting flat on the table beside it, ready to be picked up and fitted. Each bolt carries real threads.
+Goal: pick up the nut, set it on the bolt, and screw it down (turn it clockwise while pressing down) until it seats. A seated nut locks in place. The task is complete once the nut is seated.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.nut_thread.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..70ea665d53
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.nut_thread.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "franka", "assembly.nut_thread.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.nut_thread.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grader/nut_thread_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grader/nut_thread_assembly.py
new file mode 100644
index 0000000000..2daa8116e1
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/grader/nut_thread_assembly.py
@@ -0,0 +1,77 @@
+"""Grader for the nut_thread scene: every nut seated on a bolt.
+
+Rubric stages (weights and modes live in RUBRIC), each a fraction over that env's nuts:
+ lifted nuts ever raised to the bolt-top rest height — origin at/above `bolt_height`
+ in the nearest bolt's frame, the height the scene quotes for a nut resting on
+ the bolt top and so the height a nut has to clear before it can be set on the
+ bolt — or already aligned on a bolt (a nut on the bolt was necessarily lifted
+ there); a milestone, latched per nut
+ aligned nuts aligned on a bolt — within `align_xy` of the bolt axis and tilted at most
+ `align_axis_deg` off it, the scene's own two non-depth seat gates
+ threaded mean thread depth from the bolt-top rest height (`bolt_height`) down to the
+ seat (`seat_z`), counted only while aligned — so a nut's value is 1.0 iff the
+ scene calls it seated
+The rungs nest (seated => aligned => lifted), so progress reaches 1.0 exactly when every
+nut of the env is seated, and for a grader built after the pick as well as one that watched
+it. Success is the scene's `seated()` per env, read when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.nut_thread_assembly import NutThreadAssemblyScene
+
+
+class NutThreadAssemblyGrader(BaseGrader):
+ """Every nut seated — threaded down to seat depth, on the bolt axis, upright.
+
+ Ladder: lifted 0.33 · aligned 0.67 · threaded 1.00 — three equal rungs for the three
+ steps of the task (pick the nut up, set it on the bolt, screw it down); the last rung
+ is a linear ramp of the nut's height from the bolt-top rest height (`bolt_height`) to
+ the seat (`seat_z`). With N nuts every stage is the fraction of nuts.
+ """
+
+ SCENE = NutThreadAssemblyScene
+ RUBRIC = (("lifted", 1, "once"), ("aligned", 1), ("threaded", 1))
+ scene: NutThreadAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ z, _, _ = self._on_bolt()
+ self._lifted = torch.zeros_like(z, dtype=torch.bool) # per-nut latch: ever lifted
+
+ def check_success(self):
+ return self.scene.seated().all(dim=1) # (num_envs,) — every nut of that env
+
+ def _on_bolt(self):
+ """(height, aligned, thread), each (num_envs, num_nuts): the nut origin's height
+ above its nearest bolt's origin, whether it passes the scene's xy + tilt seat gates,
+ and its thread-depth fraction from the bolt-top rest height to the seat."""
+ import torch
+
+ c = self.scene.cfg
+ off = self.scene._nut_offsets_in_bolt() # (n, N_nut, B_bolt, 3) — privileged read
+ near_dist, near = off[..., :2].norm(dim=-1).min(dim=-1)
+ z = torch.gather(off[..., 2], 2, near.unsqueeze(-1)).squeeze(-1)
+ aligned = (near_dist <= c.align_xy) & (
+ self.scene._nut_axis_cos() >= math.cos(math.radians(c.align_axis_deg)))
+ thread = ((c.bolt_height - z) / (c.bolt_height - c.seat_z)).clamp(0.0, 1.0)
+ return z, aligned, thread
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that
+ # env's nuts -------------------------------------------------------------
+ def lifted(self):
+ z, aligned, _ = self._on_bolt()
+ self._lifted |= (z >= self.scene.cfg.bolt_height) | aligned
+ return self._lifted.float().mean(dim=1)
+
+ def aligned(self):
+ _, aligned, _ = self._on_bolt()
+ return aligned.float().mean(dim=1)
+
+ def threaded(self):
+ _, aligned, thread = self._on_bolt()
+ return (aligned * thread).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..3e1cb13e36
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,144 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.0020833333333333333,
+ "preset": "assembly.nut_thread.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/bolt_0/joint_position",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/bolt_0/joint_velocity",
+ [
+ 1,
+ 0
+ ]
+ ],
+ [
+ "/articulation/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/nut_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/nut_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.5,
+ -3.637978807091713e-12,
+ -6.51925802230835e-09,
+ 1.0000001192092896,
+ -4.161558250781461e-12,
+ -5.29941888982588e-12,
+ -1.5299113087507976e-09,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.37798091769218445,
+ 0.00033358336077071726,
+ 0.019999999552965164,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "d3ace57f86b6b24c0ef9d94dd43400d34fcbff5a13905a3654061a4e6f657249"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..87fec9e20a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-nut-thread-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..6e2ca60825
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-nut-thread-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/nut_thread_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..5081c5999a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:b69475a30974dd6e8beb50bae266ccd214cdf02507989a512350e9f4ebb83cb4
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..336feba839
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.pc_gpu.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Install a graphics card in a PC case (Franka, operational-space control). EmbodiedSWE's `assembly.pc_gpu.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Constrained insertion: the card must be lifted out of its holder, lowered into the case forward of the rear panel, slid back until its bracket passes the cutout and pressed straight into the x16 slot.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/pc_gpu_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..041e250c62
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,130 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_gpu.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/card/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/card/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.6399999856948853,
+ -0.3400000035762787,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2800000011920929,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "eaeb5d2158d74e48c8f9062897c9d0b7e0b63d9e6930dc1343351ea1cdc3d382"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..b2d7f4165a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..97e319930d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Install a graphics card in a PC case (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A gaming-PC case lying on its side on a sturdy table, opening up, its motherboard facing the ceiling. The board's primary PCIe x16 slot is empty, and the rear I/O panel has an open expansion-slot cutout. Beside the case a loose graphics card stands upright in a foam holder, already in its installation orientation.
+Goal: grip the card by its top edge, lift it straight out of the holder, lower it into the case with its I/O bracket just forward of the rear panel, slide it rearward until the bracket and ports pass through the cutout, line its PCB edge connector up with the x16 slot, and press it straight down until it bottoms out. A seated card stays put on its own. The task is complete once the card is fully seated. The card holds in a firm pinch: close the fingers squarely across its body slab near the top edge and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.pc_gpu.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..3895796827
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.pc_gpu.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "insertion", "pc-building", "franka", "assembly.pc_gpu.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.pc_gpu.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grader/pc_gpu_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grader/pc_gpu_assembly.py
new file mode 100644
index 0000000000..c682351870
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/grader/pc_gpu_assembly.py
@@ -0,0 +1,75 @@
+"""Grader for the pc_gpu scene: the graphics card seated in the PCIe x16 slot.
+
+Rubric stages (weights and modes live in RUBRIC):
+ grasped the card has been taken in the weld-on-closure grip (`scene.grasp_held`) — the
+ scene's own grasp state; a milestone, latched. Also true once the card is
+ aligned in the slot (a card in the slot was necessarily carried there), so the
+ rung nests under `aligned`. Under an embodiment with no gripper (the weld
+ contract disabled, e.g. robot="null") the grasp state does not exist and the
+ rung reads from that implication alone
+ aligned the card lined up on the slot — origin within `align_xy` of the seated point,
+ up axis within `align_axis_deg` of the slot axis, length axis within
+ `align_yaw_deg` of the slot heading: the scene's own three non-depth seat gates
+ pressed tab depth below the slot mouth (`slot_mouth_z`, the scene's own `engaged()`)
+ as a fraction of `seat_depth`, counted only while aligned — so it is 1.0 iff
+ the scene calls the card seated
+Every stage is per env. The rungs nest (seated => aligned => grasped), so progress reaches
+1.0 exactly when the card is seated, and for a grader built after the pick as well as one
+that watched it. The rear-panel pass-through is NOT a rung: the cutout's geometry is not in
+the scene cfg, so it cannot be read from state without an invented tolerance. Success is
+the scene's `seated()` per env — depth, xy, tilt AND heading gates — read when the
+delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.pc_gpu_assembly import PcGpuAssemblyScene
+
+
+class PcGpuAssemblyGrader(BaseGrader):
+ """The card seated in its slot — pressed to depth, centred, upright, heading along the slot.
+
+ Ladder: grasped 0.33 · aligned 0.67 · pressed 1.00 — three equal rungs for the three
+ steps of the task (take the card, line it up on the slot, press it home); the last rung
+ is a linear ramp of tab depth from the slot mouth (`slot_mouth_z`) to `seat_depth`.
+ """
+
+ SCENE = PcGpuAssemblyScene
+ RUBRIC = (("grasped", 1, "once"), ("aligned", 1), ("pressed", 1))
+ scene: PcGpuAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ # `grasp_held` exists only while the weld contract is live (a gripper on the stage).
+ self._has_grasp = hasattr(self.scene, "grasp_held")
+ self._grasped = torch.zeros(self.num_envs, dtype=torch.bool,
+ device=self.scene.engaged().device) # latch: card ever held
+
+ def check_success(self):
+ return self.scene.seated() # (num_envs,)
+
+ def _aligned(self):
+ """(num_envs,) bool: the scene's xy + tilt + heading seat gates, without depth."""
+ c = self.scene.cfg
+ rel = self.scene._card_offset_in_case() # (n, 3), zero at the seated pose — privileged
+ xy_ok = rel[:, :2].norm(dim=-1) <= c.align_xy
+ up_ok = self.scene._axis_cos(2) >= math.cos(math.radians(c.align_axis_deg))
+ yaw_ok = self.scene._axis_cos(0) >= math.cos(math.radians(c.align_yaw_deg))
+ return xy_ok & up_ok & yaw_ok
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def grasped(self):
+ if self._has_grasp:
+ self._grasped |= self.scene.grasp_held.any(dim=1)
+ return (self._grasped | self._aligned()).float()
+
+ def aligned(self):
+ return self._aligned().float()
+
+ def pressed(self):
+ depth = self.scene.engaged() # (n,) tab depth below the slot mouth (m)
+ return self._aligned() * (depth / self.scene.cfg.seat_depth).clamp(0.0, 1.0)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..041e250c62
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,130 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_gpu.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/card/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/card/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.6399999856948853,
+ -0.3400000035762787,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2800000011920929,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "eaeb5d2158d74e48c8f9062897c9d0b7e0b63d9e6930dc1343351ea1cdc3d382"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..b2d7f4165a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..88a2403fc3
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/pc_gpu_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..4b7da0edcb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:7e71220e9525c924d1599a4b26793b33b6ae3616f942654a154275622c17a7f6
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..4f4c42a76d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.pc_gpu_ram.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Install a graphics card and two RAM sticks (Franka, operational-space control). EmbodiedSWE's `assembly.pc_gpu_ram.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Three sequential insertions in one case: the graphics card (slide-under-the-rear-panel then press) and two RAM sticks into the correct dual-channel slots, each pressed fully home.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/pc_gpu_ram_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..b4cc57b2d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,184 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_gpu_ram.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/card/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/card/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ -0.30000001192092896,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.36500000953674316,
+ -0.32100000977516174,
+ 0.029999999329447746,
+ 0.7071099877357483,
+ 0.0,
+ 0.0,
+ 0.7071099877357483,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.550000011920929,
+ 0.03999999910593033,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.28999999165534973,
+ -0.3199999928474426,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.4399999976158142,
+ -0.3199999928474426,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a8390afd1722bc53a2dda155dff52099589c17a899bb16660ab110e2a8c528e9"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..1be244aa46
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..0664ee059c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Install a graphics card and two RAM sticks (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A gaming-PC case lying on its side on a sturdy table, opening up, its motherboard facing the ceiling. The board's primary PCIe x16 slot is empty (the rear I/O panel has an open expansion-slot cutout), and all four memory slots are empty. Beside the case a loose graphics card and two loose RAM sticks stand upright in foam holders, already in their installation orientations.
+Goal: install the card first — grip it by its top edge, lift it out of its holder, lower it into the case with its I/O bracket just forward of the rear panel, slide it rearward until the bracket and ports pass through the cutout, line its PCB edge connector up with the x16 slot, and press it straight down until it bottoms out — then install each RAM stick: carry it over the case wall, line its gold edge connector up with its slot (the outermost and the second-from-socket, the alternating pair a dual-channel kit fills), and press it straight down until it clicks fully home. Every seated part stays put on its own. The task is complete once the card and both sticks are fully seated. A part holds in a firm pinch: close the fingers squarely across the card's body slab or a stick's faces, near the top edge, and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.pc_gpu_ram.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..0780d1d2a8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.pc_gpu_ram.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "insertion", "pc-building", "franka", "assembly.pc_gpu_ram.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.pc_gpu_ram.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grader/pc_gpu_ram_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grader/pc_gpu_ram_assembly.py
new file mode 100644
index 0000000000..32c8a66579
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/grader/pc_gpu_ram_assembly.py
@@ -0,0 +1,115 @@
+"""Grader for the pc_gpu_ram scene: the graphics card AND both RAM sticks seated.
+
+Three parts — one card, two identical sticks. Each part climbs the same ladder, grasped ->
+aligned -> seated, and every part is worth the same third of the score. The card has its own
+three stages; the two identical sticks share three FRACTION stages (k/2 each), which
+therefore carry weight 2 (one unit per stick) against the card's 1.
+ gpu_grasped / ram_grasped parts ever taken in the weld-on-closure grip (`scene.grasp_held`:
+ column 0 the card, 1.. the sticks, in `grasp_sites()` order) —
+ the scene's own grasp state; milestones, latched per part. Also
+ true for a part that is seated (a seated part was necessarily
+ carried there), so the rungs nest under the seated rungs. Under
+ an embodiment with no gripper (the weld contract disabled, e.g.
+ robot="null") the grasp state does not exist and the rungs read
+ from that implication alone
+ gpu_aligned / ram_aligned the part lined up on its slot — origin within `gpu_align_xy` /
+ `ram_align_xy` of the seated point, up axis within
+ `gpu_align_axis_deg` / `ram_align_axis_deg` of the slot axis,
+ length axis within `gpu_align_yaw_deg` / `ram_align_yaw_deg` of
+ the slot heading: the scene's own three non-depth seat gates
+ gpu_seated / ram_seated depth below the slot mouth (`gpu_slot_mouth_z` / `ram_slot_mouth_z`,
+ the scene's own `gpu_engaged()` / `ram_engaged()`) as a fraction
+ of `gpu_seat_depth` / `ram_seat_depth`, counted only while
+ aligned — so a part's value is 1.0 iff the scene calls it seated
+The rungs nest (seated => aligned => grasped), so progress reaches 1.0 exactly when the card
+and both sticks are seated, and for a grader built after the picks as well as one that
+watched them. Success is the scene's own `success()` (card and every stick seated), read when
+the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.pc_gpu_ram_assembly import PcGpuRamAssemblyScene
+
+
+class PcGpuRamAssemblyGrader(BaseGrader):
+ """The graphics card and both RAM sticks seated — each pressed to depth, centred, upright, heading along its slot.
+
+ Ladder (total weight 9, every part worth 3/9):
+ card grasped 1/9 · card aligned 2/9 · card seated 3/9 (0.333) ·
+ then per stick +1/9 per rung: first stick seated 6/9 (0.667) · both sticks seated 1.00.
+ Each part's seated rung is a linear ramp of depth from its slot mouth to its seat depth.
+ """
+
+ SCENE = PcGpuRamAssemblyScene
+ # Per-part accounting: the card's rungs weigh 1; the sticks' rungs are k/2 fractions over
+ # two identical parts, so they weigh 2 (one unit per stick) — every part counts the same.
+ RUBRIC = (
+ ("gpu_grasped", 1, "once"), ("gpu_aligned", 1), ("gpu_seated", 1),
+ ("ram_grasped", 2, "once"), ("ram_aligned", 2), ("ram_seated", 2),
+ )
+ scene: PcGpuRamAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ # `grasp_held` exists only while the weld contract is live (a gripper on the stage).
+ self._has_grasp = hasattr(self.scene, "grasp_held")
+ depth = self.scene.engaged() # (n, 1 + S): card, then the sticks
+ self._grasped = torch.zeros_like(depth, dtype=torch.bool) # per-part latch: ever held
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — the card and every stick of that env seated
+
+ def _latch_grasped(self):
+ """(num_envs, 1 + num_slots) bool: ever held OR seated, card first then the sticks."""
+ if self._has_grasp:
+ self._grasped |= self.scene.grasp_held[:, : 1 + self.scene.cfg.num_slots]
+ return self._grasped | self.scene.seated()
+
+ def _gpu_aligned(self):
+ """(num_envs,) bool: the card passes the scene's xy + tilt + heading gates, without depth."""
+ c = self.scene.cfg
+ rel = self.scene._card_offset_in_case() # (n, 3), zero at the seated pose — privileged
+ xy_ok = rel[:, 0:2].norm(dim=-1) <= c.gpu_align_xy
+ up_ok = self.scene._part_axis_cos(self.scene.card, 2) >= math.cos(math.radians(c.gpu_align_axis_deg))
+ yaw_ok = self.scene._part_axis_cos(self.scene.card, 0) >= math.cos(math.radians(c.gpu_align_yaw_deg))
+ return xy_ok & up_ok & yaw_ok
+
+ def _ram_aligned(self):
+ """(num_envs, num_slots) bool: each stick passes the scene's xy + tilt + heading gates."""
+ import torch
+
+ c = self.scene.cfg
+ rel = self.scene._ram_offsets_in_case() # (n, S, 3), zero at the seated poses — privileged
+ xy_ok = rel[..., 0:2].norm(dim=-1) <= c.ram_align_xy
+ up_ok = torch.stack([self.scene._part_axis_cos(r, 2) for r in self.scene.rams], dim=1) >= math.cos(
+ math.radians(c.ram_align_axis_deg))
+ yaw_ok = torch.stack([self.scene._part_axis_cos(r, 1) for r in self.scene.rams], dim=1) >= math.cos(
+ math.radians(c.ram_align_yaw_deg))
+ return xy_ok & up_ok & yaw_ok
+
+ # ---- card stages — each returns a (num_envs,) value in [0, 1] -----------------------------
+ def gpu_grasped(self):
+ return self._latch_grasped()[:, 0].float()
+
+ def gpu_aligned(self):
+ return self._gpu_aligned().float()
+
+ def gpu_seated(self):
+ depth = self.scene.gpu_engaged() # (n,) tab depth below the PCIe slot mouth (m)
+ return self._gpu_aligned() * (depth / self.scene.cfg.gpu_seat_depth).clamp(0.0, 1.0)
+
+ # ---- stick stages — each returns a (num_envs,) fraction over that env's sticks -----------
+ def ram_grasped(self):
+ return self._latch_grasped()[:, 1:].float().mean(dim=1)
+
+ def ram_aligned(self):
+ return self._ram_aligned().float().mean(dim=1)
+
+ def ram_seated(self):
+ depth = self.scene.ram_engaged() # (n, S) blade depth below each DIMM slot mouth (m)
+ return (self._ram_aligned() * (depth / self.scene.cfg.ram_seat_depth).clamp(0.0, 1.0)).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..b4cc57b2d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,184 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_gpu_ram.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/card/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/card/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ -0.30000001192092896,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.36500000953674316,
+ -0.32100000977516174,
+ 0.029999999329447746,
+ 0.7071099877357483,
+ 0.0,
+ 0.0,
+ 0.7071099877357483,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.550000011920929,
+ 0.03999999910593033,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.28999999165534973,
+ -0.3199999928474426,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.4399999976158142,
+ -0.3199999928474426,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a8390afd1722bc53a2dda155dff52099589c17a899bb16660ab110e2a8c528e9"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..1be244aa46
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..6d49f1c874
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-gpu-ram-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/pc_gpu_ram_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..070cefb073
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:7237fb75d04e77b482ceedd4e5cf040c68c7053d18eab367d73d02e3666cf83a
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..2dcb054fb9
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.pc_motherboard.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Drive the seven motherboard bolts with an allen key (Franka, operational-space control). EmbodiedSWE's `assembly.pc_motherboard.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Repetitive tool use: one long L-key is seated in each of seven 7 mm hex sockets in turn and driven down with turn-and-press re-grasps; the handle has to clear the case walls.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/pc_motherboard_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..4135a537b9
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,319 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_motherboard.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/key/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/key/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07000000029802322,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5776000022888184,
+ -0.14480000734329224,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.375,
+ -0.1444000005722046,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.37490004301071167,
+ 0.010900000110268593,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.6014000177383423,
+ 0.01080000028014183,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.601900041103363,
+ 0.13449999690055847,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.44690001010894775,
+ 0.1347000002861023,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3752000331878662,
+ 0.13429999351501465,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5400000214576721,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.30000001192092896,
+ 0.0010000000474974513,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "79688b548fb961f196bc235a495b8e7d2f0883d18c2ba3f21265803880534c9c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..a5e452de2b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..f7ed1e7b3c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,151 @@
+# Drive the seven motherboard bolts with an allen key (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A gaming-PC case lying on its side on a sturdy table, opening up, its motherboard facing the ceiling. The board carries 7 case-mount screw holes, each backed by an M8 threaded insert in the case. Beside the case: 7 loose M8 allen (socket-head) bolts lying in a row, and one long-series L-shaped allen key (its arm is long enough that the swinging handle clears the case walls). Each bolt head carries a 7 mm hex socket.
+Every hole already holds its bolt hand-started upright, a few threads in.
+Goal: seat the key in a bolt's socket and drive the bolt down (turn clockwise while pressing) until it seats — then move on to the next hole. A seated bolt locks in place. The task is complete once all 7 bolts are seated. The key holds in a firm pinch: close the fingers across its handle's hex and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.pc_motherboard.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..51b0334dc8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.pc_motherboard.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "allen-key", "pc-building", "franka", "assembly.pc_motherboard.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.pc_motherboard.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grader/pc_motherboard_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grader/pc_motherboard_assembly.py
new file mode 100644
index 0000000000..41b4f1ce85
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/grader/pc_motherboard_assembly.py
@@ -0,0 +1,82 @@
+"""Grader for the pc_motherboard scene: all seven case-mount bolts driven home with the key.
+
+Rubric stages (weights and modes live in RUBRIC):
+ key_grasped the key has been taken in the weld-on-closure grip (`scene.grasp_held`, whose
+ only site is the key handle) — the scene's own grasp state; a milestone,
+ latched. Also true once every bolt is seated (a seated bolt was necessarily
+ driven by the key), so the rung nests under `driven`. Under an embodiment
+ with no gripper (the weld contract disabled, e.g. robot="null") the grasp
+ state does not exist and the rung reads from that implication alone
+ driven mean over the seven bolts of the tip's depth from the start register to the
+ seat — `stage_depth` -> `seat_depth` under the screw mechanic (every bolt
+ spawns hand-started that deep), board face (depth 0) -> `seat_depth` when
+ the mechanic is off and a loose bolt is threaded in from the top — counted
+ only while the bolt is within `align_xy` of its nearest hole axis and
+ `align_axis_deg` of upright, the scene's own non-depth seat gates, so a
+ bolt's value is 1.0 iff the scene calls it `seated()`
+Both stages are per env. The bolts spawn pre-staged in their holes, so an "aligned" rung
+would be free at reset and is not one; the key's own "seated in the hex socket" step is NOT a
+rung either: the head/socket geometry is not in the scene cfg, so it cannot be read from
+state without an invented tolerance. Success is the scene's own `success()` (every bolt
+`seated()`), read when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.pc_motherboard_assembly import PcMotherboardAssemblyScene
+
+
+class PcMotherboardAssemblyGrader(BaseGrader):
+ """All seven motherboard bolts seated — each driven to depth on its hole axis, upright.
+
+ Ladder (total weight 8, one unit per part — the key and each of the 7 bolts):
+ key grasped 0.125 · 1 bolt 0.25 · 2 bolts 0.375 · 3 bolts 0.50 · 4 bolts 0.625 ·
+ 5 bolts 0.75 · 6 bolts 0.875 · 7 bolts 1.00. `driven` is the mean over bolts of a linear
+ ramp of tip depth from the start register (`stage_depth`, or the board face for a loose
+ spawn) to `seat_depth`.
+ """
+
+ SCENE = PcMotherboardAssemblyScene
+ # One unit per part: the key's single rung weighs 1; `driven` is a k/7 fraction over seven
+ # identical bolts and so weighs 7 (one unit per bolt).
+ RUBRIC = (("key_grasped", 1, "once"), ("driven", 7))
+ scene: PcMotherboardAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ c = self.scene.cfg
+ self._depth0 = c.stage_depth if c.screw_mechanic else 0.0 # tip depth at the start
+ # `grasp_held` exists only while the weld contract is live (a gripper on the stage).
+ self._has_grasp = hasattr(self.scene, "grasp_held")
+ self._grasped = torch.zeros(self.num_envs, dtype=torch.bool,
+ device=self.scene.engaged().device) # latch: key ever held
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every bolt of that env seated
+
+ def _in_hole(self):
+ """(aligned, drive), each (num_envs, num_holes): whether the bolt passes the scene's
+ xy + tilt seat gates at its nearest hole, and its tip-depth fraction from the start
+ register to the seat."""
+ c = self.scene.cfg
+ off = self.scene._bolt_offsets_in_case() # (n, B, H, 3) — privileged read
+ near_dist = off[..., :2].norm(dim=-1).min(dim=-1).values
+ aligned = (near_dist <= c.align_xy) & (
+ self.scene._bolt_axis_cos() >= math.cos(math.radians(c.align_axis_deg)))
+ depth = self.scene.engaged() # (n, B) tip depth below the board face (m)
+ drive = ((depth - self._depth0) / (c.seat_depth - self._depth0)).clamp(0.0, 1.0)
+ return aligned, drive
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ----------------------------
+ def key_grasped(self):
+ if self._has_grasp:
+ self._grasped |= self.scene.grasp_held.any(dim=1)
+ return (self._grasped | self.scene.success()).float()
+
+ def driven(self):
+ aligned, drive = self._in_hole()
+ return (aligned * drive).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..4135a537b9
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,319 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_motherboard.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bolt_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bolt_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/key/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/key/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07000000029802322,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5776000022888184,
+ -0.14480000734329224,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.375,
+ -0.1444000005722046,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.37490004301071167,
+ 0.010900000110268593,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.6014000177383423,
+ 0.01080000028014183,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.601900041103363,
+ 0.13449999690055847,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.44690001010894775,
+ 0.1347000002861023,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3752000331878662,
+ 0.13429999351501465,
+ 0.02290000021457672,
+ -4.371138828673793e-08,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5400000214576721,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.30000001192092896,
+ 0.0010000000474974513,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "79688b548fb961f196bc235a495b8e7d2f0883d18c2ba3f21265803880534c9c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..a5e452de2b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..e25a4ff899
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-motherboard-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/pc_motherboard_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..5ccb557c0b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:8b20fb94486c1cccd1af00488f26e46a5fed1ed958f7d9cacf3215cc563c794f
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..b4f0549e92
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-assembly-pc-ram-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `assembly.pc_ram.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Install two RAM sticks (Franka, operational-space control). EmbodiedSWE's `assembly.pc_ram.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Precise insertion: each stick is carried over the case wall, its keyed edge connector lined up with the right dual-channel slot and pressed straight down until it clicks home.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/pc_ram_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..62c9270a81
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,157 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_ram.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ -0.3400000035762787,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.550000011920929,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "73177cb91acf9b0e5a6b6c23bc55a1ffe4d9b4de9df6f8644d33d3e448a8b3ee"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..6449889efe
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-ram-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..505443c142
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Install two RAM sticks (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A gaming-PC case lying on its side on a sturdy table, opening up, its motherboard facing the ceiling. All four memory slots are empty. Beside the case two loose RAM sticks stand upright in foam holders, already in their installation orientation.
+Goal: grip each stick by its top edge, lift it straight out of its holder, carry it over the case wall, line its gold edge connector up with its slot — the outermost and the second-from-socket, the alternating pair a dual-channel kit fills (the notch only fits one way — heat-spreader faces along the slot) — and press it straight down until it clicks fully home. A seated stick stays put on its own. The task is complete once both sticks are fully seated. A stick holds in a firm pinch: close the fingers flat across its faces near the top edge and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.pc_ram.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..c2f85f4c41
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.pc_ram.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "insertion", "pc-building", "franka", "assembly.pc_ram.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "assembly.pc_ram.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grader/pc_ram_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grader/pc_ram_assembly.py
new file mode 100644
index 0000000000..d32e560d0d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/grader/pc_ram_assembly.py
@@ -0,0 +1,77 @@
+"""Grader for the pc_ram scene: both RAM sticks seated in their DIMM slots.
+
+The two sticks are identical sub-goals, so every rung is ONE stage whose value is the
+fraction of sticks (k/2) that have reached it. Per stick the ladder is grasped -> aligned ->
+seated, equal weights:
+ grasped sticks ever taken in the weld-on-closure grip (`scene.grasp_held`, one column
+ per stick) — the scene's own grasp state; a milestone, latched per stick. Also
+ true for a stick that is seated (a seated stick was necessarily carried there),
+ so the rung nests under `seated`. Under an embodiment with no gripper (the weld
+ contract disabled, e.g. robot="null") the grasp state does not exist and the
+ rung reads from that implication alone
+ aligned sticks lined up on their slot — origin within `align_xy` of the seated point, up
+ axis within `align_axis_deg` of the slot axis, length axis within `align_yaw_deg`
+ of the slot heading: the scene's own three non-depth seat gates
+ seated mean over sticks of the blade depth below the slot mouth (`slot_mouth_z`, the
+ scene's own `engaged()`) as a fraction of `seat_depth`, counted only while
+ aligned — so a stick's value is 1.0 iff the scene calls it `seated()`
+The rungs nest (seated => aligned => grasped), so progress reaches 1.0 exactly when both
+sticks are seated, and for a grader built after the picks as well as one that watched them.
+Success is the scene's own `success()` (every stick `seated()`), read when the delivery
+finishes.
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.pc_ram_assembly import PcRamAssemblyScene
+
+
+class PcRamAssemblyGrader(BaseGrader):
+ """Both sticks seated — pressed to depth, centred, upright, heading along the slot.
+
+ Ladder (per stick, each rung 1/6): grasped 1/6 · aligned 2/6 · seated 3/6;
+ one stick done 0.50 · both sticks done 1.00 — three equal rungs for the three steps of
+ each stick (take it, line it up on its slot, press it home); the last rung is a linear
+ ramp of blade depth from the slot mouth (`slot_mouth_z`) to `seat_depth`.
+ """
+
+ SCENE = PcRamAssemblyScene
+ # Equal weights: the three rungs of one stick's ladder; every stage is a k/2 fraction.
+ RUBRIC = (("grasped", 1, "once"), ("aligned", 1), ("seated", 1))
+ scene: PcRamAssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ # `grasp_held` exists only while the weld contract is live (a gripper on the stage).
+ self._has_grasp = hasattr(self.scene, "grasp_held")
+ depth = self.scene.engaged() # (n, S)
+ self._grasped = torch.zeros_like(depth, dtype=torch.bool) # per-stick latch: ever held
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every stick of that env seated
+
+ def _aligned(self):
+ """(num_envs, num_slots) bool: the scene's xy + tilt + heading seat gates, without depth."""
+ c = self.scene.cfg
+ rel = self.scene._ram_offsets_in_case() # (n, S, 3), zero at the seated poses — privileged
+ xy_ok = rel[..., 0:2].norm(dim=-1) <= c.align_xy
+ up_ok = self.scene._axis_cos(2) >= math.cos(math.radians(c.align_axis_deg))
+ yaw_ok = self.scene._axis_cos(1) >= math.cos(math.radians(c.align_yaw_deg))
+ return xy_ok & up_ok & yaw_ok
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that env's sticks --------
+ def grasped(self):
+ if self._has_grasp:
+ self._grasped |= self.scene.grasp_held[:, : self.scene.cfg.num_slots]
+ return (self._grasped | self.scene.seated()).float().mean(dim=1)
+
+ def aligned(self):
+ return self._aligned().float().mean(dim=1)
+
+ def seated(self):
+ depth = self.scene.engaged() # (n, S) blade depth below the slot mouth (m)
+ return (self._aligned() * (depth / self.scene.cfg.seat_depth).clamp(0.0, 1.0)).mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..62c9270a81
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,157 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.pc_ram.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/case/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/case/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/ram_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ -0.3400000035762787,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.550000011920929,
+ 0.0,
+ 0.02889999933540821,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ -0.36000001430511475,
+ 0.029999999329447746,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "73177cb91acf9b0e5a6b6c23bc55a1ffe4d9b4de9df6f8644d33d3e448a8b3ee"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..6449889efe
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-pc-ram-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..383151fbbf
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-pc-ram-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/pc_ram_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..af2507a117
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:183f58488268961ad2fbf3fdb4ca66713783f7b7e587d5af5479c375dd68a4e2
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..7d81820aaa
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/README.md
@@ -0,0 +1,46 @@
+# embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda-bimanual` |
+| Family / instance | `assembly.so101.bimanual_franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Assemble the SO101 arm's elbow: servo, four tab screws, forearm, eight horn screws (two Frankas, operational-space control). EmbodiedSWE's `assembly.so101.bimanual_franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+The longest scene of the benchmark: seat a loose servo in a slip-fit pocket, then pick up and drive twelve small screws one by one with a power screwdriver's magnetic bit (four M2 tab screws, eight M3 horn screws on both sides of the joint) and clip the forearm's fork onto the servo horn in between, with two arms sharing one 16-dim action under torque control (OSC).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/so101_assembly.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
+
+## Details
+
+### Review notes
+- Success predicate: the scene defines no `success()`, so EmbodiedSWE's own end predicate is its grader's
+ `check_success` (tests/grader/so101_assembly.py, unchanged): every screw fastened, the servo seated and the forearm
+ seated on the horn, on the final state. The verdict reads that grader; the tooling's `so101_success` is the same
+ predicate for the development `check`, which has no grader.
+- Budget: the slowest scene of the benchmark (two arms, 240 Hz physics, twelve screws with continuous collision
+ detection); see the measured step time in the benchmark README.
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..2d7c98bfcf
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,623 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.so101.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/distal/joint_position",
+ [
+ 1,
+ 3
+ ]
+ ],
+ [
+ "/articulation/distal/joint_velocity",
+ [
+ 1,
+ 3
+ ]
+ ],
+ [
+ "/articulation/distal/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/distal/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/drill/joint_position",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/drill/joint_velocity",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/drill/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/drill/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/proximal/joint_position",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/proximal/joint_velocity",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/proximal/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/proximal/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/motor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/motor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.0,
+ -2.700000047683716,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ 0.14000000059604645,
+ 1.0440000295639038,
+ 0.0,
+ 0.36649999022483826,
+ -0.9304199814796448,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.20000000298023224,
+ 1.0220000743865967,
+ 0.4677700102329254,
+ -0.5305600166320801,
+ 0.47275999188423157,
+ 0.5255500078201294,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -1.0,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ -0.2800000011920929,
+ 0.9940000176429749,
+ 0.3826799988746643,
+ 0.0,
+ 0.0,
+ 0.9238799810409546,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.3199999928474426,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.3199999928474426,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07999999821186066,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2199999988079071,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07999999821186066,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2199999988079071,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.4099999964237213,
+ 1.00600004196167,
+ 0.5,
+ -0.5,
+ 0.5,
+ -0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ -0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.44999998807907104,
+ -0.3400000035762787,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2199999988079071,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.3100000023841858,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "1bfae1edd3845b5447d702c2f2d53ad65ffa7e9628f63a6139a209ea372f6894"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..6ff6807f6d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..77082c7781
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,159 @@
+# Assemble the SO101 arm's elbow: servo, four tab screws, forearm, eight horn screws (two Frankas, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+The lower half of an SO101 robot arm (base + shoulder + upper arm), a bare elbow servo, four identical loose M2x6 screws, eight loose M3 horn screws, a compact power screwdriver with a magnetic bit, and the not-yet-attached distal half (forearm..gripper) all rest free on a workbench. The upper arm has four M2 screw holes over the elbow servo's pocket (joint 3): a countersunk pair in the near outer wall and the mirrored pair through the far wall. The distal half's forearm fork clips over the seated servo — its cup onto the output horn — and carries four M3 screw holes around the elbow axis on each side (near: into the horn, reached through the skin's access channels; far: into the servo's case back). Goal: seat the servo into the pocket and drive the four M2 tab screws (any tab screw fits any tab hole), then clip the forearm onto the horn and drive the M3s home (any M3 fits any horn-line hole). The screwdriver is torque-activated: it runs by itself while a screw it carries is seated in a free hole. A driven screw locks in place; the servo is fastened by the tab screws, the forearm by the horn screws.
+
+2 robots operating in the same workspace as one composite embodiment. The action vector is their actions concatenated in order ('left' dims [0:8), 'right' dims [8:16); total 16).
+[left] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+[right] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when, at the end of the graded run, all twelve screws are fastened (`env.scene.fastened >= 0`
+for every screw: the scene's `state` is 2), the servo sits in the upper arm's pocket (its pose within `cfg.motor_align_pos`
+metres and `cfg.motor_align_deg` degrees of the upper_arm link frame, `env.scene.upper_arm_pose()`) and the forearm sits
+on the horn (the lower_arm within `cfg.motor_align_pos` of `env.scene.lower_arm_seat_w()`, off the horn axis by less than
+`cfg.motor_align_deg`; any elbow angle). This scene has no `success()`: the predicate is EmbodiedSWE's grader's, and
+`rcb_embodiedswe.so101_success(env.scene)` computes it in development (`check` reports it).
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `assembly.so101.bimanual_franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 16)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+This robot is bimanual: `env.robot.articulation` is `None`. Each arm is reached through
+`env.robot.robots['left']` and `env.robot.robots['right']` (their articulations, bodies and joints), and
+`env.robot.action_slices` says which part of the action vector drives which arm.
+
+Action range. In each arm's 8-value slice, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values of each slice are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..7b3d8df0bf
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged"
+description = "EmbodiedSWE assembly.so101.bimanual_franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "assembly", "screwing", "power-tool", "bimanual", "franka", "assembly.so101.bimanual_franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda-bimanual"
+family = "assembly.so101.bimanual_franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 8.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grader/so101_assembly.py b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grader/so101_assembly.py
new file mode 100644
index 0000000000..68f57c27df
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/grader/so101_assembly.py
@@ -0,0 +1,121 @@
+"""Grader for the so101 scene: the elbow servo seated + tab-screwed into the upper arm, the forearm
+clipped onto its horn + horn-screwed.
+
+The scene defines no `success()`; the criterion below is read off its own assembly geometry
+and fastening state (see `check_success`):
+ every loose screw fastened — the four identical M2 tab screws in the four tab holes and the
+ eight identical M3 horn screws in the eight horn-line holes (the scene's own `state == 2`,
+ "fully fastened") — with the servo live in the arm pocket and the forearm live on the horn.
+
+Rubric stages (weights and modes live in RUBRIC):
+ motor_seated the bare servo sits in the upper arm's pocket: its body frame on the
+ upper_arm link frame (identical by construction when seated) within the
+ scene's fastening-gate tolerances `motor_align_pos` / `motor_align_deg`
+ — the scene's own PARTS ALIGNED rule for the tab holes
+ tab_screws_picked fraction of the four identical M2 tab screws ever carried on the drill's
+ magnetic bit (`attached`, the scene's only "grasp" of a screw; a
+ fastened screw was necessarily driven off that bit) — a milestone
+ tab_screws_fastened fraction of the four M2s welded home in a tab hole (`fastened`)
+ fork_seated the forearm's clevis sits on the servo's output horn: the lower_arm at
+ the elbow-joint seat transform of the motor, within the same
+ `motor_align_pos` / `motor_align_deg` gate, angle-agnostic about the
+ horn axis (the assembled elbow may stand at any angle) — the scene's
+ PARTS ALIGNED rule for the horn holes
+ horn_screws_picked fraction of the eight identical M3 horn screws ever carried on the bit
+ horn_screws_fastened fraction of the eight M3s welded home in a horn-line hole
+Every stage is per env. The two "picked" milestones are the grasped rung of the screws' ladder;
+the servo and the forearm have no grasp the scene can measure (no grasp contract, no lift
+threshold in cfg), so their ladders start at the seated rung. A screw's transient "in the hole,
+not yet home" state is not a rung: the auto-driver takes it from engaged to fastened by itself.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.assembly.scenes.so101_assembly import SO101AssemblyScene
+
+
+class SO101AssemblyGrader(BaseGrader):
+ """The SO101 elbow assembled: servo seated and tab-screwed into the upper arm, forearm clipped onto the horn and horn-screwed.
+
+ Ladder (14 units — one unit per part: servo 1, 4 M2 tab screws 4, forearm 1, 8 M3 horn
+ screws 8; a screw's unit split equally over its two rungs, picked 0.5 + fastened 0.5):
+ servo in pocket 1/14 = 0.071 · 4 M2 on the bit 3/14 = 0.214 · 4 M2 fastened 5/14 = 0.357 ·
+ forearm on horn 6/14 = 0.429 · 8 M3 on the bit 10/14 = 0.714 · 8 M3 fastened 14/14 = 1.000
+ The identical screws of each group share one k/N fraction stage weighted N/2 per rung.
+ """
+
+ SCENE = SO101AssemblyScene
+ # one unit per part; a screw's unit split equally over its two rungs (picked / fastened),
+ # so a group of N identical screws weighs N/2 on each rung
+ RUBRIC = (
+ ("motor_seated", 1),
+ ("tab_screws_picked", 2, "once"),
+ ("tab_screws_fastened", 2),
+ ("fork_seated", 1),
+ ("horn_screws_picked", 4, "once"),
+ ("horn_screws_fastened", 4),
+ )
+ scene: SO101AssemblyScene
+
+ def setup(self) -> None:
+ import torch
+
+ # per-screw latch: ever rode the magnetic bit (or was fastened, which requires it)
+ self._ever_on_bit = torch.zeros(self.num_envs, self.scene.cfg.num_screws,
+ dtype=torch.bool, device=self.env.device)
+
+ def check_success(self):
+ """Every loose screw fastened (the scene's `state == 2`) AND the servo live in the
+ pocket AND the forearm live on the horn — the assembled elbow, on the final state."""
+ all_fastened = (self.scene.fastened >= 0).all(dim=1)
+ return all_fastened & self._motor_seated() & self._fork_seated()
+
+ # ---- predicates (the scene's own PARTS ALIGNED gates) ------------------------------------
+ def _motor_seated(self):
+ import math
+
+ from isaaclab.utils.math import quat_error_magnitude
+
+ s, c = self.scene, self.scene.cfg
+ ap, aq = s.upper_arm_pose()
+ return (((s.motor.data.root_pos_w - ap).norm(dim=-1) < c.motor_align_pos)
+ & (quat_error_magnitude(s.motor.data.root_quat_w, aq)
+ < math.radians(c.motor_align_deg)))
+
+ def _fork_seated(self):
+ import math
+
+ s, c = self.scene, self.scene.cfg
+ lp, lq = s.lower_arm_pose()
+ seat_p, seat_q = s.lower_arm_seat_w()
+ _, off_axis = s._elbow_angle_split(lq, seat_q) # privileged: residual off the horn axis
+ return (((lp - seat_p).norm(dim=-1) < c.motor_align_pos)
+ & (off_axis < math.radians(c.motor_align_deg)))
+
+ def _picked(self, lo: int, hi: int):
+ s = self.scene
+ self._ever_on_bit |= s.attached | (s.fastened >= 0)
+ return self._ever_on_bit[:, lo:hi].float().mean(dim=1)
+
+ def _fastened(self, lo: int, hi: int):
+ return (self.scene.fastened[:, lo:hi] >= 0).float().mean(dim=1)
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] --------------------------
+ def motor_seated(self):
+ return self._motor_seated().float()
+
+ def tab_screws_picked(self):
+ return self._picked(0, self.scene.cfg.num_elbow_screws)
+
+ def tab_screws_fastened(self):
+ return self._fastened(0, self.scene.cfg.num_elbow_screws)
+
+ def fork_seated(self):
+ return self._fork_seated().float()
+
+ def horn_screws_picked(self):
+ return self._picked(self.scene.cfg.num_elbow_screws, self.scene.cfg.num_screws)
+
+ def horn_screws_fastened(self):
+ return self._fastened(self.scene.cfg.num_elbow_screws, self.scene.cfg.num_screws)
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..2d7c98bfcf
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,623 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "assembly.so101.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/distal/joint_position",
+ [
+ 1,
+ 3
+ ]
+ ],
+ [
+ "/articulation/distal/joint_velocity",
+ [
+ 1,
+ 3
+ ]
+ ],
+ [
+ "/articulation/distal/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/distal/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/drill/joint_position",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/drill/joint_velocity",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/drill/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/drill/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/proximal/joint_position",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/proximal/joint_velocity",
+ [
+ 1,
+ 2
+ ]
+ ],
+ [
+ "/articulation/proximal/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/proximal/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/horn_screw_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/motor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/motor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/screw_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/screw_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.0,
+ -2.700000047683716,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.7200000286102295,
+ 0.14000000059604645,
+ 1.0440000295639038,
+ 0.0,
+ 0.36649999022483826,
+ -0.9304199814796448,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.20000000298023224,
+ 1.0220000743865967,
+ 0.4677700102329254,
+ -0.5305600166320801,
+ 0.47275999188423157,
+ 0.5255500078201294,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.9940000176429749,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -1.0,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ -0.2800000011920929,
+ 0.9940000176429749,
+ 0.3826799988746643,
+ 0.0,
+ 0.0,
+ 0.9238799810409546,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ -0.3199999928474426,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.3199999928474426,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07999999821186066,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2199999988079071,
+ 0.23999999463558197,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07999999821186066,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2199999988079071,
+ 0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.4099999964237213,
+ 1.00600004196167,
+ 0.5,
+ -0.5,
+ 0.5,
+ -0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ -0.30000001192092896,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.44999998807907104,
+ -0.3400000035762787,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2199999988079071,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.3100000023841858,
+ 1.0140000581741333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "1bfae1edd3845b5447d702c2f2d53ad65ffa7e9628f63a6139a209ea372f6894"
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..6ff6807f6d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..7d965fba47
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-assembly-so101-bimanual-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/so101_assembly.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..3d0b035e68
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:6727eda76c1a28955d1aace2456316fc87b498767dbad3e7b677836136578cfe
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..b447b1494a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-cutting-dice-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `cutting.dice.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Dice the food with a chef knife (Franka, operational-space control). EmbodiedSWE's `cutting.dice.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Tool use: as slicing, but on a grid of scored planes in two directions, turning the knife 90 degrees for the second set, every piece staying on the board, under torque control (OSC).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/dice_food.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..f8e621563b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,373 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "cutting.dice.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/board/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/board/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_8/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_8/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5799999833106995,
+ 0.8579999804496765,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8700000047683716,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2736485004425049,
+ 0.923056960105896,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.02114235609769821,
+ -0.02156459353864193,
+ 0.9040476083755493,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.025944489985704422,
+ 0.002757108537480235,
+ 0.9091457724571228,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.017994791269302368,
+ 0.0256203506141901,
+ 0.9054352045059204,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.0016107341507449746,
+ -0.027542568743228912,
+ 0.9108569622039795,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.000662905047647655,
+ 0.005087577272206545,
+ 0.9319012761116028,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.00015908165369182825,
+ 0.027681469917297363,
+ 0.9033148884773254,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.020952876657247543,
+ -0.021006044000387192,
+ 0.9047247171401978,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.025551119819283485,
+ 0.0026869180146604776,
+ 0.9067657589912415,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.01442672312259674,
+ 0.025718392804265022,
+ 0.9023453593254089,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a92b77cdf142e1bdfdebceebc842c260e216579cc1786d010d97b5b9b4639dd3"
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..6f70d12a5e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-cutting-dice-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..6a24e9f02b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Dice the food with a chef knife (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A tomato lies on a chopping board on a kitchen island; a chef knife lies on a knife rest beside the board. The tomato is scored on a grid: 2 planes across and 2 along it. Goal: pick up the knife and press its edge down through each scored plane (blade aligned with the plane — turn the blade 90 deg for the second set) to dice the tomato. It is diced once every plane has been pressed through and the pieces separate, all of them staying on the board.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when, at the end of the graded run, `env.scene.pieces_count()` (connected pieces) has reached
+the number of pieces the scored planes make and every piece still lies on the chopping board (its centre inside
+the board's footprint, above its top).
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `cutting.dice.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..40311d88dc
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-cutting-dice-franka-osc-i00-privileged"
+description = "EmbodiedSWE cutting.dice.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "cutting", "tool-use", "franka", "cutting.dice.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "cutting.dice.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grader/dice_food.py b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grader/dice_food.py
new file mode 100644
index 0000000000..641a8a7167
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/grader/dice_food.py
@@ -0,0 +1,71 @@
+"""Grader for the dice scene: the food diced into its target number of pieces, all still on the board.
+
+Rubric stages (weights and modes live in RUBRIC):
+ knife_taken the knife has been lifted off its rest — its root raised by the rest's rail
+ height (`cfg.rest_rail_h`), the lift that frees the plate from the notches; a
+ milestone, credit kept after the knife is put down
+ pairs_cut fraction of the grid's weld PAIRS released (`scene.pair_cut`, the dice gate's
+ own truth). The x-planes and y-planes are identical sub-goals — one stage, one
+ fraction, each pair worth the same
+ diced the scene's own done test: connected components of the live weld graph reach
+ the target piece count AND every piece is still on the board (footprint from
+ `cfg.board_size`, resting above the board top). "On the board" is a GATE on
+ this stage, not a stage of its own — it is true at reset and only means
+ anything once the food is diced
+Success = `diced` read on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.cutting.scenes.dice_food import DiceFoodScene
+
+
+class DiceFoodGrader(BaseGrader):
+ """Food diced into the target number of pieces, every piece still on the board.
+
+ Ladder: knife taken 1/14 (0.071) · each weld pair released +1/14 (12 pairs -> 13/14 =
+ 0.929) · diced with every piece on the board 1.00
+ """
+
+ SCENE = DiceFoodScene
+ # One weight unit per step of the task: taking the knife (1), releasing each of the 3 x 3
+ # grid's 12 weld pairs (12 identical sub-goals -> one fraction stage carrying 12 units, so
+ # a single cut is worth exactly as much as the pick), and the final done gate (1).
+ RUBRIC = (("knife_taken", 1, "once"), ("pairs_cut", 12), ("diced", 1))
+ scene: DiceFoodScene
+
+ def setup(self) -> None:
+ self._knife_z0 = self.scene.knife.data.root_pos_w[:, 2].clone() # resting in the notches
+
+ def check_success(self):
+ return self._diced()
+
+ def _target_pieces(self) -> int:
+ return self.scene.cfg.target_pieces or len(self.scene.pieces)
+
+ def _on_board(self):
+ """(num_envs,) bool: every piece's origin inside the board footprint and above its top."""
+ import torch
+
+ s = self.scene
+ hx, hy = s.cfg.board_size[0] / 2, s.cfg.board_size[1] / 2
+ ok = torch.ones(s.env.num_envs, dtype=torch.bool, device=s.env.device)
+ for pc in s.pieces:
+ rel = pc.data.root_pos_w - s.env_origins
+ ok &= (rel[:, 0].abs() < hx) & (rel[:, 1].abs() < hy) & (rel[:, 2] > s._board_top)
+ return ok
+
+ def _diced(self):
+ return (self.scene.pieces_count() >= self._target_pieces()) & self._on_board()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] -----------------------
+ def knife_taken(self):
+ z = self.scene.knife.data.root_pos_w[:, 2]
+ return (z > self._knife_z0 + self.scene.cfg.rest_rail_h).float()
+
+ def pairs_cut(self):
+ return self.scene.pair_cut.float().mean(dim=1)
+
+ def diced(self):
+ return self._diced().float()
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..f8e621563b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,373 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "cutting.dice.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/board/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/board/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_8/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_8/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5799999833106995,
+ 0.8579999804496765,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8700000047683716,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2736485004425049,
+ 0.923056960105896,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.02114235609769821,
+ -0.02156459353864193,
+ 0.9040476083755493,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.025944489985704422,
+ 0.002757108537480235,
+ 0.9091457724571228,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.017994791269302368,
+ 0.0256203506141901,
+ 0.9054352045059204,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.0016107341507449746,
+ -0.027542568743228912,
+ 0.9108569622039795,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.000662905047647655,
+ 0.005087577272206545,
+ 0.9319012761116028,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.00015908165369182825,
+ 0.027681469917297363,
+ 0.9033148884773254,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.020952876657247543,
+ -0.021006044000387192,
+ 0.9047247171401978,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.025551119819283485,
+ 0.0026869180146604776,
+ 0.9067657589912415,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.01442672312259674,
+ 0.025718392804265022,
+ 0.9023453593254089,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a92b77cdf142e1bdfdebceebc842c260e216579cc1786d010d97b5b9b4639dd3"
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..6f70d12a5e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-cutting-dice-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..1f7d23ede7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-dice-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/dice_food.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..c9a53a332e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:187ba05db7f0ab4a3bfa202da505f0ea9571c07424cde938996209eaf75eb311
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..9223366a67
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-cutting-slice-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `cutting.slice.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Slice the food with a chef knife (Franka, operational-space control). EmbodiedSWE's `cutting.slice.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Tool use: lift a chef knife off its rest and press its edge down through every scored plane of the food, blade aligned with the plane, so the slices separate and all stay on the board, under torque control (OSC).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/slice_food.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..53ffa8687f
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,346 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "cutting.slice.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/board/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/board/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5799999833106995,
+ 0.8579999804496765,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8700000047683716,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2736485004425049,
+ 0.923056960105896,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07558400928974152,
+ 0.0005210351082496345,
+ 0.8981127738952637,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.04757993668317795,
+ -0.00012431092909537256,
+ 0.9008064270019531,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.024032164365053177,
+ -0.0008916323422454298,
+ 0.9019894599914551,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.00013416247384157032,
+ -0.0006178170442581177,
+ 0.9014658331871033,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.025195427238941193,
+ 0.0004911758005619049,
+ 0.9012535810470581,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.049077294766902924,
+ 0.0007258327677845955,
+ 0.90040522813797,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07350704818964005,
+ 0.0008993648225441575,
+ 0.8991332054138184,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.09790591895580292,
+ -0.0010726850014179945,
+ 0.898447573184967,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "f7ef5fb015317427134974ddcdd09c40b5b379fcfcfd0ec2b1e30c92c27393a8"
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..7a2c2520ea
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-cutting-slice-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..633d491b13
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Slice the food with a chef knife (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A carrot lies on a chopping board on a kitchen island; a chef knife lies on a knife rest beside the board. The carrot is scored at 7 transverse planes. Goal: pick up the knife and press its edge down through each scored plane (blade aligned with the plane) to cut the carrot into slices. The carrot is cut once every plane has been pressed through and the pieces separate, all of them staying on the board.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when, at the end of the graded run, `env.scene.pieces_count()` (connected pieces) has reached
+the number of pieces the scored planes make and every piece still lies on the chopping board (its centre inside
+the board's footprint, above its top).
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `cutting.slice.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..515aa3676a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-cutting-slice-franka-osc-i00-privileged"
+description = "EmbodiedSWE cutting.slice.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "cutting", "tool-use", "franka", "cutting.slice.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "cutting.slice.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grader/slice_food.py b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grader/slice_food.py
new file mode 100644
index 0000000000..413bcf4f1a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/grader/slice_food.py
@@ -0,0 +1,91 @@
+"""Grader for the slice scene: the food cut into its target number of pieces, all still on the board.
+
+Rubric stages (weights and modes live in RUBRIC):
+ knife_taken the knife has been lifted clear of its rest — its root raised by at least
+ cfg.rest_rail_h (the rails' height) above where it lay at the graded reset, so
+ the edge is above the rail tops and the notches no longer hold it; a milestone
+ ("once"), credit kept after the knife is set down again
+ planes_cut fraction of the cuts the target needs that have been made — released planes
+ over (target - 1), a linear ramp from the welded food (0) to the target piece
+ count (1), target = cfg.target_pieces or every piece. The scored planes are
+ identical sub-goals: one stage, one fraction, each plane worth the same
+ sliced the scene's own done test: piece count (connected components of the live weld
+ chain, `pieces_count()`) reaches the target AND every piece is still on the
+ chopping board — inside the board's footprint (cfg.board_size) and above its
+ top. "On the board" is a GATE on this stage, not a stage of its own: it is
+ true at reset and only means anything once the food is cut
+Success = `sliced` read when the delivery finishes.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.cutting.scenes.slice_food import SliceFoodScene
+
+
+class SliceFoodGrader(BaseGrader):
+ """Food sliced into the target number of pieces, every piece still on the board.
+
+ Ladder (7 scored planes — the carrot / banana assets — target = all pieces): knife taken
+ 1/9 (0.111) · each plane cut +1/9 (7 planes -> 8/9 = 0.889) · sliced with every piece on
+ the board 1.00.
+ """
+
+ SCENE = SliceFoodScene
+ # One weight unit per step of the task: taking the knife (1), releasing each scored plane
+ # (7 identical sub-goals -> one fraction stage carrying 7 units, so a single cut is worth
+ # exactly as much as the pick), and the final done gate (1). The class default is the 7
+ # planes of the carrot / banana assets; __init__ re-derives the unit count from the
+ # graded scene's own target so the rule holds for any food or `target_pieces`.
+ RUBRIC = (("knife_taken", 1, "once"), ("planes_cut", 7), ("sliced", 1))
+ scene: SliceFoodScene
+
+ def __init__(self, env) -> None:
+ if isinstance(env.scene, self.SCENE): # else leave the default; BaseGrader raises
+ cuts = self._cuts_needed(env.scene)
+ self.RUBRIC = (("knife_taken", 1, "once"), ("planes_cut", cuts), ("sliced", 1))
+ super().__init__(env)
+
+ @staticmethod
+ def _cuts_needed(scene: SliceFoodScene) -> int:
+ target = scene.cfg.target_pieces or len(scene.pieces)
+ if target <= 1:
+ raise ValueError(f"target_pieces={target} needs no cut — the planes ramp "
+ "(target - 1 cuts) is undefined")
+ return target - 1
+
+ def setup(self) -> None:
+ self._knife_z0 = self.scene.knife.data.root_pos_w[:, 2].clone() # resting on the rails
+ self._target = self._cuts_needed(self.scene) + 1
+
+ def check_success(self):
+ return self._sliced()
+
+ def _on_board(self):
+ """(num_envs,) bool: every piece's root inside the board's footprint and above its top.
+ The kinematic board is centred on the env origin (assets(): pos (0, 0)), so its
+ half-extents are the test; a piece whose centre leaves the footprint tips off."""
+ import torch
+
+ s = self.scene
+ hx, hy = s.cfg.board_size[0] / 2, s.cfg.board_size[1] / 2
+ ok = torch.ones(s.env.num_envs, dtype=torch.bool, device=s.env.device)
+ for pc in s.pieces:
+ rel = pc.data.root_pos_w - s.env_origins
+ ok &= (rel[:, 0].abs() < hx) & (rel[:, 1].abs() < hy) & (rel[:, 2] > s._board_top)
+ return ok
+
+ def _sliced(self):
+ return (self.scene.pieces_count() >= self._target) & self._on_board()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def knife_taken(self):
+ rise = self.scene.knife.data.root_pos_w[:, 2] - self._knife_z0
+ return (rise >= self.scene.cfg.rest_rail_h).float()
+
+ def planes_cut(self):
+ made = (self.scene.pieces_count() - 1).float()
+ return (made / (self._target - 1)).clamp(0.0, 1.0)
+
+ def sliced(self):
+ return self._sliced().float()
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..53ffa8687f
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,346 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.004166666666666667,
+ "preset": "cutting.slice.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/board/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/board/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_4/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_5/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_6/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/piece_7/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5799999833106995,
+ 0.8579999804496765,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8700000047683716,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ -0.2736485004425049,
+ 0.923056960105896,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.36312851309776306,
+ 0.6067435145378113,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07558400928974152,
+ 0.0005210351082496345,
+ 0.8981127738952637,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.04757993668317795,
+ -0.00012431092909537256,
+ 0.9008064270019531,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.024032164365053177,
+ -0.0008916323422454298,
+ 0.9019894599914551,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.00013416247384157032,
+ -0.0006178170442581177,
+ 0.9014658331871033,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.025195427238941193,
+ 0.0004911758005619049,
+ 0.9012535810470581,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.049077294766902924,
+ 0.0007258327677845955,
+ 0.90040522813797,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.07350704818964005,
+ 0.0008993648225441575,
+ 0.8991332054138184,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.09790591895580292,
+ -0.0010726850014179945,
+ 0.898447573184967,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "f7ef5fb015317427134974ddcdd09c40b5b379fcfcfd0ec2b1e30c92c27393a8"
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..7a2c2520ea
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-cutting-slice-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..0e2fc28a29
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-cutting-slice-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/slice_food.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..7b68a83ec2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:f38415406fe5a7b4ce6c15dc289b308b582cf911c9ff7a9081dd33052ef60b7e
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..7581120887
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `locomanip.box_to_bin.g1.loco_pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Carry the box from the shelf to the bin (Unitree G1, walking, Pink IK). EmbodiedSWE's `locomanip.box_to_bin.g1.loco_pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Loco-manipulation: the G1 walks under a frozen locomotion policy (base velocity commands), takes a box off a shelf, carries it along a turning route to a shallow bin on a table and leaves it resting inside.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/box_to_bin.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..13b13f5a00
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,171 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.02,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.005,
+ "preset": "locomanip.box_to_bin.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/box/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/box/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.578499972820282,
+ 0.8659999966621399,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a38b928986833f46c985abcf31096890c26110ad1eddeb380479ed83f4e9fdc0"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..ec1da9d940
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..f82623146f
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Carry the box from the shelf to the bin (Unitree G1, walking, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A steel shelving unit stands with its face 0.46 m ahead of the start pose, boards at 0.41, 0.76 and 1.49 m. On the middle board sits a brown cardboard box, 20 cm on a side and about 0.1 kg, its center 0.86 m up, nearly flush with the shelf's front edge and with 0.69 m of clear air above it. To the right, about 1.4 m away, a low table (top 0.53 m) carries an open blue sorting bin: interior about 48 x 72 cm around (1.81, -0.24), floor at 0.53 m, walls just 0.05 m tall — a shallow tray the box drops into, not a deep basket.
+Goal: pick the box up off the shelf, carry it to the table, and leave it resting inside the bin. The task is complete once the box sits fully inside the bin's walls, released and come to rest — not still held, not straddling the rim.
+The bin is further away than any arm reaches, so the box can only get there if the robot itself does — and the table stands off the shelf's axis, so the route turns.
+
+A Unitree G1 humanoid with three-finger hands, standing on its own two legs and free to walk. Control mode 'loco_pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. The last 4 action dims are a BASE COMMAND for the 12 leg joints — [vx, vy, wz, hip_height]: forward and sideways speed in m/s and turn rate in rad/s, all in the robot's own frame, plus the standing height of the pelvis in m. A frozen locomotion policy turns that command into leg motion and keeps the robot balanced, so you steer the robot rather than stepping it; all-zero velocity with a sensible hip height (about 0.72) is a stationary balanced stand, which is what you want while the arms work. Wrist poses are absolute and in the env frame, so while the robot walks you must re-issue them every step to keep the hands where you want them. Action dim 32.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `locomanip.box_to_bin.g1.loco_pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 32)` tensor; one step is 0.02 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK, the hand joint targets are bounded by the joint limits, and robobench clips the 4 base-command values
+to its locomotion policy's command range (vx [-0.6, 0.6] m/s, vy [-0.4, 0.4] m/s, wz [-0.6, 0.6] rad/s,
+hip height [0.50, 0.80] m).
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..80656de8d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged"
+description = "EmbodiedSWE locomanip.box_to_bin.g1.loco_pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "loco-manipulation", "humanoid", "unitree-g1", "walking", "locomanip.box_to_bin.g1.loco_pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "locomanip.box_to_bin.g1.loco_pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grader/box_to_bin.py b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grader/box_to_bin.py
new file mode 100644
index 0000000000..cb7b2e0a85
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/grader/box_to_bin.py
@@ -0,0 +1,52 @@
+"""Grader for the box-to-bin scene: the box taken off the shelf, walked around the corner, and left in the bin.
+
+Rubric stages (weights and modes live in RUBRIC) — the scene's own chain lifted -> transited ->
+placed, one rung each:
+ picked the scene's `lifted` latch: the box got clear of its shelf board, either raised
+ `cfg.lift_h` above its resting height or seen held up in the apron in front of the
+ shelf face (both pick styles the open shelving affords); a milestone
+ carried the scene's own `carried_fraction()` — the fraction of the start-to-bin xy distance
+ the box has closed, a linear ramp — reading 1 once the scene's `transited` latch has
+ fired (its own "the transit is done" mark, which `success()` requires); a milestone,
+ so a box that arrives and is released keeps the credit
+ in_bin the scene's own `placed()` — fully inside the bin's inset interior bands, below the
+ rim-excluding height cap, and settled; live, so it dips if the box leaves the bin
+Success is the scene's own `success()` — `lifted & transited & placed()` — read on the final
+state; the three rungs are exactly its three conjuncts, so progress reads 1.0 iff it holds.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.locomanip.scenes.box_to_bin import BoxToBinScene
+
+
+class BoxToBinGrader(BaseGrader):
+ """The cardboard box picked off the shelf, carried around the corner, and resting inside the sorting bin.
+
+ Ladder: picked 0.333 · carried 0.667 (linear in the distance closed) · in bin 1.00
+ """
+
+ SCENE = BoxToBinScene
+ RUBRIC = (("picked", 1, "once"), ("carried", 1, "once"), ("in_bin", 1))
+ scene: BoxToBinScene
+
+ def setup(self) -> None:
+ pass # every reference is the scene's own (latches, cfg bands); nothing to capture
+
+ def check_success(self):
+ return self.scene.success()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] -----------------------
+ def picked(self):
+ return self.scene._lifted.float()
+
+ def carried(self):
+ import torch
+
+ s = self.scene
+ return torch.where(s._transited, torch.ones_like(s._transited, dtype=torch.float32),
+ s.carried_fraction().clamp(0.0, 1.0))
+
+ def in_bin(self):
+ return self.scene.placed().float()
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..13b13f5a00
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,171 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.02,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.005,
+ "preset": "locomanip.box_to_bin.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/box/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/box/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.578499972820282,
+ 0.8659999966621399,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a38b928986833f46c985abcf31096890c26110ad1eddeb380479ed83f4e9fdc0"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..ec1da9d940
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..fbadeb4803
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-box-to-bin-g1-loco-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/box_to_bin.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..b7130822dc
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:e12c41a84dd24572b9e27121067bfedc32c6df4c108db99dd2675888f3f37da6
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..fb03cbee9b
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/README.md
@@ -0,0 +1,45 @@
+# embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `locomanip.fruit_delivery.g1.loco_pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository. A scripted reference solve() exists outside the repository (internal only, used to check the task is solvable through the grading path); it is not shipped. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Deliver the fruit to the plate (Unitree G1, walking, Pink IK). EmbodiedSWE's `locomanip.fruit_delivery.g1.loco_pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Loco-manipulation: the G1 walks under a frozen locomotion policy (base velocity commands) while its arms and hands pick fruit and carry it to a plate elsewhere in the room.
+
+## Reference solution
+None in the repository (`oracle = "none"`). A scripted reference `solve()` is kept outside the repository (internal only).
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/fruit_delivery.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
+
+## Details
+
+### Review notes
+- Contact artifact (reported, not changed): at a high grip closure (1.3 on the hand's closure scale) the middle
+ fingertip of the G1's right hand stays attached to the lemon after the fingers open, and the lemon rises with the
+ hand (3 of 3 trials; 0 of 4 at closure 0.9). It looks like a penetration artifact of the contact model. It makes
+ the release harder than it is physically, and a solution could use it as glue while carrying.
+ Observed with CPU PhysX; not re-checked with GPU PhysX.
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..3e85efe220
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,387 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "locomanip.fruit_delivery.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/redonion/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/redonion/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/storage_box/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/storage_box/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/wooden_spoons/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/wooden_spoons/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.8500000238418579,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.22302860021591187,
+ -0.3694996237754822,
+ 0.7020000219345093,
+ 0.5125339031219482,
+ 0.0,
+ 0.0,
+ 0.8586669564247131,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.31277498602867126,
+ 0.281345009803772,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.18000000715255737,
+ -0.11999999731779099,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.33000001311302185,
+ 0.7020000219345093,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ -0.14000000059604645,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.41999998688697815,
+ 0.05000000074505806,
+ 0.7020000219345093,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ -0.4300000071525574,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5600000023841858,
+ -0.07999999821186066,
+ 0.7319999933242798,
+ 0.9848077297210693,
+ 0.0,
+ 0.0,
+ 0.1736481785774231,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4399999976158142,
+ -0.41999998688697815,
+ 0.7020000219345093,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "41faf1196e45d0b2cb30c701041bd3e300dc4e113cc29b9ce4ecb4bbb1b24b99"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..657a0245ff
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..e19f679121
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,149 @@
+# Deliver the fruit to the plate (Unitree G1, walking, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A wooden kitchen table holds a mix of items on the side nearest you: fruit — a lemon — scattered among things that are not fruit: a pumpkin, a small pumpkin, a red onion, a serving bowl, a storage box, a pair of wooden spoons, and a spatula. A large round clay plate (about 30 cm across, a shallow dish) stands on the FAR side of the same table, well beyond arm's reach from where the items lie.
+Goal: pick up every FRUIT and place it on the plate, leaving everything else where it is. You cannot reach the plate from the near side — carry each fruit around the table and place it from the far side. Note that not all produce is fruit: the pumpkins and the onion belong on the table, not the plate. A fruit counts only when it is resting on the plate; the job is done when every fruit is on the plate and nothing else has been put on it.
+
+A Unitree G1 humanoid with three-finger hands, standing on its own two legs and free to walk. Control mode 'loco_pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. The last 4 action dims are a BASE COMMAND for the 12 leg joints — [vx, vy, wz, hip_height]: forward and sideways speed in m/s and turn rate in rad/s, all in the robot's own frame, plus the standing height of the pelvis in m. A frozen locomotion policy turns that command into leg motion and keeps the robot balanced, so you steer the robot rather than stepping it; all-zero velocity with a sensible hip height (about 0.72) is a stationary balanced stand, which is what you want while the arms work. Wrist poses are absolute and in the env frame, so while the robot walks you must re-issue them every step to keep the hands where you want them. Action dim 32.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `locomanip.fruit_delivery.g1.loco_pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 32)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK, the hand joint targets are bounded by the joint limits, and robobench clips the 4 base-command values
+to its locomotion policy's command range (vx [-0.6, 0.6] m/s, vy [-0.4, 0.4] m/s, wz [-0.6, 0.6] rad/s,
+hip height [0.50, 0.80] m).
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..f1525135e2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged"
+description = "EmbodiedSWE locomanip.fruit_delivery.g1.loco_pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "loco-manipulation", "humanoid", "unitree-g1", "walking", "locomanip.fruit_delivery.g1.loco_pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "locomanip.fruit_delivery.g1.loco_pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository. A scripted reference solve() exists outside the repository (internal only, used to check the task is solvable through the grading path); it is not shipped."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grader/fruit_delivery.py b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grader/fruit_delivery.py
new file mode 100644
index 0000000000..bcc065e5e7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/grader/fruit_delivery.py
@@ -0,0 +1,86 @@
+"""Grader for the fruit delivery scene: every fruit carried around the table and set on the far plate.
+
+Rubric stages (weights and modes live in RUBRIC), each a fraction over the fruits PRESENT this
+episode (the scene's `present` mask; identical fruits share one stage):
+ lifted fraction of fruits ever raised clear of the table — the fruit's origin (the produce
+ assets sit with their origin at the base, on `cfg.surface_z`) above the plate's rim
+ height (`cfg.plate_rim_z`), the height every fruit must clear to enter the dish; a
+ milestone, credit kept after the fruit is set down
+ carried mean transit progress: for each fruit, a linear ramp of its radial xy distance from
+ the plate's counted centre (the scene's own body-frame measure, see `_on_plate`) from
+ where it lay at the graded reset (0) to the counted footprint edge
+ `cfg.radius_frac * cfg.plate_radius` (1); a milestone, so a fruit that arrives and is
+ released keeps the credit
+ placed the scene's own `fruits_placed()` — on the plate AND settled — as a fraction of the
+ present fruits, GATED by the scene's `nonfruits_on_plate()` being empty: a pumpkin or
+ onion on the plate fails the task, so it zeroes the done stage rather than being a
+ weighted stage of its own (it is trivially "true" at reset)
+Success is the scene's own `success()`: every present fruit placed and nothing that is not a fruit
+on the plate, read on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.locomanip.scenes.fruit_delivery import FruitDeliveryScene
+
+
+class FruitDeliveryGrader(BaseGrader):
+ """Every fruit carried around the table and resting on the far-side plate, nothing else put on it.
+
+ Ladder (one fruit): lifted 0.333 · carried 0.667 · placed 1.00
+ With N fruits every rung is the fraction over the N present fruits, so k fruits fully
+ delivered score k/N.
+ """
+
+ SCENE = FruitDeliveryScene
+ RUBRIC = (("lifted", 1, "once"), ("carried", 1, "once"), ("placed", 1))
+ scene: FruitDeliveryScene
+
+ def setup(self) -> None:
+ s = self.scene
+ # each fruit's radial distance from the plate's counted centre at the graded reset —
+ # the start of its transit ramp
+ self._r0 = self._radial()[:, s._fruit_idx].clone() # (num_envs, n_fruits)
+
+ def check_success(self):
+ return self.scene.success()
+
+ def _radial(self):
+ """(num_envs, n_items) radial xy distance of every item from the plate's GEOMETRIC centre,
+ in the plate's body frame — the same measure the scene's `_on_plate` footprint test uses."""
+ import torch
+ from isaaclab.utils.math import quat_apply_inverse
+
+ s = self.scene
+ pp, pq = s.plate.data.root_pos_w, s.plate.data.root_quat_w
+ cols = []
+ for name in s.names:
+ loc = quat_apply_inverse(pq, s.items[name].data.root_pos_w - pp)
+ cols.append((loc[:, :2] - s._plate_center).norm(dim=-1))
+ return torch.stack(cols, dim=1)
+
+ def _frac_present(self, per_fruit):
+ """Mean of a per-fruit (num_envs, n_fruits) value over the fruits present in each env."""
+ pres = self.scene.fruits_present()
+ return (per_fruit.float() * pres).sum(dim=1) / pres.sum(dim=1).clamp(min=1).float()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] -----------------------
+ def lifted(self):
+ import torch
+
+ s = self.scene
+ z = torch.stack([s.items[n].data.root_pos_w[:, 2] for n in s.names], dim=1)[:, s._fruit_idx]
+ z = z - s.env_origins[:, 2:3]
+ return self._frac_present(z > s.cfg.surface_z + s.cfg.plate_rim_z)
+
+ def carried(self):
+ s = self.scene
+ r = self._radial()[:, s._fruit_idx]
+ span = (self._r0 - s._plate_r).clamp(min=1e-6) # start -> counted footprint edge
+ return self._frac_present(((self._r0 - r) / span).clamp(0.0, 1.0))
+
+ def placed(self):
+ s = self.scene
+ clean = ~s.nonfruits_on_plate().any(dim=1)
+ return self._frac_present(s.fruits_placed()) * clean.float()
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..3e85efe220
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,387 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "locomanip.fruit_delivery.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/redonion/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/redonion/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/storage_box/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/storage_box/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/wooden_spoons/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/wooden_spoons/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.8500000238418579,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.22302860021591187,
+ -0.3694996237754822,
+ 0.7020000219345093,
+ 0.5125339031219482,
+ 0.0,
+ 0.0,
+ 0.8586669564247131,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.31277498602867126,
+ 0.281345009803772,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.18000000715255737,
+ -0.11999999731779099,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25999999046325684,
+ -0.33000001311302185,
+ 0.7020000219345093,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15000000596046448,
+ -0.14000000059604645,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.41999998688697815,
+ 0.05000000074505806,
+ 0.7020000219345093,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.41999998688697815,
+ -0.4300000071525574,
+ 0.7319999933242798,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5600000023841858,
+ -0.07999999821186066,
+ 0.7319999933242798,
+ 0.9848077297210693,
+ 0.0,
+ 0.0,
+ 0.1736481785774231,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4399999976158142,
+ -0.41999998688697815,
+ 0.7020000219345093,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "41faf1196e45d0b2cb30c701041bd3e300dc4e113cc29b9ce4ecb4bbb1b24b99"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..657a0245ff
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..2907149009
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-fruit-delivery-g1-loco-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/fruit_delivery.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..4917842e1c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:d01ce3f610cc85623bddbbbf1062376fad154593955192be3aff3175bc3d7365
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..50690d0536
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `locomanip.wheel_carry.g1.loco_pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Carry the wheel to the basket (Unitree G1, walking, Pink IK). EmbodiedSWE's `locomanip.wheel_carry.g1.loco_pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Loco-manipulation: the G1 walks under a frozen locomotion policy (base velocity commands), lifts a steering wheel off a table, carries it 3 m to a second table and leaves it resting in a basket.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/wheel_carry.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..68ba3326b7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,171 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.02,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.005,
+ "preset": "locomanip.wheel_carry.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/wheel/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/wheel/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.3499999940395355,
+ 0.44999998807907104,
+ 0.6995999813079834,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "0d45f57179e09fee4fda231b164ce2750766876d37512bb963662db1dfa3e062"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..ac6e291ec2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..095293a7fe
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Carry the wheel to the basket (Unitree G1, walking, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+Two heavy-duty packing tables stand 3.0 m apart, their tops 0.69 m off the floor. On the near table a car steering wheel about 29 cm across lies flat, hub up. The far table carries an open plastic basket, its rim 0.78 m up and its interior about 70 x 46 cm — roomy enough to take the wheel lying flat. Nothing stands between the two tables but open floor.
+Goal: pick the steering wheel up off the near table, carry it to the far table, and put it in the basket. The task is complete once the wheel is resting inside the basket, released and come to rest — not still held, not balanced on the rim.
+The two tables are further apart than any arm reaches, so the wheel can only get there if the robot itself does.
+
+A Unitree G1 humanoid with three-finger hands, standing on its own two legs and free to walk. Control mode 'loco_pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. The last 4 action dims are a BASE COMMAND for the 12 leg joints — [vx, vy, wz, hip_height]: forward and sideways speed in m/s and turn rate in rad/s, all in the robot's own frame, plus the standing height of the pelvis in m. A frozen locomotion policy turns that command into leg motion and keeps the robot balanced, so you steer the robot rather than stepping it; all-zero velocity with a sensible hip height (about 0.72) is a stationary balanced stand, which is what you want while the arms work. Wrist poses are absolute and in the env frame, so while the robot walks you must re-issue them every step to keep the hands where you want them. Action dim 32.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `locomanip.wheel_carry.g1.loco_pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 32)` tensor; one step is 0.02 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK, the hand joint targets are bounded by the joint limits, and robobench clips the 4 base-command values
+to its locomotion policy's command range (vx [-0.6, 0.6] m/s, vy [-0.4, 0.4] m/s, wz [-0.6, 0.6] rad/s,
+hip height [0.50, 0.80] m).
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..437f80927e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged"
+description = "EmbodiedSWE locomanip.wheel_carry.g1.loco_pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "loco-manipulation", "humanoid", "unitree-g1", "walking", "locomanip.wheel_carry.g1.loco_pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "locomanip.wheel_carry.g1.loco_pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grader/wheel_carry.py b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grader/wheel_carry.py
new file mode 100644
index 0000000000..54eca93343
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/grader/wheel_carry.py
@@ -0,0 +1,52 @@
+"""Grader for the wheel carry scene: the wheel picked up here, walked over there, and left in the basket.
+
+Rubric stages (weights and modes live in RUBRIC) — the scene's own chain lifted -> transited ->
+placed, one rung each:
+ picked the scene's `lifted` latch: the wheel's origin raised `cfg.lift_h` above the pick
+ table top; a milestone, credit kept after it is put down
+ carried the scene's own `carried_fraction()` — the fraction of `cfg.carry_dx` the wheel
+ has travelled along +x from the pick station, a linear ramp — reading 1 once the
+ scene's `transited` latch has fired (its own "the transit is done" mark, which
+ `success()` requires); a milestone, so a wheel that arrives and is released keeps
+ the credit
+ in_basket the scene's own `placed()` — inside the basket's target bands, below the height
+ cap, and settled; live, so it dips if the wheel leaves the basket
+Success is the scene's own `success()` — `lifted & transited & placed()` — read on the final
+state; the three rungs are exactly its three conjuncts, so progress reads 1.0 iff it holds.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.locomanip.scenes.wheel_carry import WheelCarryScene
+
+
+class WheelCarryGrader(BaseGrader):
+ """The steering wheel lifted off the near table, carried across, and resting inside the far basket.
+
+ Ladder: picked 0.333 · carried 0.667 (linear in the distance closed) · in basket 1.00
+ """
+
+ SCENE = WheelCarryScene
+ RUBRIC = (("picked", 1, "once"), ("carried", 1, "once"), ("in_basket", 1))
+ scene: WheelCarryScene
+
+ def setup(self) -> None:
+ pass # every reference is the scene's own (latches, cfg bands); nothing to capture
+
+ def check_success(self):
+ return self.scene.success()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] -----------------------
+ def picked(self):
+ return self.scene._lifted.float()
+
+ def carried(self):
+ import torch
+
+ s = self.scene
+ return torch.where(s._transited, torch.ones_like(s._transited, dtype=torch.float32),
+ s.carried_fraction().clamp(0.0, 1.0))
+
+ def in_basket(self):
+ return self.scene.placed().float()
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..68ba3326b7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,171 @@
+{
+ "action_dim": 32,
+ "control_dt": 0.02,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.005,
+ "preset": "locomanip.wheel_carry.g1.loco_pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/wheel/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/wheel/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.3499999940395355,
+ 0.44999998807907104,
+ 0.6995999813079834,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "0d45f57179e09fee4fda231b164ce2750766876d37512bb963662db1dfa3e062"
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..ac6e291ec2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..64bdcdbd5c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-locomanip-wheel-carry-g1-loco-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/wheel_carry.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..196523fa5e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:0db07c6c08424aa6dad693e315a9f60f73b61a5da72e1198ab1eb1c1072213ae
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..b2a95402d4
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `packing.clear_organic_objects.g1.pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Sort the front-row items into the crate and onto the tray (Unitree G1, fixed pelvis, Pink IK). EmbodiedSWE's `packing.clear_organic_objects.g1.pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Sorting pick-and-place with three-finger hands on a crowded table: four small items are picked from the front row and placed in two different containers while the rest of the table stays undisturbed.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/clear_organic_objects.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..2c14fb0b5a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,630 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.clear_organic_objects.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bin/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bin/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/crabbypenholder/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/crabbypenholder/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_a/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_a/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_b/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_b/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime01_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime01_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime_a/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime_a/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime_b/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime_b/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/milkjug_a01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/milkjug_a01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/orange_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/orange_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/orange_02/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/orange_02/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pomegranate01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pomegranate01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/utilityjug_a03/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/utilityjug_a03/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/whitepackerbottle_a01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/whitepackerbottle_a01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.44999998807907104,
+ -1.0499999523162842,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.1599999964237213,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8999999761581421,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.1599999964237213,
+ 0.7799999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0965246856212616,
+ 0.021515723317861557,
+ 0.7820000052452087,
+ 0.9659258127212524,
+ 0.0,
+ 0.0,
+ 0.258819043636322,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15821443498134613,
+ -0.28615131974220276,
+ 0.7820000052452087,
+ 0.8910065293312073,
+ 0.0,
+ 0.0,
+ 0.45399051904678345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.056563347578048706,
+ -0.25133171677589417,
+ 0.7820000052452087,
+ 0.7771459817886353,
+ 0.0,
+ 0.0,
+ 0.6293204426765442,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5487885475158691,
+ -0.19979985058307648,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.10576660931110382,
+ 0.10328016430139542,
+ 0.7820000052452087,
+ 0.8191520571708679,
+ 0.0,
+ 0.0,
+ 0.5735764503479004,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.057010501623153687,
+ -0.24309632182121277,
+ 0.7820000052452087,
+ 0.6293203830718994,
+ 0.0,
+ 0.0,
+ 0.77714604139328,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.14889994263648987,
+ -0.289178729057312,
+ 0.7820000052452087,
+ 0.45399054884910583,
+ 0.0,
+ 0.0,
+ 0.8910065293312073,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4946436285972595,
+ 0.15929214656352997,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3617478609085083,
+ 0.018660863861441612,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.38560986518859863,
+ 0.12582309544086456,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.438997745513916,
+ -0.03870069608092308,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.46524572372436523,
+ 0.1448618471622467,
+ 0.7820000052452087,
+ 0.9762960076332092,
+ 0.0,
+ 0.0,
+ 0.2164396196603775,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.21789447963237762,
+ 0.06548081338405609,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2825109362602234,
+ 0.2195398062467575,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.37105751037597656,
+ -0.17305849492549896,
+ 0.7799999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.24017132818698883,
+ 0.10215108096599579,
+ 0.7820000052452087,
+ 0.9914448857307434,
+ 0.0,
+ 0.0,
+ 0.13052619993686676,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4702789783477783,
+ -0.12463453412055969,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "4914bdc60f5a180e34a20c6fbef13f57d6369b2bddcd31891c9b158054a2c050"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..50729eb60c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..685a104f99
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Sort the front-row items into the crate and onto the tray (Unitree G1, fixed pelvis, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A work table holds a colourful spread of fruits, vegetables and household items, with an open blue plastic crate on one side and a round serving tray on the other.
+Goal: bus the table, SORTED. Move every fruit and vegetable that sits in the front working row — a lemon, and another lemon — into the blue crate, and move the non-food items from that row — a lime, and another lime — onto the round tray. Items further back on the table are part of the scene and stay where they are. The job is done when each listed item rests in its correct destination and nothing that is not food has been put in the crate.
+
+A Unitree G1 humanoid with three-finger hands, fixed at the pelvis (legs locked), a stationary upper-body manipulator. Control mode 'pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. Action dim 28.
+
+To be precise about the sort, since the wording above calls the limes non-food: the two lemons go into the blue
+crate and the two limes onto the round tray; nothing else is moved.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `packing.clear_organic_objects.g1.pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 28)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK and the hand joint targets are bounded by the joint limits.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..5d6833a8e3
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged"
+description = "EmbodiedSWE packing.clear_organic_objects.g1.pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "packing", "sorting", "humanoid", "unitree-g1", "packing.clear_organic_objects.g1.pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "packing.clear_organic_objects.g1.pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.5
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grader/clear_organic_objects.py b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grader/clear_organic_objects.py
new file mode 100644
index 0000000000..9df79cb3ec
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/grader/clear_organic_objects.py
@@ -0,0 +1,94 @@
+"""Grader for the clear_organic_objects scene: every organic in the bin, nothing else in it.
+
+Rubric stages (weights and modes live in RUBRIC):
+ organics_cleared fraction of the required placements that hold right now — in the
+ legacy variant every PRESENT organic cleared into the bin (the scene's
+ `cleared()`: origin inside the bin's interior box in the bin's body
+ frame, settled); in the sort variant (`sort_to_bin` / `sort_to_tray`)
+ the scene's own `bin_targets` cleared plus its `tray_targets` resting
+ on the tray. The organics are interchangeable sub-goals, so they share
+ this one fraction stage. It is GATED by the two sanity predicates
+ below: the whole stage reads 0 while either fails, and recovers when
+ the state is repaired (live)
+Gates (no weight of their own — rule 7 sanity predicates on the one and only stage, which
+is also the done stage):
+ no distractor in the bin the scene's `distractors_in_bin()` — identification IS the
+ task: dumping everything in must not score as progress
+ bin upright the bin's up-axis within its own topple angle of world-up, the
+ angle (from `bin_bbox` x `bin_scale`) past which a free crate's
+ centre leaves its base and it falls onto its side. A knocked-
+ over bin with produce inside it must not pass. The default bin
+ is kinematic and cannot move, so this only bites in the
+ dynamic-bin variant
+Success is the scene's own `success()` (every required placement holds, no distractor in the
+bin) AND the bin upright, on the final state. `progress == 1` exactly when that holds.
+
+Not measured: a grasped/lifted rung per item (the scene exposes no lift height or hold
+criterion) and "bin in place" (a positional test would need an invented tolerance; the
+body-frame judging already makes a moved bin judge identically).
+"""
+
+from __future__ import annotations
+
+import math
+
+from robobench.core import BaseGrader
+from robobench.suites.packing.scenes.clear_organic_objects import ClearOrganicObjectsScene
+
+
+class ClearOrganicObjectsGrader(BaseGrader):
+ """Every organic item in the bin, no non-food item in it, the bin still upright.
+
+ Ladder (N required placements): k placed k / N — e.g. the default manifest's 15 organics:
+ 1 in 0.067 · 2 in 0.133 · ... · 14 in 0.933 · 15 in 1.00 (a preset with 11 present: 0.091
+ per organic); any non-food item in the bin, or the bin tipped over, gates the stage to 0
+ until repaired.
+ """
+
+ SCENE = ClearOrganicObjectsScene
+ # One stage: the sub-goals are identical, and "all cleared" is not a separate physical
+ # action (unlike a lid or a set-down), so there is no distinct done step to weight.
+ RUBRIC = (("organics_cleared", 1.0),)
+ scene: ClearOrganicObjectsScene
+
+ def setup(self) -> None:
+ c = self.scene.cfg
+ # Topple angle of the (scaled) crate: centre at half height, pivot on the shorter
+ # base edge — tan(theta) = half_short_side / (height / 2).
+ half_short = min(c.bin_bbox[0] * c.bin_scale[0], c.bin_bbox[1] * c.bin_scale[1]) / 2
+ height = c.bin_bbox[2] * c.bin_scale[2]
+ self._upright_cos = math.cos(math.atan2(half_short, height / 2))
+
+ def check_success(self):
+ return self.scene.success() & self._bin_upright()
+
+ def _bin_upright(self):
+ """(num_envs,) bool: the bin's body +z within its topple angle of world-up.
+ R[2,2] of a (w, x, y, z) quaternion is 1 - 2 (x^2 + y^2)."""
+ q = self.scene.bin.data.root_quat_w
+ up_z = 1.0 - 2.0 * (q[:, 1] ** 2 + q[:, 2] ** 2)
+ return up_z >= self._upright_cos
+
+ def _sane(self):
+ """(num_envs,) bool: no distractor in the bin AND the bin upright."""
+ return ~self.scene.distractors_in_bin().any(dim=1) & self._bin_upright()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def organics_cleared(self):
+ import torch
+
+ s = self.scene
+ if s.tray_targets or s.cfg.sort_to_bin:
+ # sort variant: the scene's own required placements, judged live (its latched
+ # flags are the scene's partial-credit device; the grader keeps state live)
+ idx = {n: i for i, n in enumerate(s.names)}
+ cleared = s.cleared()
+ on_tray = s.placed_on_tray()
+ cols = [cleared[:, idx[n]] for n in s.bin_targets]
+ cols += [on_tray[:, idx[n]] for n in s.tray_targets]
+ frac = torch.stack(cols, dim=1).float().mean(dim=1)
+ else:
+ pres = s.organics_present() # (n, O)
+ done = s.organics_cleared() & pres
+ frac = done.sum(dim=1).float() / pres.sum(dim=1).clamp(min=1).float()
+ return frac * self._sane().float()
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..2c14fb0b5a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,630 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.clear_organic_objects.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bin/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bin/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/crabbypenholder/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/crabbypenholder/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_a/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_a/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lemon_b/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lemon_b/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime01_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime01_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime_a/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime_a/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/lime_b/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/lime_b/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/milkjug_a01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/milkjug_a01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/orange_01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/orange_01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/orange_02/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/orange_02/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pomegranate01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pomegranate01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinlarge/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pumpkinsmall/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/serving_bowl/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/utilityjug_a03/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/utilityjug_a03/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/whitepackerbottle_a01/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/whitepackerbottle_a01/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.44999998807907104,
+ -1.0499999523162842,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.1599999964237213,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.8999999761581421,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.5,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.1599999964237213,
+ 0.7799999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0965246856212616,
+ 0.021515723317861557,
+ 0.7820000052452087,
+ 0.9659258127212524,
+ 0.0,
+ 0.0,
+ 0.258819043636322,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15821443498134613,
+ -0.28615131974220276,
+ 0.7820000052452087,
+ 0.8910065293312073,
+ 0.0,
+ 0.0,
+ 0.45399051904678345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.056563347578048706,
+ -0.25133171677589417,
+ 0.7820000052452087,
+ 0.7771459817886353,
+ 0.0,
+ 0.0,
+ 0.6293204426765442,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.5487885475158691,
+ -0.19979985058307648,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.10576660931110382,
+ 0.10328016430139542,
+ 0.7820000052452087,
+ 0.8191520571708679,
+ 0.0,
+ 0.0,
+ 0.5735764503479004,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.057010501623153687,
+ -0.24309632182121277,
+ 0.7820000052452087,
+ 0.6293203830718994,
+ 0.0,
+ 0.0,
+ 0.77714604139328,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.14889994263648987,
+ -0.289178729057312,
+ 0.7820000052452087,
+ 0.45399054884910583,
+ 0.0,
+ 0.0,
+ 0.8910065293312073,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4946436285972595,
+ 0.15929214656352997,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3617478609085083,
+ 0.018660863861441612,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.38560986518859863,
+ 0.12582309544086456,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.438997745513916,
+ -0.03870069608092308,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.46524572372436523,
+ 0.1448618471622467,
+ 0.7820000052452087,
+ 0.9762960076332092,
+ 0.0,
+ 0.0,
+ 0.2164396196603775,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.21789447963237762,
+ 0.06548081338405609,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2825109362602234,
+ 0.2195398062467575,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.37105751037597656,
+ -0.17305849492549896,
+ 0.7799999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.24017132818698883,
+ 0.10215108096599579,
+ 0.7820000052452087,
+ 0.9914448857307434,
+ 0.0,
+ 0.0,
+ 0.13052619993686676,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4702789783477783,
+ -0.12463453412055969,
+ 0.7820000052452087,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "4914bdc60f5a180e34a20c6fbef13f57d6369b2bddcd31891c9b158054a2c050"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..50729eb60c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..51830500f8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-clear-organic-objects-g1-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/clear_organic_objects.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..7313178eb9
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:bc312e4d85937154bb93bf35e09e04279073580fc63f687ba4ab1d54a66b6ce5
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..e07eaebcb0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `packing.egg_carton.g1.pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Put three eggs in the carton and close the lid (Unitree G1, fixed pelvis, Pink IK). EmbodiedSWE's `packing.egg_carton.g1.pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Dexterous pick-and-place with a three-finger hand: eggs lying on their sides must be picked, turned upright and settled in three distinct pockets without disturbing their neighbours, then the hinged lid pushed closed.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/egg_carton.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..1c063c2210
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,295 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.egg_carton.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/carton/joint_position",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/carton/joint_velocity",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/carton/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/carton/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -1.919862151145935,
+ 0.0,
+ 0.13798092305660248,
+ -0.399666428565979,
+ 0.699999988079071,
+ 0.9978269338607788,
+ 0.0,
+ 0.0,
+ 0.06588954478502274,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.800000011920929,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.19022755324840546,
+ -0.4445315897464752,
+ 0.7400000095367432,
+ 0.7070363163948059,
+ -0.009980458766222,
+ 0.7070363163948059,
+ 0.009980458766222,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.20089486241340637,
+ -0.35403376817703247,
+ 0.7400000095367432,
+ 0.7017326951026917,
+ -0.08701284974813461,
+ 0.7017326951026917,
+ 0.08701284974813461,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.09877431392669678,
+ -0.43746036291122437,
+ 0.7400000095367432,
+ 0.7044335007667542,
+ -0.06142837554216385,
+ 0.7044335007667542,
+ 0.06142837554216385,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.09967996925115585,
+ -0.3398646116256714,
+ 0.7400000095367432,
+ 0.7030220031738281,
+ -0.07589486986398697,
+ 0.7030220031738281,
+ 0.07589486986398697,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "cac01f0068028025840ecaf9a616263e261cbe02e0ac6977ee4820992512a1c1"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..f206307b0a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..977c69724d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,147 @@
+# Put three eggs in the carton and close the lid (Unitree G1, fixed pelvis, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+Four loose eggs lie on their sides on the left half of the table. On the right is a small four-cell egg carton fixed to the table, with its hinged lid standing fully open. The carton has four distinct pockets in a 2 by 2 layout.
+Goal (three stages): pick eggs from the table one at a time, turn each upright, and place three eggs securely in three DISTINCT carton pockets; then push the hinged lid closed over them. Every seated egg must remain upright and settled, and the lid must rest closed at the end. The fourth egg is a distractor and can stay on the table.
+
+A Unitree G1 humanoid with three-finger hands, fixed at the pelvis (legs locked), a stationary upper-body manipulator. Control mode 'pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. Action dim 28.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `packing.egg_carton.g1.pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 28)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK and the hand joint targets are bounded by the joint limits.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..e43498eef0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged"
+description = "EmbodiedSWE packing.egg_carton.g1.pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "packing", "humanoid", "unitree-g1", "eggs", "packing.egg_carton.g1.pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "packing.egg_carton.g1.pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grader/egg_carton.py b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grader/egg_carton.py
new file mode 100644
index 0000000000..d39d073fc5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/grader/egg_carton.py
@@ -0,0 +1,55 @@
+"""Grader for the egg_carton scene: `target_eggs` distinct pockets filled with upright eggs, lid closed.
+
+Rubric stages (weights and modes live in RUBRIC):
+ eggs_seated fraction of the `target_eggs` pockets occupied by a seated egg — the
+ scene's own `occupied()`: egg centre within `seat_xy_tol` of a cavity
+ centre in the carton frame, in the `seat_z_min..seat_z_max` band, long axis
+ within `egg_tilt_max_deg` of the pocket axis, still. Distinct pockets, so a
+ second egg dropped into an occupied pocket earns nothing; the eggs are
+ identical, so they share this one fraction stage
+ lid_closed the scene's own `success()`: every target pocket filled, the lid within
+ `lid_closed_deg` of shut (when `require_lid_closed`), eggs and lid settled.
+ Gated on the pockets being filled: shutting the lid on an empty carton is not
+ progress (it has to be reopened), and the scene's own rubric only awards the
+ lid after the eggs
+Both stages are live: an egg that topples or a lid that swings back open loses its credit.
+Success is the scene's own `success()` on the final state.
+
+Not measured: a grasped/lifted rung for the eggs. The scene exposes no lift height or hold
+criterion, and inventing one is forbidden, so that rung is dropped.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.packing.scenes.egg_carton import EggCartonScene
+
+
+class EggCartonGrader(BaseGrader):
+ """Three eggs seated upright in three distinct carton pockets, then the lid pushed closed.
+
+ Ladder: 1 egg 0.30 · 2 eggs 0.60 · 3 eggs 0.90 · lid closed 1.00
+ (0.90 * k / target_eggs per k pockets filled; the default target is three.)
+ """
+
+ SCENE = EggCartonScene
+ # 0.9 : 0.1 — the three identical eggs share one fraction stage (0.30 each); the lid push
+ # is one short non-prehensile action after three pick-and-place cycles, so it is worth
+ # less than an egg.
+ RUBRIC = (("eggs_seated", 0.9), ("lid_closed", 0.1))
+ scene: EggCartonScene
+
+ def setup(self) -> None:
+ pass # every quantity is read live from the scene's own predicates
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) pockets filled, lid closed, settled
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def eggs_seated(self):
+ target = self.scene.cfg.target_eggs
+ filled = self.scene.occupied().sum(dim=1).clamp(max=target) # (n,) distinct pockets
+ return filled.float() / float(target)
+
+ def lid_closed(self):
+ return self.scene.success().float()
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..1c063c2210
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,295 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.egg_carton.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/carton/joint_position",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/carton/joint_velocity",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/carton/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/carton/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/egg_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/egg_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -1.919862151145935,
+ 0.0,
+ 0.13798092305660248,
+ -0.399666428565979,
+ 0.699999988079071,
+ 0.9978269338607788,
+ 0.0,
+ 0.0,
+ 0.06588954478502274,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.800000011920929,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.19022755324840546,
+ -0.4445315897464752,
+ 0.7400000095367432,
+ 0.7070363163948059,
+ -0.009980458766222,
+ 0.7070363163948059,
+ 0.009980458766222,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.20089486241340637,
+ -0.35403376817703247,
+ 0.7400000095367432,
+ 0.7017326951026917,
+ -0.08701284974813461,
+ 0.7017326951026917,
+ 0.08701284974813461,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.09877431392669678,
+ -0.43746036291122437,
+ 0.7400000095367432,
+ 0.7044335007667542,
+ -0.06142837554216385,
+ 0.7044335007667542,
+ 0.06142837554216385,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.09967996925115585,
+ -0.3398646116256714,
+ 0.7400000095367432,
+ 0.7030220031738281,
+ -0.07589486986398697,
+ 0.7030220031738281,
+ 0.07589486986398697,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "cac01f0068028025840ecaf9a616263e261cbe02e0ac6977ee4820992512a1c1"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..f206307b0a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..f140a0238d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-egg-carton-g1-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/egg_carton.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..527ca31365
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:5d98f33b006e2fc255d960c1e0afad7f736deaf28d66338daedc7654c1fc9722
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..b8b1ad7ab6
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-packing-pen-holder-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `packing.pen_holder.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Fill the pen holder with pencils, tips up (Franka, operational-space control). EmbodiedSWE's `packing.pen_holder.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Pick-and-reorient: thin pencils lying flat must be picked up, turned tip-up and dropped into a narrow hexagonal cup without tipping it over.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/pen_holder.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..b1f31a34ac
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,211 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.pen_holder.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/holder/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/holder/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.30000001192092896,
+ 0.550000011920929,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.08155594766139984,
+ 0.20186777412891388,
+ 0.6119999885559082,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -0.4352000057697296,
+ 0.6985141038894653,
+ 0.1099000945687294,
+ 0.6985141038894653,
+ -0.1099000945687294,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.1399999856948853,
+ 1.0,
+ -0.4352000057697296,
+ 0.6207275390625,
+ -0.33866989612579346,
+ 0.6207275390625,
+ 0.33866989612579346,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.25887227058410645,
+ 0.18763157725334167,
+ 0.5587999820709229,
+ 0.679343581199646,
+ -0.19619454443454742,
+ 0.679343581199646,
+ 0.19619454443454742,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.1837357133626938,
+ 0.07024850696325302,
+ 0.5587999820709229,
+ 0.650046169757843,
+ -0.2782803177833557,
+ 0.650046169757843,
+ 0.2782803177833557,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a9c3f0f1187b7c750e827eff2165efacdc50c865df571169af7c0a43a1b34e49"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..02d0c06545
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-pen-holder-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..3587cb60bd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Fill the pen holder with pencils, tips up (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+An open hexagonal pen holder (a cup, ~80 mm wide across its corners, 120 mm tall) stands on a work table. Scattered on its other side lie mechanical pencils, flat on the surface: up to 4 pencils (12 mm thick, 150 mm long), each with a pointed writing tip at one end and a click button at the other. Between one and all pencils are present in any episode: count what you see.
+Goal: put every pencil into the holder tip-up (writing tip pointing out of the cup), then leave the loaded holder standing upright on the surface. You may hold the holder while filling it; a pencil dropped tip-down or left leaning outside the cup does not count, and a tipped-over holder scores nothing until it is stood up.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `packing.pen_holder.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..d8b5523002
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-packing-pen-holder-franka-osc-i00-privileged"
+description = "EmbodiedSWE packing.pen_holder.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "packing", "insertion", "franka", "packing.pen_holder.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "packing.pen_holder.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grader/pen_holder.py b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grader/pen_holder.py
new file mode 100644
index 0000000000..eb539cec40
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/grader/pen_holder.py
@@ -0,0 +1,57 @@
+"""Grader for the pen_holder scene: every present pen in the holder tip-up, holder set down upright.
+
+Rubric stages (weights and modes live in RUBRIC):
+ pens_in fraction of the PRESENT pens the scene counts as in the holder — the
+ scene's own `counted()`: bottom within `xy_tol` of the holder axis,
+ deeper than `depth_min` below the rim, tip-up within `pen_align_max_deg`,
+ holder within `holder_tilt_max_deg` of up, pen and holder settled. All
+ pens are one identical family, so they share this one fraction stage;
+ the fraction is over the sampled subset (the present pen count is drawn
+ per env at reset, k ~ U{min_present..n} per family)
+ holder_placed the loaded holder standing upright on the work surface (the scene's
+ `holder_placed()`: within `placed_tilt_deg`, bottom within `placed_z_tol`
+ of the surface, still), gated on every present pen being in. The holder
+ spawns upright on the surface, so ungated it would be free credit at
+ reset; the order is fill, then set down
+Both stages are live: a pen ejected or a holder knocked over loses its credit. Success is
+the scene's own `success()` — `all_inserted() & holder_placed()` — on the final state.
+
+Not measured: a grasped/lifted rung for the pens. The scene exposes no lift height or hold
+criterion, and inventing one is forbidden, so that rung is dropped.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.packing.scenes.pen_holder import PenHolderScene
+
+
+class PenHolderGrader(BaseGrader):
+ """Every present pen in the holder tip-up, and the loaded holder standing upright on the surface.
+
+ Ladder (N present pens): k pens in 0.90 * k / N · holder set down 1.00
+ N = 4: 1 pen 0.225 · 2 pens 0.45 · 3 pens 0.675 · 4 pens 0.90 · set down 1.00
+ N = 3: 1 pen 0.30 · 2 pens 0.60 · 3 pens 0.90 · set down 1.00
+ """
+
+ SCENE = PenHolderScene
+ # 0.9 : 0.1 — the identical pens share one fraction stage; setting the filled holder
+ # down is one short action after up to four insertions, so like the egg carton's lid
+ # it is worth less than a pen.
+ RUBRIC = (("pens_in", 0.9), ("holder_placed", 0.1))
+ scene: PenHolderScene
+
+ def setup(self) -> None:
+ pass # every quantity is read live from the scene's own predicates
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) all present pens in AND holder set down
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def pens_in(self):
+ counted = self.scene.counted() # (n, P) inserted & settled & present
+ n_present = self.scene.present.sum(dim=1).clamp(min=1)
+ return counted.sum(dim=1).float() / n_present.float()
+
+ def holder_placed(self):
+ return (self.scene.all_inserted() & self.scene.holder_placed()).float()
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..b1f31a34ac
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,211 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.pen_holder.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/holder/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/holder/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pencil_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pencil_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.30000001192092896,
+ 0.550000011920929,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.08155594766139984,
+ 0.20186777412891388,
+ 0.6119999885559082,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ -0.4352000057697296,
+ 0.6985141038894653,
+ 0.1099000945687294,
+ 0.6985141038894653,
+ -0.1099000945687294,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.1399999856948853,
+ 1.0,
+ -0.4352000057697296,
+ 0.6207275390625,
+ -0.33866989612579346,
+ 0.6207275390625,
+ 0.33866989612579346,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.25887227058410645,
+ 0.18763157725334167,
+ 0.5587999820709229,
+ 0.679343581199646,
+ -0.19619454443454742,
+ 0.679343581199646,
+ 0.19619454443454742,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.1837357133626938,
+ 0.07024850696325302,
+ 0.5587999820709229,
+ 0.650046169757843,
+ -0.2782803177833557,
+ 0.650046169757843,
+ 0.2782803177833557,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "a9c3f0f1187b7c750e827eff2165efacdc50c865df571169af7c0a43a1b34e49"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..02d0c06545
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-pen-holder-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..dd82fc30e1
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-pen-holder-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/pen_holder.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..f1e613209e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:0e343a3167928608c7f817474b41c47e9a1526a965b8c998ba466476fd2b7f7c
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..dd0b790096
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-packing-tool-packing-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `packing.tool_packing.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Pack three tools into their drawers (Franka, operational-space control). EmbodiedSWE's `packing.tool_packing.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Articulated-object manipulation and placement: pull drawers open by their handles, place each tool in its own drawer's tray and push every drawer shut again.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/tool_packing.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..8855e71297
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,206 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.tool_packing.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/toolbox/joint_position",
+ [
+ 1,
+ 4
+ ]
+ ],
+ [
+ "/articulation/toolbox/joint_velocity",
+ [
+ 1,
+ 4
+ ]
+ ],
+ [
+ "/articulation/toolbox/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/toolbox/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/scissors/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/scissors/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/stapler/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/stapler/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4300000071525574,
+ 0.0,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ 0.1599999964237213,
+ 0.550000011920929,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.27000001072883606,
+ -0.41999998688697815,
+ 0.5540000200271606,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.33000001311302185,
+ -0.36000001430511475,
+ 0.5559999942779541,
+ 1.0,
+ 0.0,
+ 0.0,
+ -0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.28999999165534973,
+ -0.2800000011920929,
+ 0.5550000071525574,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "5c2af60ab1190eecf6dc04126712cd44f9ac4cefbefc424b7aa1bbf30333259c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..eaec533716
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-tool-packing-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..b03aa88824
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,150 @@
+# Pack three tools into their drawers (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A black high-gloss chest of drawers (~37 cm wide, 36 cm tall) stands on the table: four sliding drawers stacked top to bottom, each with a real pull handle on its front. All drawers start shut. In front of the chest lie three tools: a green stapler, a pair of scissors, and a utility knife.
+Goal: pull drawers open as needed and pack the tools — the STAPLER goes in the TOP (1st) drawer, the SCISSORS in the SECOND drawer, the KNIFE in the THIRD drawer (the 4th/bottom drawer stays shut and gets nothing) — then push every drawer shut. An item counts only inside its own drawer's tray; the job is done when all three tools are stowed and every drawer is shut.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `packing.tool_packing.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..1b7ec3732e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-packing-tool-packing-franka-osc-i00-privileged"
+description = "EmbodiedSWE packing.tool_packing.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "packing", "articulated", "drawers", "franka", "packing.tool_packing.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "packing.tool_packing.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.5
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grader/tool_packing.py b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grader/tool_packing.py
new file mode 100644
index 0000000000..bd2eeaf39c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/grader/tool_packing.py
@@ -0,0 +1,57 @@
+"""Grader for the tool_packing scene: three tools stowed in their assigned drawers, cabinet shut.
+
+Rubric stages (weights and modes live in RUBRIC):
+ stowed fraction of the three tools inside their ASSIGNED drawer's tray — the
+ scene's own `stowed()`: origin inside the tray-interior box in the drawer's
+ body frame (wherever the drawer slid to), settled
+ drawer_shut fraction of the three tools that are stowed AND whose own drawer is shut
+ (joint within `drawer_closed_tol` of 0) — the second rung of each tool's
+ ladder, since every tool has its own drawer to push home
+ cabinet_shut the scene's own `success()`: all three stowed, EVERY drawer shut (the
+ distractor drawer included), both doors shut on the toolbox variant, and
+ items + joints settled
+All three stages are live: a tool knocked out of its tray or a drawer that slides back open
+loses its credit. Success is the scene's own `success()` on the final state.
+
+Not measured: a grasped/lifted rung for the tools. The scene exposes no lift height or
+hold criterion, and inventing one is forbidden, so that rung is dropped.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.packing.scenes.tool_packing import ToolPackingScene
+
+
+class ToolPackingGrader(BaseGrader):
+ """All three tools stowed in their assigned drawers and the cabinet fully shut.
+
+ Ladder: 1 stowed 0.15 · 2 stowed 0.30 · 3 stowed 0.45 · 1 drawer shut 0.60 ·
+ 2 drawers shut 0.75 · 3 drawers shut 0.90 · cabinet shut 1.00
+ """
+
+ SCENE = ToolPackingScene
+ # The three identical stows share one fraction stage (0.15 each) and the three identical
+ # drawer-shuts another (0.15 each); the final cabinet shut is one short closing step after
+ # the parts (on the chest it only adds the untouched distractor drawer + settle; on the
+ # toolbox, both doors), so like the egg carton's lid it is worth less than a part.
+ RUBRIC = (("stowed", 0.45), ("drawer_shut", 0.45), ("cabinet_shut", 0.10))
+ scene: ToolPackingScene
+
+ def setup(self) -> None:
+ pass # every quantity is read live from the scene's own predicates
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) stowed, every drawer + door shut, settled
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] ---------------------
+ def stowed(self):
+ return self.scene.stowed().float().mean(dim=1)
+
+ def drawer_shut(self):
+ stowed = self.scene.stowed() # (n, I)
+ own_closed = self.scene.drawers_closed()[:, self.scene._assigned] # (n, I) — privileged
+ return (stowed & own_closed).float().mean(dim=1)
+
+ def cabinet_shut(self):
+ return self.scene.success().float()
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..8855e71297
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,206 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "packing.tool_packing.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/toolbox/joint_position",
+ [
+ 1,
+ 4
+ ]
+ ],
+ [
+ "/articulation/toolbox/joint_velocity",
+ [
+ 1,
+ 4
+ ]
+ ],
+ [
+ "/articulation/toolbox/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/toolbox/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/knife/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/scissors/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/scissors/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/stapler/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/stapler/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.4300000071525574,
+ 0.0,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.10000000149011612,
+ 0.1599999964237213,
+ 0.550000011920929,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.27000001072883606,
+ -0.41999998688697815,
+ 0.5540000200271606,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.33000001311302185,
+ -0.36000001430511475,
+ 0.5559999942779541,
+ 1.0,
+ 0.0,
+ 0.0,
+ -0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.28999999165534973,
+ -0.2800000011920929,
+ 0.5550000071525574,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "5c2af60ab1190eecf6dc04126712cd44f9ac4cefbefc424b7aa1bbf30333259c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..eaec533716
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-packing-tool-packing-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..bf61817846
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-packing-tool-packing-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/tool_packing.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..1ed86e9a0c
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:00d539436ac9633929c610e5f5e9c3649fa1a0e3dac6058358cb7c401fc5d3e5
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..ec5c2bb967
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `puzzle.classify_objects.g1.pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Sort the blocks by colour (Unitree G1, fixed pelvis, Pink IK). EmbodiedSWE's `puzzle.classify_objects.g1.pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Pick-and-place sorting with three-finger hands driven by absolute wrist poses (Pink IK): three coloured blocks, each to rest fully on the zone of its own colour.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/classify_objects.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..f3a21e91bb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,225 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.classify_objects.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/blue_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/blue_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/green_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/green_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/red_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/red_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6600000262260437,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.014368387870490551,
+ -0.478279709815979,
+ 0.7245000004768372,
+ 0.6136743426322937,
+ 0.0,
+ 0.0,
+ 0.7895593047142029,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.06614047288894653,
+ -0.41556334495544434,
+ 0.7245000004768372,
+ 0.9015799164772034,
+ 0.0,
+ 0.0,
+ 0.43261265754699707,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.04501210153102875,
+ -0.4181888699531555,
+ 0.7245000004768372,
+ 0.5348528027534485,
+ 0.0,
+ 0.0,
+ -0.8449453115463257,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "fa98236bfabd138f3fc4ee7df9a6b5e4cc71a5cb8b97ca9266cccef13c0f2003"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..d5a957372e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..b4ca721ad2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,146 @@
+# Sort the blocks by colour (Unitree G1, fixed pelvis, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+3 coloured wooden blocks (45 mm cubes) lie scattered on a work table: 1 red, 1 blue, 1 green. On the table are 3 marked coloured zones, one per colour (red and blue and green). Goal: sort every block into the zone whose colour matches it — put each block fully onto its matching-colour zone. A block left off the zones, or placed on the wrong colour's zone, does not count.
+
+A Unitree G1 humanoid with three-finger hands, fixed at the pelvis (legs locked), a stationary upper-body manipulator. Control mode 'pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. Action dim 28.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.classify_objects.g1.pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 28)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK and the hand joint targets are bounded by the joint limits.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..3688c4dc15
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged"
+description = "EmbodiedSWE puzzle.classify_objects.g1.pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "sorting", "pick-and-place", "humanoid", "unitree-g1", "puzzle.classify_objects.g1.pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "puzzle.classify_objects.g1.pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grader/classify_objects.py b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grader/classify_objects.py
new file mode 100644
index 0000000000..f158fd58e9
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/grader/classify_objects.py
@@ -0,0 +1,40 @@
+"""Grader for the classify_objects scene: every coloured block sorted into its matching zone.
+
+Rubric stages (weights and modes live in RUBRIC):
+ sorted_blocks fraction of the env's blocks correctly sorted — the scene's own
+ `sorted_mask()`: centre within cfg.zone_half (xy) of ITS OWN category's
+ (jittered) zone centre, resting on the surface (cfg.z_tol) and settled
+ (cfg.settle_speed)
+The blocks are identical pick-and-place sub-goals, so they share this ONE fraction stage
+(k/B). It is LIVE: a block knocked off its zone loses the credit, which is what makes the
+final state the only one that counts. No grasp/lift rung: the scene defines no lift
+threshold, so it is dropped rather than invented. Success is the scene's own `success()`
+— every block sorted — read on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.classify_objects import ClassifyObjectsScene
+
+
+class ClassifyObjectsGrader(BaseGrader):
+ """Every block resting, settled, inside the zone of its own colour.
+
+ Ladder (k / B blocks sorted; B = len(cfg.manifest), 3 by default): 1 block 0.333 ·
+ 2 blocks 0.667 · 3 blocks 1.00.
+ """
+
+ SCENE = ClassifyObjectsScene
+ RUBRIC = (("sorted_blocks", 1),)
+ scene: ClassifyObjectsScene
+
+ def setup(self) -> None:
+ pass # zones are captured by the scene itself at reset (`_zones`); nothing to cache
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every block of that env sorted
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that env's blocks --------
+ def sorted_blocks(self):
+ return self.scene.n_sorted().float() / len(self.scene.cfg.manifest)
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..f3a21e91bb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,225 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.classify_objects.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/blue_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/blue_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/green_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/green_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/red_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/red_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6600000262260437,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.014368387870490551,
+ -0.478279709815979,
+ 0.7245000004768372,
+ 0.6136743426322937,
+ 0.0,
+ 0.0,
+ 0.7895593047142029,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.06614047288894653,
+ -0.41556334495544434,
+ 0.7245000004768372,
+ 0.9015799164772034,
+ 0.0,
+ 0.0,
+ 0.43261265754699707,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.04501210153102875,
+ -0.4181888699531555,
+ 0.7245000004768372,
+ 0.5348528027534485,
+ 0.0,
+ 0.0,
+ -0.8449453115463257,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "fa98236bfabd138f3fc4ee7df9a6b5e4cc71a5cb8b97ca9266cccef13c0f2003"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..d5a957372e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..87715bf587
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-classify-objects-g1-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/classify_objects.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..92d244b5f6
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:15c2cce17b16935f84fd41437aedfe7456b243c00f1d17b8d661fd9e45a8f4c0
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..464397ef3d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-puzzle-coffee-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `puzzle.coffee.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Make and serve a capsule coffee (Franka, operational-space control). EmbodiedSWE's `puzzle.coffee.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Long-horizon appliance use with a fixed order of operations: load a capsule into the machine's bay, slide the cover shut, stage a cup under the spout, press the button, wait for the fill and carry the full cup upright to the tray, all with one parallel gripper under torque control (OSC).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/coffee_service.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..eeacb0c802
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,589 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.coffee.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/btn_start/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/btn_start/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_chest_floor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_chest_floor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_head/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_head/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_platform/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_platform/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_floor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_floor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_n/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_n/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_s/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_s/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_spine/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_spine/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_tank/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_tank/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cover/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cover/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cup/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cup/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pod/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pod/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.550000011920929,
+ 0.550000011920929,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007499999832361937,
+ 0.026000000536441803,
+ 0.7174999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007499999832361937,
+ -0.06549999862909317,
+ 0.871999979019165,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.06949999928474426,
+ -0.06650000065565109,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07850000262260437,
+ -0.06650000065565109,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ -0.12349999696016312,
+ 0.5899999737739563,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.026000000536441803,
+ 0.019999999552965164,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.019999999552965164,
+ 0.8920000195503235,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.05299999937415123,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ -0.013000000268220901,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.03999999910593033,
+ 0.019999999552965164,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.05299999937415123,
+ 0.026000000536441803,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06750000268220901,
+ 0.026000000536441803,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.125,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.28949999809265137,
+ 0.7210000157356262,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30596184730529785,
+ -0.09933283179998398,
+ 0.6079999804496765,
+ 0.0870961844921112,
+ 0.0,
+ 0.0,
+ 0.996199905872345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.42077797651290894,
+ -0.16906611621379852,
+ 0.5857999920845032,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.14000000059604645,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "18ee32a1d26f71fcebff471dce858fe3821c25dbc88fa4ca640ccd18a9fa6f08"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..32ac5896ea
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-coffee-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..8cfa031981
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,152 @@
+# Make and serve a capsule coffee (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A capsule coffee machine (0.17 x 0.64 x 0.40 m: a brew tower in front, its water tank behind) stands on a sturdy table with its spout facing -y. On its top: a SLIDING pod-bay cover with a raised grip ridge at its front edge (slide it toward the spout side to open — about 12 cm of travel), and behind the cover a green-capped START key that presses straight DOWN. Under the spout: a built-in cup platform. A green run lamp sits on the top's front rim. On the serving tray to the right: an empty green mug and a coffee capsule (burgundy dome, silver flange).
+The machine runs itself by strict rules: it only brews with the cover CLOSED, a capsule seated in the bay, and the mug standing centred under the spout (within 5 cm of its axis) — otherwise START refuses. The brew then runs ~5 s while the run lamp glows and coffee streams into the mug; sliding the cover open mid-brew ABORTS it, and so does removing the mug (a spill) — start over. Pressing START mid-brew stops it. When the brew completes, the mug is filled — its contents turn dark.
+Do the full service: open the bay, drop the capsule in, close the bay, stage the mug, press START, WAIT out the brew, then set the filled mug back down upright on the serving tray.
+Goal: the mug filled by a completed brew and resting on the tray. The cover ridge, the capsule and the mug rim hold in a firm pinch: close the fingers across them and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.coffee.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..93101f773e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-coffee-franka-osc-i00-privileged"
+description = "EmbodiedSWE puzzle.coffee.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "long-horizon", "articulated", "franka", "puzzle.coffee.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "puzzle.coffee.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grader/coffee_service.py b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grader/coffee_service.py
new file mode 100644
index 0000000000..820de85073
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/grader/coffee_service.py
@@ -0,0 +1,77 @@
+"""Grader for the coffee scene: one capsule coffee brewed and the filled mug set back on the tray.
+
+Rubric stages (weights and modes live in RUBRIC) — the scene's own seven staged flags
+(`CoffeeServiceScene.STAGES`), in the order the appliance's rules impose:
+ pod_loaded the capsule seated in the bay pocket (`pod_seated`)
+ bay_closed the cover slid shut over the seated capsule (`pod_seated & cover_closed`)
+ cup_staged the mug standing on the platform under the spout (`cup_under_spout`)
+ started the machine accepted START — it only does with cover closed, pod seated and
+ cup staged (the `started` event of the appliance state machine)
+ brewed the brew ran to completion: the machine's latched `filled` flag (an abort on
+ early open or on a spill never sets it)
+ cup_out the filled mug taken off the platform (`filled & ~cup_under_spout`)
+ served the filled mug resting upright, settled, on the tray dish — the scene's own
+ `success()`
+The first six are milestones (a loaded pod, a closed bay or a staged cup need not persist once
+the brew is done and the mug is carried away); the scene latches them itself at substep rate,
+so the grader reads its flags. `brewed` is the machine's irreversible state, `served` is the
+live end state. Success is the scene's `success()` on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.coffee_service import CoffeeServiceScene
+
+
+class CoffeeServiceGrader(BaseGrader):
+ """The mug filled by a completed brew and resting upright, settled, on the serving tray.
+
+ Ladder: pod loaded 0.143 · bay closed 0.286 · cup staged 0.429 · started 0.571 ·
+ brewed 0.714 · cup out 0.857 · served 1.000
+ (uniform: one unit per stage of the appliance's chain, the scene's own even credit).
+ """
+
+ SCENE = CoffeeServiceScene
+ RUBRIC = (
+ ("pod_loaded", 1, "once"),
+ ("bay_closed", 1, "once"),
+ ("cup_staged", 1, "once"),
+ ("started", 1, "once"),
+ ("brewed", 1),
+ ("cup_out", 1, "once"),
+ ("served", 1),
+ )
+ scene: CoffeeServiceScene
+
+ def setup(self) -> None:
+ # the flag columns, by the scene's own stage names
+ self._col = {name: k for k, name in enumerate(self.scene.STAGES)}
+
+ def check_success(self):
+ return self.scene.success() # filled AND on the tray, upright AND settled — live
+
+ def _flag(self, name: str):
+ return self.scene.stage_flags()[:, self._col[name]].float()
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] --------------------------
+ def pod_loaded(self):
+ return self._flag("pod_loaded")
+
+ def bay_closed(self):
+ return self._flag("bay_closed")
+
+ def cup_staged(self):
+ return self._flag("cup_staged")
+
+ def started(self):
+ return self._flag("started")
+
+ def brewed(self):
+ return self.scene.filled().float()
+
+ def cup_out(self):
+ return self._flag("cup_out")
+
+ def served(self):
+ return self.scene.success().float()
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..eeacb0c802
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,589 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.coffee.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/btn_start/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/btn_start/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_chest_floor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_chest_floor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_head/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_head/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_nook_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_platform/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_platform/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_floor/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_floor/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_n/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_n/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_s/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_s/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_pocket_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_e/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_e/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_w/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_rail_w/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_spine/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_spine/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cm_tank/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cm_tank/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cover/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cover/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/cup/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/cup/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pod/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pod/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/tray/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.550000011920929,
+ 0.550000011920929,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007499999832361937,
+ 0.026000000536441803,
+ 0.7174999713897705,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007499999832361937,
+ -0.06549999862909317,
+ 0.871999979019165,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.06949999928474426,
+ -0.06650000065565109,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07850000262260437,
+ -0.06650000065565109,
+ 0.699999988079071,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ -0.12349999696016312,
+ 0.5899999737739563,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.026000000536441803,
+ 0.019999999552965164,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.019999999552965164,
+ 0.8920000195503235,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.05299999937415123,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ -0.013000000268220901,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.03999999910593033,
+ 0.019999999552965164,
+ 0.9154999852180481,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.05299999937415123,
+ 0.026000000536441803,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06750000268220901,
+ 0.026000000536441803,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.125,
+ 0.7429999709129333,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.007000000216066837,
+ 0.28949999809265137,
+ 0.7210000157356262,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.11999999731779099,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30596184730529785,
+ -0.09933283179998398,
+ 0.6079999804496765,
+ 0.0870961844921112,
+ 0.0,
+ 0.0,
+ 0.996199905872345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.42077797651290894,
+ -0.16906611621379852,
+ 0.5857999920845032,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.3799999952316284,
+ -0.14000000059604645,
+ 0.550000011920929,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "18ee32a1d26f71fcebff471dce858fe3821c25dbc88fa4ca640ccd18a9fa6f08"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..32ac5896ea
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-coffee-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..3640c93fd5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-coffee-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/coffee_service.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..236cc7cb50
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:2d1b813eedf49225c6f53fa8e11d1d9113913ac523a9d5dca6f7ce2a7736dc6f
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..c5eba2a727
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `puzzle.push_shapes.g1.pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Push the shapes onto their pads (Unitree G1, fixed pelvis, Pink IK). EmbodiedSWE's `puzzle.push_shapes.g1.pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Non-prehensile manipulation with a humanoid upper body: push three flat shaped blocks across a board, each starting rotated, until each drops into the cutout of its own shape, without lifting them, using absolute wrist poses (Pink IK).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/push_shapes.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..1d71cd65bb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,306 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.push_shapes.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_t/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_t/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_x/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_x/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_t/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_t/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_x/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_x/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6000000238418579,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12049475312232971,
+ -0.29654815793037415,
+ 0.7161250114440918,
+ 0.599850058555603,
+ 0.0,
+ 0.0,
+ 0.8001124262809753,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06888329982757568,
+ -0.3153599202632904,
+ 0.7161250114440918,
+ 0.6129464507102966,
+ 0.0,
+ 0.0,
+ 0.7901244759559631,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.017701957374811172,
+ -0.277939110994339,
+ 0.7161250114440918,
+ 0.7841041684150696,
+ 0.0,
+ 0.0,
+ 0.6206293106079102,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12200000137090683,
+ -0.18799999356269836,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06599999964237213,
+ -0.20499999821186066,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.017999999225139618,
+ -0.16200000047683716,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "e3da1210bfff7ef47b551ec76c352fec3cd56a0164ef4a9e1e72acc34284d23a"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..a9e42fee83
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..162f926e87
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,148 @@
+# Push the shapes onto their pads (Unitree G1, fixed pelvis, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A raised work board lies on the table in front of you, with three shape cutouts sunk into it: a T, a cross, and an L, their recess floors coloured dark red, dark blue, and dark amber. Three flat coloured blocks rest on the board, each some distance behind the cutout of its own shape: a red T, a blue cross, and an amber L.
+Each block starts rotated away from its cutout's orientation.
+Goal: slide every block across the board into the cutout of its own shape so that it drops in and lies flat inside its recess, matching the recess outline in position and rotation. The blocks can only be pushed; lifting them does not solve the task. A block that arrives misaligned will catch on the recess rim instead of dropping in, and a wedged block is hard to recover — align each block before it reaches its cutout.
+
+A Unitree G1 humanoid with three-finger hands, fixed at the pelvis (legs locked), a stationary upper-body manipulator. Control mode 'pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. Action dim 28.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.push_shapes.g1.pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 28)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK and the hand joint targets are bounded by the joint limits.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..39348b6cc0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged"
+description = "EmbodiedSWE puzzle.push_shapes.g1.pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "pushing", "non-prehensile", "humanoid", "unitree-g1", "puzzle.push_shapes.g1.pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "puzzle.push_shapes.g1.pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grader/push_shapes.py b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grader/push_shapes.py
new file mode 100644
index 0000000000..5d8bbde2d7
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/grader/push_shapes.py
@@ -0,0 +1,62 @@
+"""Grader for the push_shapes scene: the T, X and L blocks each pushed into their own cutout.
+
+Rubric stages (weights and modes live in RUBRIC). The three blocks are identical sub-goals,
+so every stage is ONE fraction over the env's three blocks (k/3), never a stage per block:
+ yaw_aligned blocks whose orientation is inside the scene's coarse yaw band of their pad
+ (`yaw_matched`: cfg.yaw_stage_tolerance_deg) — the pivot push is done
+ near_pad blocks whose centre is within cfg.near_xy_tolerance of their own pad centre —
+ the translation push has arrived at the cutout
+ seated blocks seated in their recess AND settled — the scene's own per-piece success
+ gate (`seated() & settled()`: xy within cfg.xy_tolerance, orientation within
+ cfg.orientation_tolerance_deg, not lifted, dropped into the recess, at rest)
+All three are LIVE: a block knocked back out of tolerance loses the credit, exactly as the
+scene's own `success()` is a live conjunction. Every rung is implied by the next (7 mm inside
+30 mm, 7 deg inside 10 deg), so a seated block earns all three. Success is the scene's own
+`success()` — all three blocks seated and settled — read on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.push_shapes import PIECES, PushShapesScene
+
+
+class PushShapesGrader(BaseGrader):
+ """All three blocks pushed into their own cutouts — aligned, dropped in, and at rest.
+
+ Ladder (3 blocks, 3 equal rungs each, 1/9 per rung): per block yaw aligned +1/9 ·
+ near its pad +1/9 · seated +1/9; 1 block seated 0.333 · 2 blocks seated 0.667 ·
+ 3 blocks seated 1.00.
+ """
+
+ SCENE = PushShapesScene
+ # Equal rungs: each is a distinct physical event the scene measures with its own band
+ # (yaw_stage_tolerance_deg, near_xy_tolerance, seated()); each stage is a fraction over
+ # the three blocks, so one block contributes 1/3 of each rung.
+ RUBRIC = (("yaw_aligned", 1), ("near_pad", 1), ("seated", 1))
+ scene: PushShapesScene
+
+ def setup(self) -> None:
+ pass # everything is measured against the pads, which never move after reset
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — all three seated AND settled, live
+
+ # ---- rubric stages — each returns a (num_envs,) fraction over that env's blocks --------
+ def yaw_aligned(self):
+ import torch
+
+ return torch.stack([self.scene.yaw_matched(k) for k in PIECES], dim=1).float().mean(dim=1)
+
+ def near_pad(self):
+ import torch
+
+ tol = self.scene.cfg.near_xy_tolerance
+ near = torch.stack([self.scene.position_error(k) <= tol for k in PIECES], dim=1)
+ return near.float().mean(dim=1)
+
+ def seated(self):
+ import torch
+
+ done = torch.stack([self.scene.seated(k) & self.scene.settled(k) for k in PIECES], dim=1)
+ return done.float().mean(dim=1)
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..1d71cd65bb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,306 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.push_shapes.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_t/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_t/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_x/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_x/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_t/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_t/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pad_x/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pad_x/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6000000238418579,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12049475312232971,
+ -0.29654815793037415,
+ 0.7161250114440918,
+ 0.599850058555603,
+ 0.0,
+ 0.0,
+ 0.8001124262809753,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06888329982757568,
+ -0.3153599202632904,
+ 0.7161250114440918,
+ 0.6129464507102966,
+ 0.0,
+ 0.0,
+ 0.7901244759559631,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.017701957374811172,
+ -0.277939110994339,
+ 0.7161250114440918,
+ 0.7841041684150696,
+ 0.0,
+ 0.0,
+ 0.6206293106079102,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.12200000137090683,
+ -0.18799999356269836,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.06599999964237213,
+ -0.20499999821186066,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.017999999225139618,
+ -0.16200000047683716,
+ 0.7008000016212463,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "e3da1210bfff7ef47b551ec76c352fec3cd56a0164ef4a9e1e72acc34284d23a"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..a9e42fee83
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..6037a458d8
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-push-shapes-g1-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/push_shapes.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..d16ebc38af
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:b7fa01e3f4c67f5409d4b660132abd194fb838a79b19dce8012807b3b1b2854b
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..6aaea71db5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/README.md
@@ -0,0 +1,46 @@
+# embodiedswe-puzzle-spatula-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda` |
+| Family / instance | `puzzle.spatula.franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Flip a slice of bread in the pan with a spatula, then serve it onto the plate (Franka, operational-space control). EmbodiedSWE's `puzzle.spatula.franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Non-prehensile tool use: the bread is never grasped. Wedge the spatula's blade under the slice over the pan's rim, flip it so it lands flat and upside down in the pan, wedge it up again, carry it on the blade by friction alone over the rim and set it down flat on the plate, without the hand or fingers ever touching it, under torque control (OSC).
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/spatula_flip_serve.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
+
+## Details
+
+### Review notes
+- Tool-only rule: the scene's description says that touching the bread with the fingers or the gripper disqualifies
+ the episode, and its module leaves the check to the harness ("an EMBODIMENT clause, checked at the
+ robot-binding/harness layer"); EmbodiedSWE's grader does not check it. Here the verifier does: PhysX contact
+ reports on the bread (report only, threshold 0) and, after every physics substep, the contact forces between the
+ bread in play and `panda_hand`, `panda_leftfinger`, `panda_rightfinger`; any nonzero force sets success 0 and
+ progress 0. The spatula, welded to the hand by the scene's grasp contract, may touch the bread.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..0356560250
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,238 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.spatula.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_m/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_m/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_s/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_s/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pan/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pan/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6000000238418579,
+ 0.05000000074505806,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.3200000524520874,
+ 1.0,
+ 0.018587499856948853,
+ 0.987848162651062,
+ 0.0,
+ 0.0,
+ -0.15542221069335938,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.16883303225040436,
+ 0.09640082716941833,
+ 0.019474999979138374,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.015362500213086605,
+ 0.0870961844921112,
+ 0.0,
+ 0.0,
+ 0.996199905872345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.14000000059604645,
+ 0.07999999821186066,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.1570889800786972,
+ 0.06445534527301788,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.02953898161649704,
+ -0.1649862825870514,
+ 0.003000000026077032,
+ 0.9978439211845398,
+ 0.0,
+ 0.0,
+ -0.0656316950917244,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "1df7ac9890d56d6265350c45620c3f7d31de03f94137893aff6753257b3d867c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..04eb4ae6b1
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-spatula-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..919c1ab998
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,158 @@
+# Flip a slice of bread in the pan with a spatula, then serve it onto the plate (Franka, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+A slice of bread (7-9 cm across) lies in a stainless fry pan (26 cm across, rim 5 cm high) on a sturdy table; an empty bamboo plate (30 cm) waits beside it. A red-handled spatula (thin 9 cm blade) rests on the surface.
+Goal: first FLIP the bread in the pan (the browned underside ends up), then slide the blade under it again, carry it over the pan's rim and set it down flat on the plate.
+The pan's rim walls the slice in: enter over the rim, and the wall is a backstop a slide can pin the slice against.
+TOOL ONLY: never touch the bread with fingers or gripper — it disqualifies the episode. The bread must ARRIVE on the blade: a slice pushed, shoved or thrown onto the plate does not count. A slice spilled onto the bare surface is a failure you can recover from — wedge it up and continue. The spatula holds in a firm pinch: close the fingers across its handle and the grip locks; open wide to release.
+
+A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+
+Tool only: the robot's hand and fingers (`panda_hand`, `panda_leftfinger`, `panda_rightfinger`) must never touch the
+bread. The verifier reads PhysX's contact forces between those three links and the bread after every physics substep
+of the graded run; one contact with a nonzero force disqualifies the run (success 0, progress 0), whatever comes
+after it. The spatula may touch the bread. In development, `rcb_embodiedswe.tool_contact(env)` returns the record so
+far, and `check` reports it (`tool_contact`, `disqualified`).
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.spatula.franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 8)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. In the 8-value action, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..afc837a4f1
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-spatula-franka-osc-i00-privileged"
+description = "EmbodiedSWE puzzle.spatula.franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "tool-use", "non-prehensile", "flipping", "franka", "puzzle.spatula.franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda"
+family = "puzzle.spatula.franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grader/spatula_flip_serve.py b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grader/spatula_flip_serve.py
new file mode 100644
index 0000000000..90b7277bfb
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/grader/spatula_flip_serve.py
@@ -0,0 +1,83 @@
+"""Grader for the spatula scene: the bread flipped in the pan and/or served onto the plate on the blade.
+
+The scene's `cfg.goal` picks the chain (its own `_stage_table`); the rubric follows the goal,
+uniform credit per rung:
+ serve lifted -> wedged -> loaded -> served
+ flip lifted -> wedged -> flipped_in_pan
+ flip_serve lifted -> wedged -> flipped -> loaded (after the flip) -> served
+
+Rubric stages (weights and modes live in RUBRIC) — the scene's latched stages, read from its
+substep-rate latches (the journey), plus the live destination:
+ lifted the blade above the surface by `lift_gate` (`_lifted`) — a milestone
+ wedged the bread riding the blade while still down at pan-floor level (`_wedged`)
+ flipped the bread inverted by >= `flip_min_deg` AND at rest flat in the pan
+ (`_flipped`); a milestone in `flip_serve` (the slice is served afterwards)
+ loaded the bread riding the blade above `lift_gate` — the friction carry
+ (`_loaded`; in `flip_serve` the scene's `_loaded_pf`, the carry AFTER the
+ flip, so a load during the flip lift earns nothing)
+ served the scene's `success()` for the serve goals: the bread resting flat on the
+ plate now, having ARRIVED ON THE BLADE (`_served`, the contact-history
+ clause; `flip_serve` also demands the flip latch)
+ flipped_in_pan the scene's `success()` for the flip goal: flipped latched AND the bread
+ resting inverted, flat and settled in the pan now
+Success is the scene's own goal-dependent `success()` on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.spatula_flip_serve import SpatulaFlipServeScene
+
+
+class SpatulaFlipServeGrader(BaseGrader):
+ """The bread flipped in the pan and/or served flat onto the plate (per the scene's goal), carried there on the blade.
+
+ Ladder (uniform, one unit per rung of the goal's chain):
+ flip_serve: lifted 0.20 · wedged 0.40 · flipped 0.60 · loaded after flip 0.80 · served 1.00
+ serve: lifted 0.25 · wedged 0.50 · loaded 0.75 · served 1.00
+ flip: lifted 0.333 · wedged 0.667 · flipped in pan 1.000
+ """
+
+ SCENE = SpatulaFlipServeScene
+ RUBRICS = {
+ "serve": (("lifted", 1, "once"), ("wedged", 1, "once"), ("loaded", 1, "once"),
+ ("served", 1)),
+ "flip": (("lifted", 1, "once"), ("wedged", 1, "once"), ("flipped_in_pan", 1)),
+ "flip_serve": (("lifted", 1, "once"), ("wedged", 1, "once"), ("flipped", 1, "once"),
+ ("loaded", 1, "once"), ("served", 1)),
+ }
+ RUBRIC = RUBRICS["flip_serve"] # the scene's default goal
+ scene: SpatulaFlipServeScene
+
+ def __init__(self, env) -> None:
+ # the chain is the scene's goal: pick that goal's rubric before the base wires the stages
+ scene = getattr(env, "scene", None)
+ if isinstance(scene, self.SCENE):
+ self.RUBRIC = self.RUBRICS[scene.cfg.goal]
+ super().__init__(env)
+
+ def setup(self) -> None:
+ self._goal = self.scene.cfg.goal
+
+ def check_success(self):
+ return self.scene.success() # goal-dependent: the journey latches AND the live destination
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] --------------------------
+ def lifted(self):
+ return self.scene._lifted.float()
+
+ def wedged(self):
+ return self.scene._wedged.float()
+
+ def flipped(self):
+ return self.scene._flipped.float()
+
+ def loaded(self):
+ latch = self.scene._loaded_pf if self._goal == "flip_serve" else self.scene._loaded
+ return latch.float()
+
+ def served(self):
+ return self.scene.success().float()
+
+ def flipped_in_pan(self):
+ return self.scene.success().float()
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..0356560250
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,238 @@
+{
+ "action_dim": 8,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.spatula.franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_l/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_l/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_m/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_m/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/bread_s/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/bread_s/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/pan/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/pan/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/plate/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/spatula/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6000000238418579,
+ 0.05000000074505806,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.3200000524520874,
+ 1.0,
+ 0.018587499856948853,
+ 0.987848162651062,
+ 0.0,
+ 0.0,
+ -0.15542221069335938,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.16883303225040436,
+ 0.09640082716941833,
+ 0.019474999979138374,
+ 0.6194201707839966,
+ 0.0,
+ 0.0,
+ 0.7850596904754639,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.015362500213086605,
+ 0.0870961844921112,
+ 0.0,
+ 0.0,
+ 0.996199905872345,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.14000000059604645,
+ 0.07999999821186066,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.7071067690849304,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.1570889800786972,
+ 0.06445534527301788,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.02953898161649704,
+ -0.1649862825870514,
+ 0.003000000026077032,
+ 0.9978439211845398,
+ 0.0,
+ 0.0,
+ -0.0656316950917244,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "1df7ac9890d56d6265350c45620c3f7d31de03f94137893aff6753257b3d867c"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..04eb4ae6b1
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-spatula-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..ba9b06738e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-spatula-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/spatula_flip_serve.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/DIGEST
new file mode 100644
index 0000000000..fc8c5a3d95
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:c0ec502c2bb6e1a75216ba6ba013c928bf657150d0d0a0c74ac1a583522cf173
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/README.md
new file mode 100644
index 0000000000..a2b8175145
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `unitree-g1-dex3` |
+| Family / instance | `puzzle.stack_blocks.g1.pink_ik` / seed 0 |
+| Oracle | `none` — No reference solution in the repository. A scripted reference solve() exists outside the repository (internal only, used to check the task is solvable through the grading path); it is not shipped. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Stack the blocks (Unitree G1, fixed pelvis, Pink IK). EmbodiedSWE's `puzzle.stack_blocks.g1.pink_ik` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Bimanual-capable humanoid upper body with three-finger hands driven by absolute wrist poses (Pink IK): grasping and placing blocks precisely enough to build a stable tower.
+
+## Reference solution
+None in the repository (`oracle = "none"`). A scripted reference `solve()` is kept outside the repository (internal only).
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/stack_blocks.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..dff6338184
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/instance.json
@@ -0,0 +1,252 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.stack_blocks.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6600000262260437,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07575836032629013,
+ -0.4298767149448395,
+ 0.7245000004768372,
+ 0.5494756698608398,
+ 0.0,
+ 0.0,
+ 0.835509717464447,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.01151351723819971,
+ -0.47487229108810425,
+ 0.7245000004768372,
+ 0.6136743426322937,
+ 0.0,
+ 0.0,
+ 0.7895593047142029,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.021809665486216545,
+ -0.45889779925346375,
+ 0.7245000004768372,
+ 0.6750413775444031,
+ 0.0,
+ 0.0,
+ -0.7377798557281494,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.09302892535924911,
+ -0.433660089969635,
+ 0.7245000004768372,
+ 0.9868704080581665,
+ 0.0,
+ 0.0,
+ -0.16151416301727295,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "7e47584746a3ad34b5ed6a8ad803a237c1f6734eb20e828ec17e8166a8285859"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..cb22b80bcd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/instruction.md
new file mode 100644
index 0000000000..7abf65a128
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/instruction.md
@@ -0,0 +1,146 @@
+# Stack the blocks (Unitree G1, fixed pelvis, Pink IK)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+4 coloured wooden blocks (45 mm cubes) lie scattered flat on a work table, beside a marked square pad. Goal: stack all 4 blocks into a single upright tower centred on the pad — one block squarely on top of the next, faces level, so the finished tower stands 4 blocks high and stays standing. A block placed off-centre enough to overhang, set down crooked, or left off the pad does not count toward the tower.
+
+A Unitree G1 humanoid with three-finger hands, fixed at the pelvis (legs locked), a stationary upper-body manipulator. Control mode 'pink_ik': 17 arm+waist joints driven by the Pink IK solver (absolute wrist poses), plus 14 hand joints by direct position target. Action dim 28.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.stack_blocks.g1.pink_ik` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 28)` tensor; one step is 0.016667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+Action range. The tooling enforces no range on this robot's action: the wrist poses are absolute targets for
+the IK and the hand joint targets are bounded by the joint limits.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/task.toml
new file mode 100644
index 0000000000..ed1edfec6d
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged"
+description = "EmbodiedSWE puzzle.stack_blocks.g1.pink_ik (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "stacking", "humanoid", "unitree-g1", "puzzle.stack_blocks.g1.pink_ik"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "unitree-g1-dex3"
+family = "puzzle.stack_blocks.g1.pink_ik"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository. A scripted reference solve() exists outside the repository (internal only, used to check the task is solvable through the grading path); it is not shipped."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 3.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grader/stack_blocks.py b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grader/stack_blocks.py
new file mode 100644
index 0000000000..45200628b4
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/grader/stack_blocks.py
@@ -0,0 +1,42 @@
+"""Grader for the stack_blocks scene: all blocks stacked into one upright tower on the pad.
+
+Rubric stages (weights and modes live in RUBRIC):
+ tower contiguous tower height in blocks over cfg.n_blocks — the scene's own
+ `tower_height()`: slots 0, 1, 2, ... above the pad centre, each filled by a block
+ within cfg.align_tol of the pad axis, at the slot height within cfg.z_tol,
+ upright within cfg.upright_max_deg, settled with the whole scene settled
+ (cfg.settle_speed), counted up to the first empty slot
+The cubes are identical sub-goals, so they share this ONE fraction stage (k/n_blocks). It is
+LIVE: a toppled tower loses the credit. No grasp/lift rung: the scene defines no lift
+threshold, so it is dropped rather than invented. Success is the scene's own `success()` —
+every slot filled by exactly one block — read on the final state. With n_blocks blocks and
+n_blocks slots, a full-height tower (every slot >= 1 block) is exactly one block per slot,
+so the stage reaches 1 if and only if `success()` holds.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.stack_blocks import StackBlocksScene
+
+
+class StackBlocksGrader(BaseGrader):
+ """One clean tower on the pad — every slot filled by exactly one upright, settled block.
+
+ Ladder (k / n_blocks tower height; cfg.n_blocks = 4 by default): 1 block 0.25 ·
+ 2 blocks 0.50 · 3 blocks 0.75 · 4 blocks 1.00.
+ """
+
+ SCENE = StackBlocksScene
+ RUBRIC = (("tower", 1),)
+ scene: StackBlocksScene
+
+ def setup(self) -> None:
+ pass # the pad axis is cfg.pad_pos (env-local) and the slots are cfg-derived; nothing to cache
+
+ def check_success(self):
+ return self.scene.success() # (num_envs,) — every slot of that env holds exactly one block
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] -------------------------
+ def tower(self):
+ return self.scene.tower_height().float() / self.scene.cfg.n_blocks
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..dff6338184
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/instance.json
@@ -0,0 +1,252 @@
+{
+ "action_dim": 28,
+ "control_dt": 0.016667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.stack_blocks.g1.pink_ik",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/robot/joint_position",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/joint_velocity",
+ [
+ 1,
+ 43
+ ]
+ ],
+ [
+ "/articulation/robot/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/robot/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_0/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_0/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_1/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_1/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_2/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_2/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/block_3/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/block_3/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ -0.10000000149011612,
+ -0.10000000149011612,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.30000001192092896,
+ 0.30000001192092896,
+ 0.0,
+ 0.0,
+ -0.20000000298023224,
+ -0.20000000298023224,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.6600000262260437,
+ 0.75,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.707099974155426,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.07575836032629013,
+ -0.4298767149448395,
+ 0.7245000004768372,
+ 0.5494756698608398,
+ 0.0,
+ 0.0,
+ 0.835509717464447,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.01151351723819971,
+ -0.47487229108810425,
+ 0.7245000004768372,
+ 0.6136743426322937,
+ 0.0,
+ 0.0,
+ 0.7895593047142029,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.021809665486216545,
+ -0.45889779925346375,
+ 0.7245000004768372,
+ 0.6750413775444031,
+ 0.0,
+ 0.0,
+ -0.7377798557281494,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.09302892535924911,
+ -0.433660089969635,
+ 0.7245000004768372,
+ 0.9868704080581665,
+ 0.0,
+ 0.0,
+ -0.16151416301727295,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "7e47584746a3ad34b5ed6a8ad803a237c1f6734eb20e828ec17e8166a8285859"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..cb22b80bcd
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..a276c1aa83
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-stack-blocks-g1-pink-ik-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/stack_blocks.py 2> /logs/verifier/grade.log
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/DIGEST b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/DIGEST
new file mode 100644
index 0000000000..b676d88ab2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/DIGEST
@@ -0,0 +1 @@
+sha256:65315b63f1da9d5dd4e8ff1b72826826b126a6a9e9cf707e5ffaca2846507f8d
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/README.md b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/README.md
new file mode 100644
index 0000000000..85b1ebde80
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/README.md
@@ -0,0 +1,36 @@
+# embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged
+
+| | |
+|---|---|
+| Benchmark | EmbodiedSWE |
+| Mode | privileged |
+| Twin | — (privileged only) |
+| Simulator / robot | `embodiedswe` / `franka-panda-bimanual` |
+| Family / instance | `puzzle.syringe.bimanual_franka.osc` / seed 0 |
+| Oracle | `none` — No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked. |
+| Agent time budget | 14400 s; tokens: protocol default (docs/protocol/running.md "Official runs") |
+| Base image | `ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0` |
+
+## Task
+Draw and dose liquid with a syringe (two Frankas, operational-space control). EmbodiedSWE's `puzzle.syringe.bimanual_franka.osc` task (robobench at commit `67f44e8a2ca5`), privileged mode, with a program as the
+deliverable: `solution/solve.py` exposing `solve(env)`.
+
+## Difficulty
+Bimanual tool use with two arms under torque control (OSC): draw a full load of liquid from a reservoir with a syringe, dispense a dose inside a set band into each of three test tubes without spilling, then lay the syringe back down at its spot.
+
+## Reference solution
+None in the repository (`oracle = "none"`). No scripted reference has been written for this scene yet.
+
+## Verification
+`tests/grade.py` with EmbodiedSWE's grader for this scene, `tests/grader/syringe_dosing.py`, on the frozen instance (seed 0); the procedure (candidates, sandbox, 30-minute limit, selection, video) is the benchmark's, tasks/embodiedswe/README.md "Grading".
+
+## Resources
+Caps per container (PROTOCOL §6).
+
+| Container | CPUs | Memory | Processes | GPU memory | Disk |
+|---|---|---|---|---|---|
+| `main` (the agent's) | 8 | 29 GiB | 16384 | 16 GiB | 10 GiB |
+| verifier | no cap | no cap | no cap | 16 GiB | no cap |
+
+- GPU: an RTX-class NVIDIA GPU (ray-tracing cores), one of the models in `gpu_types`: L40S, L40, L4, RTX 4090, RTX 6000 Ada, held by `main`.
+- Recommended GPU: L40S 48GB / L4 24GB / RTX 4090 24GB.
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/Dockerfile
new file mode 100644
index 0000000000..2990b882b0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/Dockerfile
@@ -0,0 +1,8 @@
+# EmbodiedSWE base image (images/embodiedswe/: RoboLab's Isaac Sim 5.1 / Isaac Lab 2.3.2 recipe + robobench at a pinned
+# commit, scrubbed, + its assets by sha256); built locally, not published (images/embodiedswe/BUILD_ONLY). The tooling
+# comes from the files image (images/embodiedswe-files/, source embodied_first_exam/benchmarks/embodiedswe/).
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /esw_submit.py /opt/efe/
+COPY instance.json /app/instance.json
+RUN ln -s /opt/efe/esw_submit.py /usr/local/bin/submit && mkdir -p /app/output
+WORKDIR /app
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
new file mode 100644
index 0000000000..5c0a501e01
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/docker-compose.yaml
@@ -0,0 +1,46 @@
+# Isaac Sim needs an RTX-class GPU even headless. The Kit cache gets a trial-scoped volume (compose down --volumes deletes it).
+services:
+ main:
+ pids_limit: 16384 # rcb-monitor
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - rcb_limits:/run/rcb-limits:ro # rcb-monitor
+ - esw_cache:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # >>> rcb_monitor (resource monitor, PROTOCOL §6; generated by images/monitor/rcb_monitor/inject.py)
+ rcb_monitor:
+ image: ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a
+ pid: host
+ cgroup: host
+ network_mode: none
+ cap_add: [SYS_PTRACE]
+ cpus: 0.5
+ mem_limit: 256m
+ pids_limit: 64
+ restart: on-failure
+ working_dir: /var/rcb-monitor
+ volumes:
+ - ./rcb_monitor/limits.json:/opt/rcb_monitor/limits.json:ro
+ - rcb_limits:/run/rcb-limits
+ environment:
+ RCB_LIMITS_ENFORCE: ${RCB_LIMITS_ENFORCE:-0}
+ RCB_LIMITS_TOLERANCE: ${RCB_LIMITS_TOLERANCE:-0.05}
+ command: ["python3", "/opt/rcb_monitor/monitor.py", "run"]
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+ # <<< rcb_monitor
+volumes:
+ rcb_limits: # rcb-monitor
+ esw_cache:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/instance.json
new file mode 100644
index 0000000000..ed064a6880
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/instance.json
@@ -0,0 +1,232 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.syringe.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/syringe/joint_position",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/syringe/joint_velocity",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/syringe/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/syringe/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/rack/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/rack/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/reservoir/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/reservoir/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.2800000011920929,
+ 0.41999998688697815,
+ 0.7099999785423279,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2800000011920929,
+ 0.41999998688697815,
+ 0.7099999785423279,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.05999999865889549,
+ -0.07999999821186066,
+ 0.7942000031471252,
+ 0.5,
+ -0.5,
+ 0.5,
+ -0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.0030286055989563465,
+ 0.14050038158893585,
+ 0.7491999864578247,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15416723489761353,
+ -0.04127092286944389,
+ 0.7742000222206116,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "2a7447886826f62cb02e55f5d1231071a64cab07c23d09ec5d5232f3f4679976"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
new file mode 100644
index 0000000000..391861d13a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/environment/rcb_monitor/limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/instruction.md b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/instruction.md
new file mode 100644
index 0000000000..3ff01189f2
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/instruction.md
@@ -0,0 +1,157 @@
+# Draw and dose liquid with a syringe (two Frankas, operational-space control)
+
+You are in a container with NVIDIA Isaac Sim 5.1 / Isaac Lab 2.3.2 and EmbodiedSWE's robot benchmark package
+(`robobench`, at `/opt/embodiedswe`, already on `PYTHONPATH`; read its source freely: scenes, robots, controllers).
+An NVIDIA GPU is available. Your job: write a program that completes the task below, and leave it in
+`/app/output/solution/`.
+
+## The task
+
+On the top shelf of a medical cart: a large syringe LYING FLAT (a scanned model — translucent barrel with graduation marks and finger flanges, a plunger with a thumb plate, travel 0.12 m = its full capacity, and a luer nozzle at the tip), a rack of three GLASS TEST TUBES, and a wide RESERVOIR beaker of water (its blue level visibly drops as liquid is drawn). The cart's lower shelf holds packaged syringes and a basin — scenery only.
+Liquid moves with the plunger, but ONLY while the syringe is roughly upright with the nozzle tip seated on a mouth: hovering within 6 mm laterally and 12 mm above the rim. Pulling the plunger while seated on the reservoir draws liquid; pushing it dispenses into whichever tube the tip is seated on — anywhere else the liquid is WASTED. Tubes never un-fill: a tube pushed past its band is ruined for the episode (the reservoir can be re-drawn from, but over-dispensing cannot be undone). The water is VISIBLE: a blue column inside the translucent barrel shows the drawn liquid, and each tube fills with a blue column as it receives its dose. The plunger has deliberate friction: push/pull it slowly and steadily.
+Goal: draw a full load (>= 95% of capacity, tip seated in the reservoir), dispense between 23% and 43% of capacity into EACH of the three tubes, then lay the syringe back down at its spot on the shelf.
+
+2 robots operating in the same workspace as one composite embodiment. The action vector is their actions concatenated in order ('left' dims [0:8), 'right' dims [8:16); total 16).
+[left] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+[right] A Franka Emika Panda arm with a parallel-jaw gripper, fixed to the table. Control mode 'osc': 7 arm joints by operational-space control (joint torque); the action is 6 end-effector pose deltas, plus 2 gripper fingers by direct position target. Action dim 8.
+
+The task is complete when `env.scene.success()` is true for the env (a `(num_envs,)` bool tensor) at the end of the
+graded run.
+That is the verdict. Partial progress toward it is also recorded (EmbodiedSWE's rubric for this task, reported
+as `progress`), but only success counts as solved.
+
+## The environment
+
+The env is EmbodiedSWE's `puzzle.syringe.bimanual_franka.osc` preset: one environment (`num_envs = 1`), built with seed 0 and PhysX on the
+GPU (`device="cuda:0"`, as EmbodiedSWE grades; grading uses the same build). Build it exactly as grading does:
+
+```python
+import sys; sys.path.insert(0, "/opt/efe")
+from rcb_embodiedswe import make_env
+env = make_env() # launches Isaac Sim headless first, then builds and resets the env from /app/instance.json
+```
+
+`make_env()` compares the start state with the frozen instance of this task (`/app/instance.json`). In development
+anything goes: reset it, restore states, read anything, make cameras, run many processes. `env.step(action)` takes a
+`(1, 16)` tensor; one step is 0.066667 s of simulated time. `env.describe()`, `env.describe_stage()`, the
+scene's and the robot's own methods and the source under `/opt/embodiedswe` tell you the rest.
+
+This robot is bimanual: `env.robot.articulation` is `None`. Each arm is reached through
+`env.robot.robots['left']` and `env.robot.robots['right']` (their articulations, bodies and joints), and
+`env.robot.action_slices` says which part of the action vector drives which arm.
+
+Action range. In each arm's 8-value slice, the first 6 values are end-effector pose deltas in action units
+(x 0.02 m for position, x 0.097 rad for rotation). As in EmbodiedSWE, the controller scales them by these
+factors and does not clip them (a larger value is a larger step); it clamps each joint torque to 100 N·m.
+The 2 finger values of each slice are finger position targets in metres
+(0 closed, 0.04 open); the joint limits bound them.
+
+## Deliverable
+
+The whole folder `/app/output/solution/`. Its entry point is `/app/output/solution/solve.py`, exposing
+
+```python
+def solve(env) -> None:
+ ...
+```
+
+Everything else in the folder ships with it (helper modules, calibration data); nothing outside it does. At grading
+time `solve.py`'s directory is on the import path, so sibling imports and files read relative to `__file__` work.
+Only regular files count (no symbolic links); at most 20,000 files and 2 GiB.
+
+## How it is graded
+
+A fresh simulator, in a separate container, builds this env from the same frozen instance and resets it; that
+simulator process is not yours. Your `solve.py` is imported and run in **another process**, as an unprivileged user,
+with no network and no GPU, and receives a proxy `env` that forwards to the simulator:
+
+- reading works as in development, but returns copies: `env.scene.<...>.data.root_pos_w` gives a CPU tensor, a list of
+ assets gives proxies of them, and calling a method that only reads (`env.scene.success()`, `env.describe()`,
+ `env.get_states()`, the scene's and robot's query methods) returns its result;
+- `env.step(action)` steps the simulator; this is the only way your program changes anything;
+- everything else is refused with `PermissionError`: `env.reset()`, `env.set_states(...)`, `env.sim.step()`, any
+ `write_*` / `set_*` / `reset*` method of an asset, any method of the scene or the robot that is not one of their
+ queries (state, progress and geometry reads such as `success()`, `seated()`, `get_state()`), assigning attributes,
+ and private or `__dunder__` attributes. Modifying a tensor you read changes only your copy.
+- if `env.step(action)` raises (the env cannot take that action, e.g. the controller hits a singular pose), the
+ error is raised in `solve`, as in EmbodiedSWE: the run goes on if `solve` handles it, and otherwise ends
+ there, with the verdict read on the state at that moment.
+
+What `solve.py` can use in the graded run. Its process has **no simulator and no Isaac Sim app**; it is
+sandboxed (Landlock) and sees only its own files:
+
+- it can import the Python standard library, `numpy`, `torch` (CPU only; 4 threads), `scipy`, `pinocchio` and
+ `pink`, the pure-Python parts of `robobench` that import no Isaac module, and your own modules in
+ `solution/`; it can read the files in `solution/` (relative to `__file__`) and the installed packages;
+- it cannot import `isaaclab`, `isaacsim`, `omni` or `pxr` (they need the running app; `isaaclab.utils.math`
+ included: copy the few quaternion helpers you need into your folder), and calling the robot's controller
+ objects through the proxy is refused like any other non-read;
+- it can write only to its own scratch directory (`$TMPDIR`, also its working directory and `$HOME`), not to
+ `solution/`; it sees no other process, no `/tmp`, no `/app`, and has no network;
+- it can start subprocesses (at most 512 processes in all); every one of them is ended with it.
+
+Keep module level light: no simulator launch or env build at import time (a `if __name__ == "__main__":` block that
+builds an env with `make_env()` and calls `solve(env)` is a good pattern for development).
+
+The graded run has **30 minutes** of wall-clock time, counted from the start of the grading process: the
+simulator's start-up and the import of `solve.py` count (as in EmbodiedSWE). It ends when `solve` returns or raises,
+its process ends, or the 30 minutes are up; every process it started is then ended, and the verdict is read on the
+state at that moment (a crash or a hang is not retried). That verdict is the run's result: success = the task's
+success predicate on that state, progress = EmbodiedSWE's rubric score. Every action is recorded, with the scene's
+state every few steps; the video poses those recorded states afterwards and does not change the verdict.
+
+## Checkpoints
+
+As in EmbodiedSWE, you can freeze checkpoints while you work:
+
+```
+submit "a short note"
+```
+
+copies `/app/output/solution/` as it is now to `/app/output/submissions/NNNNNN/` (with a receipt, `submission.json`).
+At most **64** checkpoints; the final `/app/output/solution/` is graded as well. Every distinct checkpoint and the
+final folder are each graded in their own fresh simulator, exactly as above (30 minutes each); identical copies are
+graded once. The result is the one with the highest progress; a tie goes to the one with success, then to the
+earliest (the final folder counts as the last). Its success is the verdict. Do not edit `/app/output/submissions/`
+by hand: a checkpoint whose files no longer match its receipt scores 0. Leaving the best version in `solution/`
+is enough; checkpoints are a safety net for versions you might break later.
+
+Rules of the graded run (they hold whatever the proxy lets through): change the world only by stepping forward with
+`env.step`; never reset, restore states, move objects, modify physics, the task, the scene or the robot's controller,
+or reach the grading code or its files.
+
+Test the graded path itself before you finish:
+
+```
+python /opt/efe/rcb_embodiedswe.py check --solution /app/output/solution
+```
+
+runs your folder exactly as grading does (a fresh simulator, your `solve` as an unprivileged process behind the
+proxy, the same 30-minute limit from the process's start) and prints, as its last line, a JSON summary with
+`success`, `n_actions`, `solve_status`, `boot_s` and the proxy's refusals (it takes a few minutes: one Isaac Sim
+launch plus your rollout).
+
+## Practical notes
+
+- The first Isaac Sim launch in the container takes a few minutes (shader cache); later ones are faster. Run long
+ jobs in the background and poll their logs. Kit sometimes hangs on exit: `os._exit(0)` after your script has
+ written its results is fine.
+- Every Python process starts from a fresh simulator; nothing carries over between scripts.
+- Physics runs on the GPU. Do not count on a recorded action sequence repeating exactly: the grading machine's GPU
+ may be another model than yours, and drawing frames between steps changes later physics in some scenes. A
+ closed-loop solve that reads the state and reacts is robust to both; the proxy adds a little time per call
+ (about 0.05 ms per read or step request, measured), so reading state every step is fine.
+- You can look at the scene: add a camera (`make_env(cameras=True)`, then Isaac Lab's `Camera`), save frames to PNG
+ and look at the images themselves. The graded run draws nothing, so judge a solution by `check`, not by a
+ rendered run.
+
+## External material
+You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.
+
+## Resources
+Your container: **8 CPUs**, **29 GiB of memory**, **16384 processes and threads**, **10 GiB** of disk (new files under `/app`, `/tmp` and `/root`) and **one GPU, 16 GiB of its memory**. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: `/run/rcb-limits/usage.json`.
+
+## Time limit
+You have 14400 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.
+
+This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in `/app/output/` at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. `/run/rcb-limits/usage.json`, rewritten every few seconds, gives the time left on this limit (`time_left_s`) and its end (`deadline_utc`), counted from a little before your session started, so it never gives you more time than you have: read it (or run `date`) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it (for example Codex's `yield_time_ms`) even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (`## External material` above).
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/task.toml b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/task.toml
new file mode 100644
index 0000000000..08af0d9b68
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/task.toml
@@ -0,0 +1,48 @@
+schema_version = "1.3"
+artifacts = [{ source = "/var/rcb-monitor/", service = "rcb_monitor" }, "/app/output/"]
+
+[task]
+name = "embodied-first-exam/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged"
+description = "EmbodiedSWE puzzle.syringe.bimanual_franka.osc (robobench at 67f44e8a2ca5, Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX): deliver a program, solution/solve.py with solve(env), that completes the task when the verifier runs it against a fresh simulator built from the frozen instance (seed 0)."
+keywords = ["robotics", "embodiedswe", "isaac-lab", "isaac-sim", "code-as-policy", "program", "bimanual", "tool-use", "dosing", "franka", "puzzle.syringe.bimanual_franka.osc"]
+
+[metadata]
+task_type = "policy" # the deliverable is a program, run by the verifier (PROTOCOL H.1)
+simulator = "embodiedswe" # EmbodiedSWE's robobench on Isaac Lab 2.3.2 / Isaac Sim 5.1, GPU PhysX
+robot = "franka-panda-bimanual"
+family = "puzzle.syringe.bimanual_franka.osc"
+dynamics = "static"
+oracle = "none"
+oracle_evidence = "No reference solution in the repository, and none written for this scene yet; the build, the start-state hash and a do-nothing run scoring 0 are checked."
+instance_seed = 0
+upstream_commit = "67f44e8a2ca51c3e133867e5e669377778e8f97d"
+expert_time_estimate_hours = 4.0
+
+[verifier]
+timeout_sec = 122550.0 # (64 checkpoints + final) x (1800 + 30 grace) + video (900 + 1800 + 600) + 300
+environment_mode = "separate"
+network_mode = "no-network"
+
+# Resources (PROTOCOL §6): seal the monitor's record first.
+[[verifier.collect]]
+service = "rcb_monitor"
+command = "python3 /opt/rcb_monitor/monitor.py seal --wait 90"
+timeout_sec = 120
+
+[agent]
+timeout_sec = 14400.0
+network_mode = "allowlist"
+allowed_hosts = ["chatgpt.com", "*.chatgpt.com", "auth.openai.com", "api.openai.com", "*.openai.com", "api.anthropic.com", "*.anthropic.com", "openrouter.ai", "*.openai.azure.com", "*.cognitiveservices.azure.com", "pypi.org", "files.pythonhosted.org", "deb.debian.org", "security.debian.org", "archive.ubuntu.com", "security.ubuntu.com", "snapshot.ubuntu.com"]
+
+[environment]
+build_timeout_sec = 5400.0
+cpus = 8
+memory_mb = 29696
+storage_mb = 10240
+gpu_types = ["L40S", "L40", "L4", "RTX 4090", "RTX 6000 Ada"]
+
+[verifier.environment]
+build_timeout_sec = 5400.0
+
+[verifier.env]
+RCB_LIMITS_ENFORCE = "${RCB_LIMITS_ENFORCE:-0}"
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/Dockerfile b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/Dockerfile
new file mode 100644
index 0000000000..1a65de4d1e
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/Dockerfile
@@ -0,0 +1,12 @@
+# Separate verifier sandbox (PROTOCOL H.1): the same base image, the verifier's own copy of the frozen instance and the
+# task's grader (EmbodiedSWE's, unchanged, at the pinned commit). /tests is root-only: the solution process (nobody)
+# cannot read it.
+FROM ghcr.io/mll-lab-nu/efe-private:embodiedswe-0.3.0
+COPY --from=ghcr.io/mll-lab-nu/efe:embodiedswe-files-0.3.0@sha256:7980b458441ec1c964fec6ede5e5f6b914e81134daa4062fc0c4a5ebdc3c099b /rcb_embodiedswe.py /esw_proxy.py /opt/efe/
+COPY grade.py instance.json test.sh /tests/
+COPY grader/ /tests/grader/
+RUN chmod 700 /tests && chmod +x /tests/test.sh && mkdir -p /app/output /logs/verifier
+WORKDIR /tests
+# resources (PROTOCOL §6) # rcb-monitor
+COPY --from=ghcr.io/mll-lab-nu/efe:monitor-0.5.0@sha256:ecc5f24f1516ca11711d7c2d3ac07c89f79cd9220812c1244498ec71e352402a /opt/rcb_monitor/rcb_limits.py /tests/rcb_limits.py
+COPY rcb_limits.json /tests/rcb_limits.json
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
new file mode 100644
index 0000000000..28cc5cf9e5
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/docker-compose.yaml
@@ -0,0 +1,16 @@
+# The verifier runs Isaac Sim, which needs the GPU. Its Kit cache is a TRUSTED volume (Kit imports generated Python from it).
+services:
+ main:
+ x-gpu-memory-gb: 16 # GiB # rcb-monitor
+ shm_size: "8gb"
+ volumes:
+ - esw_cache_trusted:/cache
+ deploy:
+ resources:
+ reservations:
+ devices:
+ - driver: nvidia
+ count: 1
+ capabilities: [gpu]
+volumes:
+ esw_cache_trusted:
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grade.py b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grade.py
new file mode 100644
index 0000000000..21043538d0
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grade.py
@@ -0,0 +1,358 @@
+"""Verifier entry point of an EmbodiedSWE task, as EmbodiedSWE's harbor verifier grades: every submitted checkpoint
+(`submit`, /app/output/submissions/NNNNNN/) and the final /app/output/solution/ are candidates; each distinct one runs
+its `solve(env)` once against a fresh simulator built from the frozen instance; the best one is the result.
+
+ python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/<scene>.py
+
+1. candidates - the submissions in name order (at most 64), then `final`. Each is checked (a solve.py; for a submission,
+ its files equal its receipt, submission.json) and frozen into a root-owned copy before any of them
+ runs; one that fails a check scores 0 (`invalid_submission`, `missing_solution`). Byte-identical
+ candidates (the same content hash) are graded once: a later one takes the earlier one's result.
+2. rollout - per distinct candidate, a fresh process (`rcb_embodiedswe.py rollout`, the image's tooling; the grader
+ comes from this directory): the trusted simulator builds the env from the frozen instance (GPU PhysX),
+ compares its start state, attaches the task's grader (EmbodiedSWE's rubric, recorded after every step)
+ and serves the candidate's `solve`, which runs in ANOTHER process as `nobody` without network or GPU,
+ through a proxy that answers reads with copies, executes `env.step(action)` and refuses everything
+ else. The candidate's limit is EmbodiedSWE's: ROLLOUT_S of wall clock for the whole process (start-up
+ and import count); then SIGTERM: the solve is ended and the verdict read on the state at that moment;
+ GRACE_S later, SIGKILL. success = the grader's end predicate (`check_success`), progress = its rubric
+ score (peak recorded progress). A process that ends without a result while solving scores 0 (the
+ candidate's); in any other phase it is the verifier's error.
+3. selection - the candidate with the highest progress (EmbodiedSWE's score); ties go to higher success, then to a
+ graded candidate over one that never ran, then to the earliest (`final` is last). reward.txt and
+ reward.json give that one candidate's success and progress; results.json lists every candidate.
+4. video - only after reward.txt / reward.json are written: the selected candidate's trajectory (its actions and
+ recorded states, trajectory.npz) is rendered by posing its states (replay.mp4), after a camera replay
+ of its actions as a diagnostic (video.json). Neither changes the verdict.
+
+Whose failure a 0 is (`grader_error` and `infra_error` are always present):
+- the candidate's: no solve.py, a receipt that does not match, no action, a final state that does not meet the goal
+ (whether solve returned, raised, timed out or sent a malformed action), or, in a task with a tool-only rule, the
+ robot's hand touching the payload (`disqualified`);
+- the verifier's (`infra_error` = 1, no verdict on the agent): the rebuilt instance not matching the frozen one on the
+ GPU model that froze it (`instance_mismatch`), a rollout that ends without a result outside its solve, any error here.
+
+Timeout of the whole verifier (task.toml): (64 + 1) x (ROLLOUT_S + GRACE_S) + VIDEO_S + 300 = 122,550 s.
+"""
+from __future__ import annotations
+
+import argparse
+import hashlib
+import json
+import os
+import shutil
+import signal
+import stat
+import subprocess
+import sys
+import time
+import traceback
+
+LOG_DIR = os.environ.get("RCB_VERIFIER_LOG_DIR", "/logs/verifier")
+TOOL = "/opt/efe/rcb_embodiedswe.py"
+WORK = "/var/lib/esw"
+ROLLOUT_S = 1800.0 # EmbodiedSWE's rollout_timeout_sec: the whole candidate process
+GRACE_S = 30.0 # EmbodiedSWE's termination_grace_sec: SIGTERM, then SIGKILL
+MAX_SUBMISSIONS = 64 # EmbodiedSWE's max_submissions
+VIDEO_S = 900.0 + 1800.0 + 600.0 # the video process: start-up with cameras + camera replay budget + posing
+REPLAY_BUDGET_S = 1800.0
+NOBODY = 65534
+ERR = {"success": 0, "progress": 0.0, "grader_error": 1, "infra_error": 1}
+
+
+class EvaluationError(RuntimeError):
+ pass
+
+
+def write(ok: bool, out: dict) -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ open(os.path.join(LOG_DIR, "reward.txt"), "w").write("1\n" if ok else "0\n")
+ json.dump(out, open(os.path.join(LOG_DIR, "reward.json"), "w"))
+ print(json.dumps(out), flush=True)
+
+
+def note(msg: str) -> None:
+ print(f"[grade] {msg}", file=sys.stderr, flush=True)
+
+
+# ------------------------------------------------------------------------------------------------ candidates
+def inventory(root: str) -> dict[str, str]:
+ """{relative path: sha256} of every regular file (esw_submit.py's receipt format). Links and special files are not
+ part of a solution (the rollout copies regular files only), so they are left out here too."""
+ out = {}
+ for dirpath, dirnames, filenames in os.walk(root, followlinks=False):
+ for name in sorted(filenames):
+ p = os.path.join(dirpath, name)
+ if not stat.S_ISREG(os.lstat(p).st_mode):
+ continue
+ h = hashlib.sha256()
+ with open(p, "rb") as f:
+ for chunk in iter(lambda: f.read(1 << 20), b""):
+ h.update(chunk)
+ out[os.path.relpath(p, root).replace(os.sep, "/")] = h.hexdigest()
+ return dict(sorted(out.items()))
+
+
+def content_hash(files: dict[str, str]) -> str:
+ return hashlib.sha256(json.dumps(files, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
+
+
+def candidates(submissions: str, final: str) -> list[dict]:
+ """The submissions in name order, then `final`; every entry says where its solution is and whether it may run."""
+ found = []
+ if os.path.isdir(submissions) and not os.path.islink(submissions):
+ for name in sorted(os.listdir(submissions)):
+ if not name.isdecimal():
+ continue
+ path = os.path.join(submissions, name)
+ e = {"submission": name, "path": os.path.join(path, "solution")}
+ if len(name) != 6 or os.path.islink(path) or not os.path.isdir(path):
+ e["status"] = "invalid_submission"
+ e["error"] = "not a NNNNNN directory"
+ if len(found) >= MAX_SUBMISSIONS:
+ e["status"], e["error"] = "over_limit", f"more than {MAX_SUBMISSIONS} submissions: not graded"
+ found.append(e)
+ found.append({"submission": "final", "path": final})
+ return found
+
+
+def freeze(entries: list[dict], inputs: str) -> None:
+ """Check and freeze every candidate (root-owned, read-only copies) before any of them runs."""
+ for e in entries:
+ e.update(score=0.0, success=0)
+ if e.get("status"):
+ continue
+ sol = e["path"]
+ entry = os.path.join(sol, "solve.py")
+ if not (os.path.isdir(sol) and not os.path.islink(sol) and os.path.isfile(entry) and not os.path.islink(entry)):
+ e["status"] = "missing_solution"
+ continue
+ try:
+ files = inventory(sol)
+ digest = content_hash(files)
+ if e["submission"] != "final":
+ receipt = json.load(open(os.path.join(os.path.dirname(sol), "submission.json")))
+ if not isinstance(receipt, dict) or receipt.get("schema_version") != 1:
+ raise ValueError("invalid submission receipt")
+ if receipt.get("files") != files or receipt.get("sha256") != digest:
+ raise ValueError("the snapshot's files differ from its receipt")
+ e["note"] = str(receipt.get("note", ""))[:500]
+ e["created_at"] = str(receipt.get("created_at", ""))[:64]
+ if len(files) > 20_000:
+ raise ValueError("more than 20,000 files")
+ except (OSError, ValueError) as exc:
+ e.update(status="invalid_submission", error=str(exc)[:500])
+ continue
+ frozen = os.path.join(inputs, e["submission"])
+ shutil.copytree(sol, frozen, symlinks=True) # a storage failure here is the verifier's error
+ if inventory(frozen) != files:
+ raise EvaluationError("a solution changed while it was frozen")
+ for dirpath, _, filenames in os.walk(frozen):
+ os.chmod(dirpath, 0o755)
+ for f in filenames:
+ os.chmod(os.path.join(dirpath, f), 0o644)
+ e.update(sha256=digest, frozen=frozen)
+
+
+# ------------------------------------------------------------------------------------------------ one rollout
+def kill_uid(uid: int = NOBODY) -> None:
+ """End every process of `uid` (a solution the rollout process could not end itself), from a child of that uid."""
+ if os.geteuid() != 0:
+ return
+ pid = os.fork()
+ if pid == 0:
+ try:
+ os.setgid(uid)
+ os.setuid(uid)
+ for _ in range(3):
+ try:
+ os.kill(-1, signal.SIGKILL)
+ except ProcessLookupError:
+ pass
+ time.sleep(0.2)
+ finally:
+ os._exit(0)
+ os.waitpid(pid, 0)
+
+
+def _killpg(pid: int, sig: int) -> None:
+ try:
+ os.killpg(pid, sig)
+ except ProcessLookupError:
+ pass
+
+
+def rollout(a, e: dict, out_dir: str) -> dict:
+ """One candidate's graded run, as EmbodiedSWE's run_rollout: ROLLOUT_S, then SIGTERM, GRACE_S, then SIGKILL."""
+ os.makedirs(out_dir)
+ cmd = [sys.executable, TOOL, "rollout", "--instance", a.instance, "--grader", a.grader, "--solution", e["frozen"],
+ "--out", out_dir, "--timeout", str(ROLLOUT_S), "--label", e["submission"]]
+ timed_out = False
+ t0 = time.time()
+ with open(os.path.join(LOG_DIR, "rollout.log"), "ab") as lf:
+ lf.write(f"\n===== candidate {e['submission']}\n".encode())
+ lf.flush()
+ proc = subprocess.Popen(cmd, stdout=lf, stderr=lf, start_new_session=True, env={**os.environ})
+ try:
+ try:
+ code = proc.wait(timeout=ROLLOUT_S)
+ except subprocess.TimeoutExpired:
+ timed_out = True
+ _killpg(proc.pid, signal.SIGTERM)
+ try:
+ code = proc.wait(timeout=GRACE_S)
+ except subprocess.TimeoutExpired:
+ _killpg(proc.pid, signal.SIGKILL)
+ code = proc.wait()
+ finally:
+ _killpg(proc.pid, signal.SIGKILL) # nothing of this candidate bleeds into the next one
+ kill_uid()
+ proc.wait()
+ res = None
+ try:
+ res = json.load(open(os.path.join(out_dir, "rollout.json")))
+ except (OSError, ValueError):
+ pass
+ meta = {"exit_code": code, "timed_out": int(timed_out), "process_wall_s": round(time.time() - t0, 1)}
+ if not isinstance(res, dict):
+ try:
+ phase = json.load(open(os.path.join(out_dir, "phase.json")))["phase"]
+ except (OSError, ValueError, KeyError, TypeError):
+ phase = "unknown"
+ if phase == "solve" and (timed_out or code >= 0):
+ why = "exceeded its time limit" if timed_out else f"exited ({code})"
+ return {**meta, "status": "no_verdict", "score": 0.0, "success": 0, "phase": phase,
+ "solution_error": f"the candidate's run {why} without a verdict"}
+ raise EvaluationError(f"candidate {e['submission']}: the rollout process ended in {phase} without a result "
+ f"(exit {code}, timed out {timed_out})")
+ if res.get("infra_error") or res.get("phase") != "done":
+ raise EvaluationError(f"candidate {e['submission']}: rollout gave no verdict: {json.dumps(res)[:2000]}")
+ return {**meta, "status": "graded", "score": round(float(res.get("progress") or 0.0), 4),
+ "success": int(bool(res.get("success"))), "rollout": res}
+
+
+# ------------------------------------------------------------------------------------------------ the verdict
+def numbers(e: dict) -> dict:
+ """reward.json's fields for the selected candidate (numbers only)."""
+ ro = e.get("rollout") or {}
+ status = ro.get("solve_status", "")
+ out = {"selected_submission": 0 if e["submission"] == "final" else int(e["submission"]),
+ "selected_final": int(e["submission"] == "final"),
+ "missing_solution": int(e.get("status") == "missing_solution"),
+ "invalid_submission": int(e.get("status") == "invalid_submission"),
+ "no_verdict": int(e.get("status") == "no_verdict"),
+ "no_actions": int(e.get("status") == "graded" and int(ro.get("n_actions", 0)) == 0),
+ "solve_error": int(status == "error"), "solve_timeout": int(status == "timeout"),
+ "solve_process_ended": int(status == "process_ended"), "bad_action": int(ro.get("bad_actions", 0) > 0),
+ "n_actions": int(ro.get("n_actions", 0)), "step_errors": int(ro.get("step_errors", 0)),
+ "solve_wall_s": float(ro.get("solve_wall_s", 0.0)), "boot_s": float(ro.get("boot_s", 0.0)),
+ "rollout_ms_per_step": float(ro.get("ms_per_step", 0.0)),
+ "instance_ok": int(ro.get("instance_ok", 0)), "instance_same_gpu": int(ro.get("instance_same_gpu", 0)),
+ "instance_within_tol": int(ro.get("instance_within_tol", 0)),
+ "instance_max_abs_diff": float(ro.get("instance_max_abs_diff", 0.0)),
+ "proxy_requests": int(ro.get("requests", 0)), "proxy_refused": int(ro.get("refused", 0))}
+ if ro.get("tool_only"):
+ out.update(tool_only=1, disqualified=int(ro.get("disqualified", 0) or 0),
+ tool_contact=int(ro.get("tool_contact", 0) or 0))
+ return out
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--instance", required=True)
+ ap.add_argument("--grader", required=True)
+ ap.add_argument("--solution", default="/app/output/solution")
+ ap.add_argument("--submissions", default="/app/output/submissions")
+ ap.add_argument("--no-video", action="store_true")
+ a = ap.parse_args()
+ t0 = time.time()
+ try:
+ shutil.rmtree(WORK, ignore_errors=True)
+ os.makedirs(os.path.join(WORK, "inputs"), mode=0o755)
+ entries = candidates(a.submissions, a.solution)
+ freeze(entries, os.path.join(WORK, "inputs"))
+ seen: dict[str, dict] = {}
+ for e in entries:
+ if not e.get("frozen"):
+ continue
+ prev = seen.get(e["sha256"])
+ if prev is not None:
+ e.update(status="duplicate", duplicate_of=prev["submission"], score=prev["score"],
+ success=prev["success"])
+ continue
+ r = rollout(a, e, os.path.join(WORK, "rollouts", e["submission"]))
+ e.update(r)
+ seen[e["sha256"]] = e
+ note(f"candidate {e['submission']}: {e['status']} progress {e['score']} success {e['success']}")
+ json.dump({"candidates": [{k: v for k, v in x.items() if k != "rollout"} for x in entries]},
+ open(os.path.join(LOG_DIR, "progress.json"), "w"), indent=1)
+ # EmbodiedSWE's selection: the highest score, then success; the first such (the earliest; final is last).
+ # A tie between a candidate that ran and one that never did goes to the one that ran (its run is the video).
+ best = max(entries, key=lambda x: (x["score"], x["success"], x.get("status") in ("graded", "duplicate")))
+ source = seen.get(best.get("sha256", ""), best) if best.get("status") == "duplicate" else best
+ out = {"success": int(best["success"]), "progress": float(best["score"]), "grader_error": 0, "infra_error": 0,
+ "n_candidates": len(entries), "n_graded": len(seen), **numbers(source)}
+ out["selected_submission"] = 0 if best["submission"] == "final" else int(best["submission"])
+ out["selected_final"] = int(best["submission"] == "final")
+ results = {"selected_submission": best["submission"], "video_from": source["submission"],
+ "reward": {"success": out["success"], "progress": out["progress"]},
+ "candidates": [{k: v for k, v in x.items() if k not in ("path", "frozen")} for x in entries],
+ "limits": {"rollout_timeout_sec": ROLLOUT_S, "termination_grace_sec": GRACE_S,
+ "max_submissions": MAX_SUBMISSIONS}}
+ json.dump(results, open(os.path.join(LOG_DIR, "results.json"), "w"), indent=1)
+ src_dir = os.path.join(WORK, "rollouts", source["submission"])
+ for f in ("trajectory.npz", "rollout.json", "solve.log"):
+ if os.path.isfile(os.path.join(src_dir, f)):
+ shutil.copyfile(os.path.join(src_dir, f), os.path.join(LOG_DIR, f))
+ for x in entries:
+ ro = x.get("rollout") or {}
+ if ro.get("step_errors"):
+ note(f"candidate {x['submission']}: env.step raised {ro['step_errors']} time(s), first at action "
+ f"{ro.get('step_error_at')}: {str(ro.get('step_error'))[:1000]}")
+ if ro and not ro.get("instance_ok"):
+ note(f"candidate {x['submission']}: start state differs from the frozen hash on GPU "
+ f"{ro.get('gpu_model')!r} (frozen on {ro.get('instance_gpu')!r}): max abs difference "
+ f"{ro.get('instance_max_abs_diff')}")
+ out["verifier_wall_s"] = round(time.time() - t0, 1)
+ write(bool(out["success"]), out)
+ except Exception: # noqa: BLE001 — EvaluationError or anything else: the verifier's, no verdict on the agent
+ traceback.print_exc(file=sys.stderr)
+ write(False, {**ERR, "verifier_wall_s": round(time.time() - t0, 1)})
+ return 0
+ traj = os.path.join(LOG_DIR, "trajectory.npz")
+ if a.no_video or not os.path.isfile(traj):
+ return 0
+ v = None
+ with open(os.path.join(LOG_DIR, "video.log"), "ab") as lf:
+ try:
+ p = subprocess.run([sys.executable, TOOL, "video", "--instance", a.instance, "--traj", traj,
+ "--video", os.path.join(LOG_DIR, "replay.mp4"),
+ "--final-sha", str((source.get("rollout") or {}).get("final_sha") or ""),
+ "--replay-budget", str(REPLAY_BUDGET_S)],
+ stdout=subprocess.PIPE, stderr=lf, timeout=VIDEO_S, start_new_session=True)
+ for line in p.stdout.decode(errors="replace").splitlines():
+ if line.startswith("{"):
+ try:
+ v = json.loads(line)
+ except ValueError:
+ pass
+ lf.write(p.stdout[-200_000:])
+ except subprocess.TimeoutExpired:
+ note("the video process overran its limit: no video")
+ v = v if isinstance(v, dict) else {}
+ if v.get("error"):
+ note(f"the video process failed: {str(v['error'])[-1500:]}")
+ json.dump({"video_source": "recorded_states", "video_from": source["submission"],
+ "video_ok": int(v.get("video_ok", 0) or 0), "frames": int(v.get("frames", 0) or 0),
+ "camera_replay": v.get("camera_replay", "not_run"),
+ "camera_replay_match": int(v.get("camera_replay_match", 0) or 0),
+ "camera_replay_success": int(v.get("camera_replay_success", 0) or 0),
+ "camera_replay_s": float(v.get("camera_replay_s", 0.0) or 0.0),
+ "camera_instance_ok": int(v.get("camera_instance_ok", 0) or 0),
+ "frames_nonfinite": int(v.get("frames_nonfinite", 0) or 0)},
+ open(os.path.join(LOG_DIR, "video.json"), "w"))
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grader/syringe_dosing.py b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grader/syringe_dosing.py
new file mode 100644
index 0000000000..2841d8fe88
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/grader/syringe_dosing.py
@@ -0,0 +1,60 @@
+"""Grader for the syringe scene: a full draw, one in-band dose in each of three tubes, syringe laid back down.
+
+Rubric stages (weights and modes live in RUBRIC):
+ drawn the draw: 1 once the scene's `_drawn_ok` latch is set (liquid >= `draw_min` while
+ seated on the reservoir); before that, the liquid in the barrel as a linear ramp
+ from empty (0) to `draw_min`. A milestone — the liquid is dispensed afterwards
+ dosed fraction over the three identical tubes: a tube inside the scene's `dose_band`
+ counts 1; below the band, the dose as a linear ramp from 0 to the band's lower
+ edge; pushed past the band it counts 0 — wells never un-fill, so an over-dose is
+ the scene's irreversible ruin of that tube. Live: an over-push drops a tube
+ parked the scene's `success()`: syringe lying at its home spot, on the shelf, settled
+ (`parked`) — GATED on the draw + all three doses. The syringe SPAWNS parked, so
+ the park only counts once the dosing it concludes is done (else it is free credit)
+Success is the scene's own `success()` (drawn AND doses_ok AND parked) on the final state.
+"""
+
+from __future__ import annotations
+
+from robobench.core import BaseGrader
+from robobench.suites.puzzle.scenes.syringe_dosing import SyringeDosingScene
+
+
+class SyringeDosingGrader(BaseGrader):
+ """A full draw from the reservoir, an in-band dose in each of the three tubes, and the syringe laid back at its spot.
+
+ Ladder: full draw 0.20 · 1 dose 0.40 · 2 doses 0.60 · 3 doses 0.80 · parked 1.00
+ """
+
+ SCENE = SyringeDosingScene
+ # dosed x3: three identical tubes, one unit of credit per tube — the same unit as the draw
+ # and the park (the egg-carton ladder: each egg a step, the lid the last step)
+ RUBRIC = (("drawn", 1, "once"), ("dosed", 3), ("parked", 1))
+ scene: SyringeDosingScene
+
+ def setup(self) -> None:
+ pass # every quantity is a scene ledger; nothing to capture at reset
+
+ def check_success(self):
+ return self.scene.success() # drawn AND doses_ok AND parked — live
+
+ # ---- rubric stages — each returns a (num_envs,) value in [0, 1] --------------------------
+ def drawn(self):
+ import torch
+
+ s = self.scene
+ ramp = (s.liquid() / s.cfg.draw_min).clamp(0.0, 1.0)
+ return torch.where(s.drawn(), torch.ones_like(ramp), ramp)
+
+ def dosed(self):
+ import torch
+
+ s = self.scene
+ lo, hi = s.cfg.dose_band
+ d = s.doses() # (num_envs, 3) fraction of capacity per tube
+ ramp = (d / lo).clamp(0.0, 1.0)
+ per_tube = torch.where(d > hi, torch.zeros_like(d), ramp) # in band -> ramp is 1
+ return per_tube.mean(dim=1)
+
+ def parked(self):
+ return self.scene.success().float()
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/instance.json b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/instance.json
new file mode 100644
index 0000000000..ed064a6880
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/instance.json
@@ -0,0 +1,232 @@
+{
+ "action_dim": 16,
+ "control_dt": 0.066667,
+ "device": "cuda:0",
+ "format": "esw-instance/1",
+ "gpu_model": "NVIDIA L40S",
+ "physics_dt": 0.008333333333333333,
+ "preset": "puzzle.syringe.bimanual_franka.osc",
+ "seed": 0,
+ "start_state": {
+ "layout": [
+ [
+ "/articulation/left/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/left/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/left/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/right/joint_position",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/joint_velocity",
+ [
+ 1,
+ 9
+ ]
+ ],
+ [
+ "/articulation/right/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/right/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/articulation/syringe/joint_position",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/syringe/joint_velocity",
+ [
+ 1,
+ 1
+ ]
+ ],
+ [
+ "/articulation/syringe/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/articulation/syringe/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/rack/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/rack/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ],
+ [
+ "/rigid_object/reservoir/root_pose",
+ [
+ 1,
+ 7
+ ]
+ ],
+ [
+ "/rigid_object/reservoir/root_velocity",
+ [
+ 1,
+ 6
+ ]
+ ]
+ ],
+ "vector": [
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.2800000011920929,
+ 0.41999998688697815,
+ 0.7099999785423279,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.001500000013038516,
+ -0.19699999690055847,
+ -0.00139999995008111,
+ -1.9759999513626099,
+ -0.0002800000074785203,
+ 1.7799999713897705,
+ 0.7860000133514404,
+ 0.03999999910593033,
+ 0.03999999910593033,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.2800000011920929,
+ 0.41999998688697815,
+ 0.7099999785423279,
+ 0.7071068286895752,
+ 0.0,
+ 0.0,
+ -0.7071068286895752,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.05999999865889549,
+ -0.07999999821186066,
+ 0.7942000031471252,
+ 0.5,
+ -0.5,
+ 0.5,
+ -0.5,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ -0.0030286055989563465,
+ 0.14050038158893585,
+ 0.7491999864578247,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.15416723489761353,
+ -0.04127092286944389,
+ 0.7742000222206116,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ },
+ "state_sha": "2a7447886826f62cb02e55f5d1231071a64cab07c23d09ec5d5232f3f4679976"
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
new file mode 100644
index 0000000000..391861d13a
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/rcb_limits.json
@@ -0,0 +1,23 @@
+{
+ "agent_timeout_sec": 14400,
+ "caps": {
+ "main": {
+ "cpus": 8.0,
+ "disk_gb": 10.0,
+ "gpu_memory_gb": 16.0,
+ "memory_gb": 29.0,
+ "pids": 16384
+ }
+ },
+ "disk_gb": 10.0,
+ "disk_tick_sec": 60,
+ "format": "rcb-limits/2",
+ "gpu": true,
+ "gpu_memory_gb": 16.0,
+ "mode": "privileged",
+ "scope_services": [
+ "main"
+ ],
+ "task": "embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged",
+ "tick_sec": 5
+}
diff --git a/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/test.sh b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/test.sh
new file mode 100755
index 0000000000..11a24b9d93
--- /dev/null
+++ b/tasks/embodiedswe/embodiedswe-puzzle-syringe-bimanual-franka-osc-i00-privileged/tests/test.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Verifier: grade every submitted checkpoint (/app/output/submissions/) and the final /app/output/solution/ against the
+# frozen instance (the tests/ copy), each in a fresh simulator; the best one is the result. Writes
+# /logs/verifier/reward.txt (1/0), reward.json (numbers only), results.json (every candidate), trajectory.npz and the video.
+rm -rf /logs/verifier/* /logs/verifier/.[!.]* # verdicts from an earlier run never survive (docs/protocol/README.md §2.6)
+trap 'p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py verify' EXIT # resources, after the grader (PROTOCOL §6)
+p=$(command -v python3 || command -v python); "$p" /tests/rcb_limits.py sanitize /app/output || true # untrusted agent files (PROTOCOL H.1)
+mkdir -p /logs/verifier
+chmod 700 /logs/verifier # the solution process (nobody) can neither read nor write the logs
+python /tests/grade.py --instance /tests/instance.json --grader /tests/grader/syringe_dosing.py 2> /logs/verifier/grade.log