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.
Python ai-agentsbenchmarkcoding-agentsembodied-aievaluationharborllm-agentsrobot-learningroboticssimulation
RoboTangle: public image 0.2.21, one GPU per container, libuipc for sm_86, grader fix (follow-up to #81) (#99)
Qineng Wang08aeb72726c8
diff --git a/docs/benchmarks/robotangle.md b/docs/benchmarks/robotangle.mdindex 16d3911609..4b205a35d6 100644--- a/docs/benchmarks/robotangle.md+++ b/docs/benchmarks/robotangle.md@@ -15,8 +15,8 @@ Renaming them would change the hashes every task is bound to.(`franka-robotiq-2f85`; 8-D) in hedgehog_in_cage, lock_picking, buzz_wire_3d and fiber_bundling.- Physics:- CPU float64 rigid bodies (bit-deterministic on one host): cast_coil, cast_keyhole, hedgehog_in_cage,- horseshoe_ring, buzz_wire_3d, fiber_bundling;- - GPU fp32 rigid: lock_picking, interlocked_claws;+ interlocked_claws, horseshoe_ring, buzz_wire_3d, fiber_bundling;+ - GPU fp32 rigid: lock_picking;- IPC deformables with deterministic libuipc patches: rope_threading, knot_untying;- PBD cloth: blanket_flatten.- Grasping: an assisted grasp (`contact_weld_v1` and similar, metadata `grasp`) where the family uses one; physical@@ -47,9 +47,13 @@ Each task carries copies of the tooling (`rcb_topogym.py`), the graders and the`runtime_binding.json` binds:- the frozen instance (canonical JSON hash and asset hashes), which keeps its creation source as provenance;- the tooling hash;-- the release runtime: the public simulator source, python, five pinned dependencies and the audited libuipc build.+- the release runtime: the public simulator source, python, five pinned dependencies and the audited libuipc build;+- `uipc_builds`: both libuipc builds of the image by their `uipc-build.json` sha256, the audited wheel and the sm_86 build+ (Image, GPU architecture).-Every session refuses to start in an image whose installed runtime differs from it.+Every session refuses to start in an image whose installed runtime differs from it, whose libuipc builds are not those+two, or whose libuipc build in use is not the one the rule picks for the GPU. The session's `runtime_binding` names that+build (`uipc_build`).## Large files: the private HF dataset@@ -57,8 +61,9 @@ The frozen instances (`instance.json` + `instance_assets/`: archived IPC settledfile; 52 bases, 173 MB) are **not in git** (CONTRIBUTING: no files > 2 MB). Owner decision, 2026-10-08. They live in theprivate Hugging Face dataset `eai-v2-internal/robotangle-assets`, pinned by commit and by the sha256 of every file in`scripts/robotangle/assets.json` (`scripts/robotangle/assets.py fetch|check|pin`). The same dataset holds the image's build-inputs: the release tree (`git archive` of `2dafa5f2b`, the paths the image copies) and the audited libuipc wheel with its-`uipc-build.json` (recovered byte-for-byte from the wheel layer of the 0.2.17 image; its sha256 matches the build record).+inputs: the release tree (`git archive` of `2dafa5f2b`, the paths the image copies), the audited libuipc wheel with its+`uipc-build.json` (recovered byte-for-byte from the wheel layer of the 0.2.17 image; its sha256 matches the build record)+and, since 0.2.21, the sm_86 build of the same recipe with its `uipc-build.json` (Image, GPU architecture).- The image carries every instance under `/opt/robotangle/instances/<base>/`.- A task directory keeps only `runtime_binding.json` (instance canonical sha256 + every asset's sha256 + tooling + runtime),so a task's identity (its dataset digest) still pins its instance.@@ -70,14 +75,68 @@ inputs: the release tree (`git archive` of `2dafa5f2b`, the paths the image copi- Access: members of `eai-v2-internal` (`hf auth login` or `HF_TOKEN`). Only image builders need it; eval hosts pull theimage.-## Image (BUILD_ONLY)--`ghcr.io/mll-lab-nu/eai-robotangle:<images/robotangle/VERSION>` (0.2.19). It is never public: the Nyx renderer-is installed from binary wheels on PyPI (`gs-nyx`) that carry no licence metadata, and this is an internal release.-0.2.19 is pushed as a non-public organisation package (visibility `internal`, org members only; digest-`sha256:66b8b157d350…`), like the other BUILD_ONLY images. Build instructions are in images/robotangle/BUILD_ONLY: the-context comes from the pinned HF dataset, so the build needs neither `dev/jianwen` nor an unpublished wheel. One image and one version-serve both modes:+## Image++`ghcr.io/mll-lab-nu/eai-robotangle:<images/robotangle/VERSION>` (0.2.21) is a public image, pushed by the maintainers after+validation. It contains Genesis AI's Nyx renderer (the `gs-nyx` wheels on PyPI); the benchmark owner has permission to+redistribute it in this image.++0.2.21 is 0.2.19 plus the NVIDIA Vulkan ICD and EGL vendor files and the sm_86 libuipc build (GPU architecture, below).+0.2.20, 0.2.19 plus the ICD and EGL files only, was built for validation and never pushed. 0.2.19 was an internal+organisation package. The build context comes from the private HF dataset (Large files, above). That dataset stays+internal; only the built image is public. Build instructions are in images/robotangle/README.md.++**GPU:** every task container gets exactly one GPU through its compose device reservation (`count: 1`,+`capabilities: [gpu]`) and no `runtime: nvidia`, as in `images/robopaint/`.+- NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, and the image's ICD+ files point the Vulkan and EGL loaders at them. On a host whose toolkit injects devices through CDI (e.g. lab: Docker+ 29.8 with nvidia-cdi-hook), the toolkit also mounts the host's `/etc/vulkan/icd.d/nvidia_icd.json`, and Vulkan listed+ the same GPU twice; the image sets `VK_ICD_FILENAMES` to its own ICD file, so it lists one.+- With `runtime: nvidia`, the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU of the host. Nyx crashes when two+ are visible.+- `count: 1` is always host GPU 0: Docker turns `count: N` into device IDs `0..N-1`, so on a multi-GPU host every agent,+ sim and verifier container lands on GPU 0 unless the runner pins GPUs. Two ways to use more GPUs:+ - one GPU per host or VM;+ - per-lane copies of the task directories whose reservations name the lane's GPU (`device_ids`), including+ `tests/docker-compose.yaml`. These copies are never committed (PROTOCOL §2.4).+- VRAM and concurrency:+ - an IPC sim (knot_untying, rope_threading) needs about 9-10 GB and runs alone on a 24 GB GPU. Next to other RoboTangle+ sims on one 24 GB RTX 4090, IPC scene builds failed with CUDA out of memory;+ - blanket_flatten needs about 6 GB;+ - at most 2 rigid trials per GPU.+- GPU architecture. Every family renders with Nyx, which needs RT cores; knot_untying and rope_threading also run libuipc's+ CUDA kernels, which come in two builds of one recipe:++ | compute capability | GPUs (examples) | libuipc build | run on it so far |+ |---|---|---|---|+ | 8.9 (sm_89) | RTX 4090, L4, L40S, RTX 6000 Ada | the audited wheel: native sm_89 code | RTX 4090: nops, exact restores of rope and knot |+ | 12.x (sm_120) | RTX 5090, RTX PRO 6000 Blackwell | the audited wheel: native sm_120 code | RTX PRO 6000: every oracle evidence run |+ | 8.6 (sm_86) | RTX A6000, A40, A10, RTX 3090 | the sm_86 build: native sm_86 code | nothing yet: no such GPU was available |+ | 8.0, 9.0, 10.0 | A100, H100, H200, B200 | — | none: no RT cores, so Nyx cannot render and no RoboTangle task runs |++ - The audited wheel (`89-real;120-real;120-virtual`) has native code for sm_89 and sm_120 only, and its compute_120 PTX+ cannot run on an older GPU. It stays the build every 8.9 and 12.x GPU loads, so these GPUs run the same libuipc binary+ as every evidence run and check so far. The sm_86 build (`86-real;86-virtual`) is the same recipe with only the architecture list changed,+ and the same pyuipc version and source commit, which the frozen IPC settled states record, so they restore with it.+ Every other GPU loads it: native code on 8.6, its compute_86 PTX elsewhere (untested). A GPU of compute capability+ 7.5 (T4, RTX 20xx) can run neither build: its first IPC launch fails, and the sim ends with an infrastructure error.+ - Why two builds and not one wheel for all three: a single wheel of the same recipe built for sm_86, sm_89 and sm_120+ (2026-10-08) reproduced every host library and all 1216 sm_120 functions of the audited wheel byte for byte, but 8 of+ its 1230 sm_89 functions came out different (`make_spd<12>` and kernels of ExternalArticulationConstraint, the+ driving revolute and prismatic joints and the discrete-shell bending plasticity; the IPC coupler likely runs+ ExternalArticulationConstraint). An RTX 4090 would then run other IPC code than the audited wheel it was checked with,+ so that wheel is kept as evidence only (not in the image).+ - Selection (the tooling, `rcb_topogym.py` `select_uipc_build`): at Session start, before anything imports uipc, the+ tooling reads the visible GPU's compute capability through the CUDA driver API. 8.9 and 12.x keep the audited wheel in+ site-packages (`/opt/uipc-build.json`), so nothing changes there; any other GPU puts the sm_86 build's prefix+ (`/opt/uipc_sm86`) first on `sys.path`. A process that already imported uipc from the other build, or GPUs of mixed+ compute capability, are refused. `scripts/robotangle/release.json` `uipc_builds` records both builds, their rule,+ dataset folder and recipe; the sm_86 recipe is `images/robotangle/uipc-sm86-build/`.+ - The image build checks both wheels against their build records in the recipe's builder image (cuobjdump of nvcc+ 12.8: wheel, version and backend hashes, native kernels, PTX) and keeps the result in `/opt/uipc-check.json`.+ - The host driver must include the graphics (GL/Vulkan) user-space libraries, not a compute-only install.++One image and one version serve both modes:- the privileged environment and verifier `FROM` it;- the standard `sim` sidecar uses it;- the standard agent container and verifier use the shared client image pinned by digest.@@ -147,7 +206,8 @@ in official runs (PROTOCOL §5).Every task is `oracle = "full"`, by the owner's decision of 2026-10-07. Each base has a passing oracle run in both modes on anearlier build of this benchmark (the facts below). No oracle was re-run on this release's exact build (dev/jianwen-`2dafa5f2b`, source `ecb43962`, tooling `587043f1`). The previous release, `6b6804ae4` (source `8f12ee70`, tooling `ae724119`),+`2dafa5f2b`, source `ecb43962`, tooling `075ec08a`: the release template's `587043f1` plus the libuipc build selection).+The previous release, `6b6804ae4` (source `8f12ee70`, tooling `ae724119`),had no oracle re-runs either.The positive examples are recorded oracle runs that scored 1 in both modes:@@ -305,7 +365,9 @@ and work on families that are not shipped (5536fdfd6: slotted_post_ring and orbi1. ~~The audited libuipc wheel~~ done 2026-10-08: in the private HF dataset (Large files, above).2. ~~Build and check the image~~ done 2026-10-08: 0.2.19 built from the pinned dataset; its installed runtime equals- `release.json` `runtime` (the BUILD_ONLY check); every task image stages its instance and passes `check_inputs`.+ `release.json` `runtime` (the check in images/robotangle/README.md); every task image stages its instance and passes+ `check_inputs`. 0.2.21 (public; the GPU fix and the sm_86 libuipc build above) is to be validated the same way before+ it is pushed, on an RTX 4090 and an RTX PRO 6000.3. **Exact-restore preflight per frozen instance on that image.** Each instance was frozen by an earlier TopoGym sourceand is bound to this release's runtime; whether it restores bit-exactly here is not yet checked.4. **nop, both modes, every task, on this build (`2dafa5f2b`).** The records above are from earlier builds:@@ -318,6 +380,9 @@ and work on families that are not shipped (5536fdfd6: slotted_post_ring and orbimaintainers pre-generate and cache the blanket initial states on the eval hosts, so the 5–9 min generation is not onthe agent's clock, and spot-check easy / medium / hard generation before formal runs.7. **The tiers not in this release** (above).+8. **IPC on compute capability 8.6** (RTX A6000 class, the sm_86 libuipc build): compiled and audited, never run on such a+ GPU; none was available. GPU physics is not bit-identical across GPU models anyway, so the evidence from the RTX PRO 6000+ does not transfer bit for bit to any other GPU.## Protocol requests (raised in the proposal issue; decided 2026-10-08)@@ -330,5 +395,4 @@ and work on families that are not shipped (5536fdfd6: slotted_post_ring and orbi- Genesis 1.2.1: Apache-2.0.- libuipc: Apache-2.0.- ALOHA 2 and Robotiq 2F-85 models: MuJoCo Menagerie (BSD-3-Clause / per their LICENSE files).-- Nyx: binary wheels on PyPI without licence metadata; internal release, hence BUILD_ONLY (maintainers may keep a private- organisation package for internal runners).+- Nyx (Genesis AI, the `gs-nyx` wheels on PyPI): the benchmark owner has permission to redistribute it in the public image.diff --git a/images/robotangle/BUILD_ONLY b/images/robotangle/BUILD_ONLYdeleted file mode 100644index 407255199f..0000000000--- a/images/robotangle/BUILD_ONLY+++ /dev/null@@ -1,49 +0,0 @@-BUILD_ONLY: ghcr.io/mll-lab-nu/eai-robotangle:<images/robotangle/VERSION> is never public (docs/PROTOCOL.md §2.4, D5).-The maintainers keep it as a non-public organisation package (visibility internal, org members only): 0.2.19 is pushed-(sha256:66b8b157d350d28e43e0c43dbc9bd196a6d20a2e12b20fae57055bdeeb639590). Eval hosts pull it with an org login, or build it-locally under that tag from the pinned HF dataset below; Harbor finds it in the local Docker image store.--Why- The image contains Genesis AI's Nyx renderer (RoboTangle's RGB observations and replay videos), installed from binary- wheels on PyPI (gs-nyx) that carry no licence metadata. This is an internal release: every evaluation host builds the- image locally, and maintainers may keep a private organisation package for internal runners. The rest is Genesis 1.2.1 (Apache-2.0), libuipc (Apache-2.0) built with the determinism patches of the- release tree, PyTorch (BSD), the pinned pip locks of the release tree, the ALOHA 2 model (MuJoCo Menagerie, BSD-3-Clause)- and the Robotiq 2F-85 model (MuJoCo Menagerie).--What the image is built from- - images/robotangle/Dockerfile: images/topogym/Dockerfile of the release commit, UIPC_WHEEL defaulting to prebuilt, plus- a last stage with every task's frozen instance (/opt/robotangle/instances/<base>/) and stage_instance.py.- - The build context, prepared by scripts/robotangle/fetch_image_context.sh in images/robotangle/context/ (git-ignored)- from the private Hugging Face dataset eai-v2-internal/robotangle-assets at the revision pinned in- scripts/robotangle/assets.json, every file checked against its sha256 there:- image/release-2dafa5f2b.tar.gz the release tree (scripts/robotangle/release.json `release_commit`, dev/jianwen- 2dafa5f2b): `git archive` of the paths images/topogym/Dockerfile copies;- image/uipc-prebuilt/ the audited libuipc wheel and its uipc-build.json (sha256 39781d19…, the wheel every- lab evidence image installed; nvcc output is not bit-reproducible, so a wheel- compiled on your host never matches the binding);- instances/ every task's frozen instance (instance.json + instance_assets/).- Access: a member of eai-v2-internal, `hf auth login` (or HF_TOKEN in the environment; never printed).--Host- blanket_flatten: on a GPU other than the one its frozen PBD states were prepared on (an RTX PRO 6000 Blackwell), the- task generates the birth state from the recipe frozen in the instance. It caches the state inside the container- ($TOPOGYM_INITIAL_STATE_CACHE, default /opt/rcb-cache), so a fresh container generates it again. Standard mode- generates in the sim startup (5-9 min for very_easy, on the agent's clock). Generated states are not oracle-validated- (docs/benchmarks/robotangle.md, GPU portability). The other families run on any supported GPU.- Linux x86_64 (not WSL: Nyx needs the NVIDIA Vulkan driver inside the container), an NVIDIA GPU with driver >= 580, Docker- with BuildKit (default `docker` driver) and the NVIDIA Container Toolkit with the `nvidia` runtime registered (the task- compose files use `runtime: nvidia` with NVIDIA_DRIVER_CAPABILITIES=all for Vulkan). Exactly one GPU per container (two- visible GPUs crash Nyx). Build: about 25 GB of free disk (11.3 GB image plus BuildKit cache); network access to docker.io,- pypi.org, download.pytorch.org and dl.polyhaven.org (the CC0 studio HDRI). Running needs no network. Read access to the HF- dataset is needed (above).--Build (from the repository root)- scripts/robotangle/fetch_image_context.sh [<download dir>]- docker build -f images/robotangle/Dockerfile -t ghcr.io/mll-lab-nu/eai-robotangle:$(cat images/robotangle/VERSION) images/robotangle/context- (scripts/build_images.sh builds it from images/robotangle/BUILD_CONTEXT once the context exists and skips it otherwise.)- Optional, faster scene builds: images/topogym/warm_cache.sh of the context fills the kernel caches on a GPU host.--Check a build: the image must install exactly the runtime every task is bound to- docker run --rm ghcr.io/mll-lab-nu/eai-robotangle:$(cat images/robotangle/VERSION) python -c 'import json; from topogym.simulator.frozen_binding import installed_runtime; print(json.dumps(installed_runtime(), sort_keys=True))' > /tmp/robotangle_runtime.json- python3 -c 'import json, sys; sys.exit(0 if json.load(open("/tmp/robotangle_runtime.json")) == json.load(open("scripts/robotangle/release.json"))["runtime"] else "image differs from the tasks runtime binding: do not run")'- Every session checks it again at start (`runtime_binding_ok` in reward.json) and refuses a different runtime.diff --git a/images/robotangle/Dockerfile b/images/robotangle/Dockerfileindex 5f5e92d359..40c2ec60a2 100644--- a/images/robotangle/Dockerfile+++ b/images/robotangle/Dockerfile@@ -1,9 +1,10 @@# RoboTangle base image (eai-robotangle; formerly rcb-topogym): images/topogym/Dockerfile of the release commit in# scripts/robotangle/release.json, unchanged except that UIPC_WHEEL defaults to prebuilt (the task bindings name the audited-# libuipc wheel) and the robot_coding_bench stage at the end (the frozen instances). Its build context is prepared by+# libuipc wheel) and the robot_coding_bench additions at the end (the frozen instances, the sm86 libuipc build, the check of+# both libuipc wheels). Its build context is prepared by# scripts/robotangle/fetch_image_context.sh in images/robotangle/context/ (images/robotangle/BUILD_CONTEXT) from the private-# HF dataset pinned in scripts/robotangle/assets.json. BUILD_ONLY: never public; a private GHCR package for org members-# (images/robotangle/BUILD_ONLY).+# HF dataset pinned in scripts/robotangle/assets.json (internal; only the built image is public). Build instructions:+# images/robotangle/README.md.# rcb-topogym: Genesis 1.2.1 / Nyx with cu128 torch and original pyuipc 0.0.25 materials (libuipc 292c98c3 plus the# determinism patches in images/topogym/uipc-patches: summation order fixed, physics unchanged).# Infrastructure only, no benchmark code (docs/rcb/PROTOCOL.md §1): the task tooling (rcb_topogym.py) comes with each task,@@ -109,4 +110,33 @@ ENV PYTHONPATH=/opt/topogym TOPOGYM_SOURCE=/opt/topogym/SOURCE.jsonCOPY instances/ /opt/robotangle/instances/COPY stage_instance.py /opt/robotangle/stage_instance.pyRUN chmod -R a+rX /opt/robotangle+# robot_coding_bench: the NVIDIA Vulkan ICD and EGL vendor files, as in images/robopaint/. The tasks pass one GPU with a+# compose device reservation and no `runtime: nvidia`; NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the+# driver's graphics libraries, and these files point the Vulkan and EGL loaders at them (Nyx renders through Vulkan).+RUN mkdir -p /usr/share/vulkan/icd.d /usr/share/glvnd/egl_vendor.d && \+ printf '{"file_format_version":"1.0.0","ICD":{"library_path":"libGLX_nvidia.so.0","api_version":"1.3.0"}}\n' > /usr/share/vulkan/icd.d/nvidia_icd.json && \+ printf '{"file_format_version":"1.0.0","ICD":{"library_path":"libEGL_nvidia.so.0"}}\n' > /usr/share/glvnd/egl_vendor.d/10_nvidia.json+# The container toolkit's CDI mode also mounts the host's ICD json (/etc/vulkan/icd.d), which would list the GPU twice.+ENV VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json+# robot_coding_bench: the sm86 libuipc build, in its own prefix /opt/uipc_sm86 (the audited wheel above stays as it is). The+# same recipe as the audited wheel (images/topogym/uipc-build.json, build_uipc.sh, the determinism patches, nvcc 12.8) with+# the architectures 86-real;86-virtual (images/robotangle/uipc-sm86-build), and the same pyuipc version and source commit,+# which the frozen IPC settled states hold. The task tooling chooses the build at Session start, before uipc is imported:+# compute capability 8.9 or 12.x keeps the audited wheel, any other GPU gets /opt/uipc_sm86/site-packages first on sys.path+# (rcb_topogym.py select_uipc_build; scripts/robotangle/release.json uipc_builds).+RUN --mount=type=bind,source=uipc-sm86,target=/tmp/uipc-sm86 \+ --mount=type=bind,source=install_uipc_prefix.py,target=/tmp/install_uipc_prefix.py \+ python /tmp/install_uipc_prefix.py /tmp/uipc-sm86 /opt/uipc_sm86 && chmod -R a+rX /opt/uipc_sm86WORKDIR /app++# robot_coding_bench: both libuipc wheels checked against their uipc-build.json in the recipe's builder image (cuobjdump of+# nvcc 12.8): wheel, version and CUDA backend hashes, the native kernels and PTX each record lists, its required SASS and the+# PTX of every `-virtual` architecture (verify_uipc_wheel.py check). The image keeps the result in /opt/uipc-check.json.+FROM ${UIPC_BUILDER} AS uipc-check+COPY --from=uipc-wheels /out/wheels/ /check/audited/+COPY uipc-sm86/ /check/sm86/+COPY verify_uipc_wheel.py /check/verify_uipc_wheel.py+RUN /opt/python/cp311-cp311/bin/python /check/verify_uipc_wheel.py check /check/audited /check/sm86 > /check/uipc-check.json++FROM runtime AS final+COPY --from=uipc-check /check/uipc-check.json /opt/uipc-check.jsondiff --git a/images/robotangle/README.md b/images/robotangle/README.mdnew file mode 100644index 0000000000..227d588b4b--- /dev/null+++ b/images/robotangle/README.md@@ -0,0 +1,102 @@+# eai-robotangle++`ghcr.io/mll-lab-nu/eai-robotangle:<images/robotangle/VERSION>` is a public image: RoboTangle's simulator (the pruned+`topogym` package of the release commit), Genesis 1.2.1, libuipc (the audited determinism-patched wheel, plus an sm_86 build+of the same recipe), PyTorch, Nyx and every task's frozen instance. The tasks `FROM` it, and the standard `sim` service runs+it. Maintainers push it with `scripts/push_images.sh` after validating a build.++- **Nyx.** The image contains Genesis AI's Nyx renderer (the `gs-nyx` wheels on PyPI). The benchmark owner has permission to+ redistribute it in this image.+- **Build source.** The build context comes from the private Hugging Face dataset `eai-v2-internal/robotangle-assets`. It is+ internal and is never made public; only the built image is public. It holds, at the revision and sha256s pinned in+ `scripts/robotangle/assets.json`:+ - `image/release-<commit>.tar.gz`: the release tree (`scripts/robotangle/release.json` `release_commit`), the paths+ `images/topogym/Dockerfile` copies;+ - `image/uipc-prebuilt/`: the audited libuipc wheel and its `uipc-build.json` (sha256 `39781d19…`), which every task's+ runtime binding names. nvcc output is not bit-reproducible, so a wheel compiled elsewhere never matches the binding;+ - `image/uipc-sm86/`: the sm_86 build of the same recipe and its `uipc-build.json` (sha256 `712470d2…`; "The libuipc+ builds", below). The image installs it in `/opt/uipc_sm86` (`install_uipc_prefix.py`);+ - `instances/`: every task's frozen instance. `stage_instance.py` copies a task's instance next to its+ `runtime_binding.json` and checks it (privileged `environment/` and `tests/` images; the standard `sim` entrypoint).++ Access: a member of `eai-v2-internal`, logged in with `hf auth login`, or `HF_TOKEN` in the environment (never printed).++## Host++- Linux x86_64. Not WSL: Nyx needs the NVIDIA Vulkan driver inside the container.+- An NVIDIA GPU with driver >= 580, and Docker with the NVIDIA Container Toolkit. Docker's default runtime stays `runc`.+- Exactly one GPU per container: Nyx crashes when two GPUs are visible. The task compose files reserve one GPU with a+ device reservation (`count: 1`, `capabilities: [gpu]`), without `runtime: nvidia`. NVIDIA_DRIVER_CAPABILITIES=all makes+ the toolkit mount the driver's graphics libraries, and the image's Vulkan ICD and EGL vendor files point the loaders at+ them, as in `images/robopaint/`. `VK_ICD_FILENAMES` names the image's ICD file: a toolkit in CDI mode also mounts the+ host's `/etc/vulkan/icd.d/nvidia_icd.json`, which would list the GPU twice.+- `count: 1` is host GPU 0 unless the runner pins GPUs; IPC sims (knot_untying, rope_threading) run alone on a 24 GB GPU+ (`docs/benchmarks/robotangle.md`, Image).+- GPU architecture (`docs/benchmarks/robotangle.md`, Image, has the table):+ - knot_untying and rope_threading run libuipc: the audited wheel on compute capability 8.9 and 12.x, the sm_86 build on+ any other GPU (native on 8.6, e.g. RTX A6000; untested elsewhere). 7.5 (T4, RTX 20xx) can run neither;+ - GPUs without RT cores (e.g. A100, H100) cannot run Nyx, so they run no RoboTangle task;+ - the driver must include its graphics (GL/Vulkan) user-space libraries.+- blanket_flatten: on a GPU other than the one its frozen PBD states were prepared on (an RTX PRO 6000 Blackwell), the task+ generates the birth state from the recipe frozen in the instance (`docs/benchmarks/robotangle.md`, GPU portability).+- Build:+ - about 25 GB of free disk: the 11.3 GB image plus BuildKit cache;+ - BuildKit with the default `docker` driver;+ - network access to docker.io, pypi.org, download.pytorch.org and dl.polyhaven.org (the CC0 studio HDRI).+- Running needs no network.++## Build (from the repository root)++```bash+scripts/robotangle/fetch_image_context.sh [<download dir>] # images/robotangle/context/ from the pinned dataset, checked+docker build -f images/robotangle/Dockerfile -t ghcr.io/mll-lab-nu/eai-robotangle:$(cat images/robotangle/VERSION) images/robotangle/context+```++`scripts/build_images.sh` builds it from `images/robotangle/BUILD_CONTEXT` once the context exists, and skips it otherwise.+The image is not cache-warmed: every container compiles its kernels on first use, and scene ready took 67-296 s for the+rigid families on a shared 4090, against the 1800 s startup watchdog. The release tree's `images/topogym/warm_cache.sh`+does not apply here. It expects `topogym-*` task directories with their own `instance.json`, and RoboTangle's tasks stage+their instances from the image.++## Check a build++The image must install exactly the runtime every task is bound to:++```bash+docker run --rm ghcr.io/mll-lab-nu/eai-robotangle:$(cat images/robotangle/VERSION) python -c 'import json; from topogym.simulator.frozen_binding import installed_runtime; print(json.dumps(installed_runtime(), sort_keys=True))' > /tmp/robotangle_runtime.json+python3 -c 'import json, sys; sys.exit(0 if json.load(open("/tmp/robotangle_runtime.json")) == json.load(open("scripts/robotangle/release.json"))["runtime"] else "image differs from the tasks runtime binding: do not run")'+```++Every session checks it again at start (`runtime_binding_ok` in reward.json) and refuses a different runtime. The two+libuipc builds must be the ones `scripts/robotangle/release.json` `uipc_builds` names, and the image build already checked+both wheels against their build records:++```bash+docker run --rm ghcr.io/mll-lab-nu/eai-robotangle:$(cat images/robotangle/VERSION) sh -c 'sha256sum /opt/uipc-build.json /opt/uipc_sm86/uipc-build.json; cat /opt/uipc-check.json'+```++## The libuipc builds++The image holds two builds of one libuipc recipe (libuipc 292c98c3 with the determinism patches of the release's+`images/topogym/uipc-patches`, the pinned CUDA 12.8 builder image, pyuipc `0.0.25+topogym.det1.cuda128`):+- the audited wheel (`89-real;120-real;120-virtual`) in site-packages, `/opt/uipc-build.json`: every evidence run used it,+ and GPUs of compute capability 8.9 and 12.x always load it;+- the sm_86 build (`86-real;86-virtual`) in `/opt/uipc_sm86`: any other GPU loads it. The task tooling chooses at Session+ start, before uipc is imported (`rcb_topogym.py` `select_uipc_build`).++Both keep the pyuipc version and libuipc commit, which the frozen IPC settled states record; that is why the sm_86 build+restores them. Do not give a rebuild another local version label.++The sm_86 recipe is `images/robotangle/uipc-sm86-build/`: the release Dockerfile's compile stages verbatim, its config+`uipc-build-sm86.json` (the release config with the architecture list changed, plus a `recipe` record), and the release's+`verify_uipc_wheel.py` with one change: the audit requires the PTX of the config's `-virtual` architectures instead of a+fixed compute_120. A rebuild follows the same recipe but need not give the same bytes or even the same machine code (two+sm_86 builds of 2026-10-08 differ in 10 of 1230 functions), so a rebuilt wheel needs new bindings. A single wheel for+sm_86, sm_89 and sm_120 was tried and not used: its sm_89 code differed from the audited wheel's in 8 of 1230 functions+(`docs/benchmarks/robotangle.md`, Image).++```bash+cd images/robotangle/uipc-sm86-build+docker build -f Dockerfile.uipc --build-arg UIPC_CONFIG=uipc-build-sm86.json --build-arg UIPC_BUILD_JOBS=16 \+ --target uipc-export -o type=local,dest=<out> .+```diff --git a/images/robotangle/VERSION b/images/robotangle/VERSIONindex 6bf5ecb605..599028f5f5 100644--- a/images/robotangle/VERSION+++ b/images/robotangle/VERSION@@ -1 +1 @@-0.2.19+0.2.21diff --git a/images/robotangle/install_uipc_prefix.py b/images/robotangle/install_uipc_prefix.pynew file mode 100644index 0000000000..7cae79a732--- /dev/null+++ b/images/robotangle/install_uipc_prefix.py@@ -0,0 +1,45 @@+#!/usr/bin/env python3+"""Install a libuipc build into its own prefix (images/robotangle/Dockerfile): <wheels> holds one wheel and its+uipc-build.json. The wheel must have the sha256 its uipc-build.json records; after the install, the version and the CUDA+backend's sha256 are checked against that record too, as images/topogym/verify_uipc_wheel.py install does for the audited+wheel in site-packages. rcb_topogym.select_uipc_build() puts <prefix>/site-packages first on sys.path on the GPUs the+build is for.+usage: python install_uipc_prefix.py <wheels> <prefix> -> <prefix>/site-packages/, <prefix>/uipc-build.json"""+import email+import hashlib+import json+import pathlib+import shutil+import subprocess+import sys+import tempfile+++def sha(path: pathlib.Path) -> str:+ with path.open("rb") as stream:+ return hashlib.file_digest(stream, "sha256").hexdigest()+++def main(wheels: pathlib.Path, prefix: pathlib.Path) -> None:+ record = json.loads((wheels / "uipc-build.json").read_text())+ wheel = wheels / record["wheel"]+ if wheel.parent != wheels or sha(wheel) != record["wheel_sha256"]:+ sys.exit(f"{wheel}: not the wheel its uipc-build.json records")+ site = prefix / "site-packages"+ with tempfile.TemporaryDirectory() as tmp:+ requirements = pathlib.Path(tmp) / "wheel.lock"+ requirements.write_text(f"pyuipc @ {wheel.resolve().as_uri()} --hash=sha256:{record['wheel_sha256']}\n")+ subprocess.run([sys.executable, "-m", "pip", "install", "--no-deps", "--no-compile", "--require-hashes",+ "--target", str(site), "-r", str(requirements)], check=True)+ dist = list(site.glob("pyuipc-*.dist-info"))+ if len(dist) != 1 or sorted(p.name for p in site.iterdir()) != sorted([dist[0].name, "uipc"]):+ sys.exit(f"{site}: expected exactly the uipc package and its dist-info")+ version = email.message_from_bytes((dist[0] / "METADATA").read_bytes())["Version"]+ if version != record["version"] or sha(site / record["backend_path"]) != record["backend_sha256"]:+ sys.exit(f"{site}: installed libuipc differs from its uipc-build.json")+ shutil.copyfile(wheels / "uipc-build.json", prefix / "uipc-build.json")+ print(f"ok {prefix}: pyuipc {version}, architectures {record['architectures']}, uipc-build.json {sha(prefix / 'uipc-build.json')[:12]}")+++if __name__ == "__main__":+ main(pathlib.Path(sys.argv[1]).resolve(), pathlib.Path(sys.argv[2]))diff --git a/images/robotangle/uipc-sm86-build/.dockerignore b/images/robotangle/uipc-sm86-build/.dockerignorenew file mode 100644index 0000000000..6c3b4ebd9c--- /dev/null+++ b/images/robotangle/uipc-sm86-build/.dockerignore@@ -0,0 +1,8 @@+**+!requirements/uipc-build.lock+!images/topogym/build_uipc.sh+!images/topogym/verify_uipc_wheel.py+!images/topogym/uipc-build-sm86.json+!images/topogym/uipc-patches/+!images/topogym/uipc-patches/**+!audit/verify_uipc_wheel.pydiff --git a/images/robotangle/uipc-sm86-build/Dockerfile.uipc b/images/robotangle/uipc-sm86-build/Dockerfile.uipcnew file mode 100644index 0000000000..4bb25c423c--- /dev/null+++ b/images/robotangle/uipc-sm86-build/Dockerfile.uipc@@ -0,0 +1,40 @@+# libuipc sm_86 wheel for RoboTangle 0.2.21 (fallback route): the audited recipe, arch list 86-real;86-virtual.+# Lines from "ARG UIPC_BUILDER" to the compile RUN are images/topogym/Dockerfile lines 10-30 of release 2dafa5f2b, verbatim+# (same builder image, nvcc 12.8, lock, build_uipc.sh, verify_uipc_wheel.py prepare, determinism patches). Changes:+# - the config images/topogym/uipc-build-sm86.json (architectures 86-real;86-virtual, required_sass sm_86, recipe record);+# - the audit stage runs audit/verify_uipc_wheel.py: the release script, except that the PTX it requires comes from the+# config's `-virtual` architectures (the release script requires compute_120, which this arch list does not embed);+# - an export stage (the wheel and its uipc-build.json only).+# docker build -f Dockerfile.uipc --build-arg UIPC_CONFIG=uipc-build-sm86.json --build-arg UIPC_BUILD_JOBS=16 \+# --target uipc-export -o type=local,dest=<out> .+ARG UIPC_BUILDER=sameli/manylinux_2_34_x86_64_cuda_12.8@sha256:0b99ea5d0e32f5ad49b02de2663520f17a8dafc8739365cd7463a82ed3f0590a+FROM ${UIPC_BUILDER} AS uipc-compile+ENV PATH=/opt/python/cp311-cp311/bin:$PATH+# CUDA is already pinned in the builder; generic tools need only OS repos.+# Avoid unrelated NVIDIA repo metadata failures (e.g. stale repodata URLs).+RUN yum --disablerepo='cuda*' install -y git curl zip unzip tar gzip+COPY requirements/uipc-build.lock /recipe/uipc-build.lock+RUN python -m pip install --require-hashes -r /recipe/uipc-build.lock+COPY images/topogym/build_uipc.sh images/topogym/verify_uipc_wheel.py /recipe/+# Determinism source patches for libuipc (applied and hash-checked by verify_uipc_wheel.py prepare; listed in the config).+COPY images/topogym/uipc-patches/ /recipe/uipc-patches/+ARG UIPC_CONFIG=uipc-build.json+COPY images/topogym/${UIPC_CONFIG} /recipe/uipc-build.json+RUN bash /recipe/build_uipc.sh prepare+# The compile parallelism (build_uipc.sh: CMAKE_BUILD_PARALLEL_LEVEL): default 3 = uipc-build.json build_policy.compile_jobs;+# a host with more memory may pass more (lab: --build-arg UIPC_BUILD_JOBS=16).+ARG UIPC_BUILD_JOBS=3+RUN --mount=type=cache,target=/root/.cache/vcpkg \+ --mount=type=cache,target=/build/vcpkg/downloads \+ --mount=type=cache,id=topogym-uipc-objects-${UIPC_CONFIG},target=/build/uipc-build,sharing=locked \+ bash /recipe/build_uipc.sh compile+FROM uipc-compile AS uipc-build+# Keep packaging independent of the expensive compiler stage.+COPY images/topogym/build_uipc.sh /recipe/+COPY audit/verify_uipc_wheel.py /recipe/verify_uipc_wheel.py+ARG UIPC_CONFIG=uipc-build.json+COPY images/topogym/${UIPC_CONFIG} /recipe/uipc-build.json+RUN bash /recipe/build_uipc.sh audit++FROM scratch AS uipc-export+COPY --from=uipc-build /out/wheels/ /diff --git a/images/robotangle/uipc-sm86-build/audit/verify_uipc_wheel.py b/images/robotangle/uipc-sm86-build/audit/verify_uipc_wheel.pynew file mode 100644index 0000000000..15e17cf73c--- /dev/null+++ b/images/robotangle/uipc-sm86-build/audit/verify_uipc_wheel.py@@ -0,0 +1,162 @@+#!/usr/bin/env python3+"""Build-only CMake fix, the hash-checked determinism source patches, CUDA wheel audit and hash-checked runtime install."""+import argparse+import email+import hashlib+import json+import os+from pathlib import Path+import re+import subprocess+import tempfile+import zipfile+++def sha(path):+ with Path(path).open('rb') as stream:+ return hashlib.file_digest(stream, 'sha256').hexdigest()+++def materials(source, config):+ for name, expected in config['material_sha256'].items():+ if sha(source / name) != expected:+ raise ValueError(f'original material implementation changed: {name}')+++def patched(source, config):+ for name, expected in config.get('patched_sha256', {}).items():+ if not (source / name).is_file() or sha(source / name) != expected:+ raise ValueError(f'patched IPC source differs: {name}')+++def apply_patches(source, config):+ # TopoGym determinism series (uipc-build.json source_patches): fixed-order sums instead of float atomics in the+ # linear solve, assembly, candidate lists and segmented reductions; physics and materials unchanged.+ for item in config.get('source_patches', []):+ patch = Path('/recipe') / item['path']+ if sha(patch) != item['sha256']:+ raise ValueError(f'IPC source patch hash mismatch: {item["path"]}')+ subprocess.run(['git', '-C', str(source), 'apply', '--whitespace=nowarn', str(patch)], check=True)+ patched(source, config)+++def prepare(source, config):+ materials(source, config)+ path = source / 'src/backends/cuda/CMakeLists.txt'+ if sha(path) != config['cmake_before_sha256']:+ raise ValueError('unexpected original CUDA CMake file')+ old = ' CUDA_ARCHITECTURES ${UIPC_CUDA_ARCHITECTURES}\n'+ text = path.read_text()+ if text.count(old) != 1:+ raise ValueError('expected exactly one CUDA target property')+ # A list must remain one property value. Materials stay original; the only solver source changes are the hash-checked+ # determinism patches (summation order).+ path.write_text(text.replace(old, ' CUDA_ARCHITECTURES "${UIPC_CUDA_ARCHITECTURES}"\n'))+ apply_patches(source, config)+++def audit(folder, config, source):+ materials(source, config)+ head = subprocess.check_output(['git', '-C', str(source), 'rev-parse', 'HEAD'], text=True).strip()+ if head != config['source_commit']:+ raise ValueError('IPC source commit changed')+ changed = subprocess.check_output(['git', '-C', str(source), 'diff', '--name-only'], text=True).splitlines()+ tracked = set(subprocess.check_output(['git', '-C', str(source), 'ls-files'], text=True).splitlines())+ patched_files = config.get('patched_sha256', {})+ expected = sorted(['src/backends/cuda/CMakeLists.txt', *(f for f in patched_files if f in tracked)])+ if sorted(changed) != expected:+ raise ValueError(f'unexpected upstream source changes: {changed}')+ patched(source, config)+ wheels = list(folder.glob('*.whl'))+ if len(wheels) != 1:+ raise ValueError('expected one repaired CPython 3.11 wheel')+ wheel = wheels[0]+ with zipfile.ZipFile(wheel) as archive, tempfile.TemporaryDirectory() as tmp:+ metadata = [p for p in archive.namelist() if p.endswith('.dist-info/METADATA')]+ package = email.message_from_bytes(archive.read(metadata[0]))+ if package['Version'] != config['version']:+ raise ValueError('unexpected wheel version')+ libraries = [p for p in archive.namelist() if p.endswith('/libuipc_backend_cuda.so')]+ if len(libraries) != 1:+ raise ValueError('missing/ambiguous IPC CUDA backend')+ library = Path(tmp) / 'libuipc_backend_cuda.so'+ library.write_bytes(archive.read(libraries[0]))+ elf = subprocess.check_output(['cuobjdump', '--list-elf', str(library)], text=True)+ # RDC builds retain PTX in relocatable fatbins, beside linked SASS.+ ptx = subprocess.check_output(['cuobjdump', '--all-fatbin', '--list-ptx', str(library)], text=True)+ sass = sorted(set(re.findall(r'\bsm_\d+\b', elf)))+ if not set(config['required_sass']) <= set(sass):+ raise ValueError(f'wheel lacks required native CUDA kernels: {sass}')+ # The PTX each `<N>-virtual` architecture of the config embeds (the release config's 120-virtual: compute_120).+ for arch in re.findall(r'(\d+)-virtual', config['architectures']) or ['120']:+ if not re.search(rf'(?:sm|compute)_{arch}\b', ptx):+ raise ValueError(f'wheel lacks compute-{arch} PTX')+ record = dict(config, wheel=wheel.name, wheel_sha256=sha(wheel), backend_sha256=sha(library),+ backend_path=libraries[0], sass=sass, ptx_listing=ptx.splitlines(),+ ptx_scope='all_fatbins_including_relocatable',+ cuda_compiler=subprocess.check_output(['nvcc', '--version'], text=True),+ submodules=subprocess.check_output(['git', '-C', str(source), 'submodule', 'status', '--recursive'], text=True),+ cmake_after_sha256=sha(source/'src/backends/cuda/CMakeLists.txt'),+ source_changes=changed, source_added=sorted(f for f in patched_files if f not in tracked),+ materials_unchanged=True)+ (folder / 'uipc-build.json').write_text(json.dumps(record, indent=2) + '\n')+++def without_pyuipc(text):+ lines = text.splitlines(keepends=True)+ out, found, i = [], 0, 0+ while i < len(lines):+ if lines[i].startswith('pyuipc=='):+ if not lines[i].startswith('pyuipc==0.0.25 '):+ raise ValueError('unexpected baseline IPC requirement')+ found += 1+ while lines[i].rstrip().endswith('\\'):+ i += 1+ i += 1+ else:+ out.append(lines[i]); i += 1+ if found != 1:+ raise ValueError('expected exactly one original IPC requirement')+ return ''.join(out)+++def dependencies(lock):+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'runtime.lock'+ requirements.write_text(without_pyuipc(lock.read_text()))+ subprocess.run(['uv', 'pip', 'install', '--system', '--require-hashes', '--torch-backend',+ os.environ.get('TOPOGYM_CUDA_FLAVOR', 'cu128'),+ '-r', str(requirements)], check=True)+++def install(folder, lock=None):+ record = json.loads((folder / 'uipc-build.json').read_text())+ wheel = folder / record['wheel']+ if wheel.parent != folder or sha(wheel) != record['wheel_sha256']:+ raise ValueError('IPC wheel hash mismatch')+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'wheel.lock'+ requirements.write_text(f'pyuipc @ {wheel.resolve().as_uri()} --hash=sha256:{record["wheel_sha256"]}\n')+ subprocess.run(['uv', 'pip', 'install', '--system', '--no-deps', '--require-hashes',+ '-r', str(requirements)], check=True)+ import importlib.metadata as metadata+ package = metadata.distribution('pyuipc')+ if package.version != record['version'] or sha(package.locate_file(record['backend_path'])) != record['backend_sha256']:+ raise ValueError('installed IPC differs from audited build')+++if __name__ == '__main__':+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('operation', choices=('prepare', 'audit', 'install', 'dependencies'))+ parser.add_argument('path', type=Path)+ parser.add_argument('config_or_lock', type=Path, nargs='?')+ parser.add_argument('source', type=Path, nargs='?')+ args = parser.parse_args()+ if args.operation == 'dependencies':+ dependencies(args.path)+ elif args.operation == 'install':+ install(args.path, args.config_or_lock)+ else:+ config = json.loads(args.config_or_lock.read_text())+ if args.operation == 'prepare': prepare(args.path, config)+ else: audit(args.path, config, args.source)diff --git a/images/robotangle/uipc-sm86-build/images/topogym/build_uipc.sh b/images/robotangle/uipc-sm86-build/images/topogym/build_uipc.shnew file mode 100644index 0000000000..2ba44635f1--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/build_uipc.sh@@ -0,0 +1,62 @@+#!/usr/bin/env bash+# Runs only in the fixed manylinux/CUDA builder. No GPU or host venv needed.+set -euo pipefail+CONFIG=/recipe/uipc-build.json+json_value() { python -c 'import json,sys; print(json.load(open(sys.argv[1]))[sys.argv[2]])' "$CONFIG" "$1"; }+case "${1:?prepare, compile or audit required}" in+prepare)+SOURCE_COMMIT="$(json_value source_commit)"+VCPKG_COMMIT="$(json_value vcpkg_commit)"+mkdir -p /build/uipc /build/vcpkg /out/raw /out/wheels+git -C /build/uipc init+git -C /build/uipc remote add origin "$(json_value repository)"+git -C /build/uipc fetch --depth 1 origin "$SOURCE_COMMIT"+git -C /build/uipc checkout --detach FETCH_HEAD+test "$(git -C /build/uipc rev-parse HEAD)" = "$SOURCE_COMMIT"+git -C /build/uipc submodule update --init --recursive --depth 1+git -C /build/vcpkg init+git -C /build/vcpkg remote add origin https://github.com/microsoft/vcpkg.git+git -C /build/vcpkg fetch --depth 1 origin "$VCPKG_COMMIT"+git -C /build/vcpkg checkout --detach FETCH_HEAD+bash /build/vcpkg/bootstrap-vcpkg.sh -disableMetrics+# The old tag archive hash changed. Pin its identical source commit instead;+# retain the original port recipe and dependency version.+python - <<'PYPORT'+import json, pathlib, shutil+config = json.load(open('/recipe/uipc-build.json'))['tinygltf']+port = pathlib.Path('/build/overlays/tinygltf')+shutil.copytree('/build/vcpkg/ports/tinygltf', port)+p = port / 'portfile.cmake'+s = p.read_text()+assert s.count(config['original_sha512']) == 1+assert s.count('REF "v${VERSION}"') == 1+s = s.replace(config['original_sha512'], config['archive_sha512'])+s = s.replace('REF "v${VERSION}"', 'REF ' + config['commit'])+p.write_text(s)+PYPORT+python /recipe/verify_uipc_wheel.py prepare /build/uipc "$CONFIG"+;;+compile)+export VCPKG_OVERLAY_PORTS=/build/overlays+export CMAKE_TOOLCHAIN_FILE=/build/vcpkg/scripts/buildsystems/vcpkg.cmake+export CMAKE_BUILD_PARALLEL_LEVEL="${UIPC_BUILD_JOBS:-3}"+export VCPKG_MAX_CONCURRENCY="$CMAKE_BUILD_PARALLEL_LEVEL"+export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYUIPC="$(json_value version)"+python -m build --wheel --no-isolation --outdir /out/raw \+ -C "cmake.define.UIPC_CUDA_ARCHITECTURES=$(json_value architectures)" \+ -C build-dir=/build/uipc-build /build/uipc+;;+audit)+# Match upstream's runtime-library policy: CUDA user libraries come from the+# selected CUDA runtime lock, the NVIDIA driver comes from the host.+for wheel in /out/raw/*.whl; do+ auditwheel repair --plat "$(json_value wheel_platform)" -w /out/wheels "$wheel" \+ --exclude 'libcuda*' --exclude 'libcudart*' --exclude 'libcublas*' \+ --exclude 'libcusparse*' --exclude 'libcusolver*' --exclude 'libcurand*' \+ --exclude 'libcufft*' --exclude 'libnvrtc*' --exclude 'libnvJitLink*'+done+python /recipe/verify_uipc_wheel.py audit /out/wheels "$CONFIG" /build/uipc++;;+*) echo "expected prepare, compile or audit" >&2; exit 2 ;;+esacdiff --git a/images/robotangle/uipc-sm86-build/images/topogym/uipc-build-sm86.json b/images/robotangle/uipc-sm86-build/images/topogym/uipc-build-sm86.jsonnew file mode 100644index 0000000000..e37daf8da9--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/uipc-build-sm86.json@@ -0,0 +1,95 @@+{+ "schema_version": 1,+ "builder_image": "sameli/manylinux_2_34_x86_64_cuda_12.8@sha256:0b99ea5d0e32f5ad49b02de2663520f17a8dafc8739365cd7463a82ed3f0590a",+ "repository": "https://github.com/spiriMirror/libuipc.git",+ "source_commit": "292c98c3fec2dfbe9ae2c2407572f2f446a4a738",+ "vcpkg_commit": "dd3097e305afa53f7b4312371f62058d2e665320",+ "version": "0.0.25+topogym.det1.cuda128",+ "architectures": "86-real;86-virtual",+ "required_sass": [+ "sm_86"+ ],+ "cmake_before_sha256": "2b9b33aaf3157b757274a441b9070805f610624623bceec0370ae5b4baa6047e",+ "material_sha256": {+ "src/backends/cuda/finite_element/constitutions/detail/stable_neo_hookean_3d.inl": "b12e941f5b00423515615687ade5c69873d6674a622ea3b2b6775cda28692180",+ "src/constitution/stable_neo_hookean.cpp": "1d8c12150c24216ef346bcd5ea2f88c5a436c42600d14c0cfb6d0491f43fe68d"+ },+ "source_patches": [+ {+ "path": "uipc-patches/0001-det-linear-solve.patch",+ "sha256": "bf33bba6b823d27d4537c23bde94495d80f727145efc01c35444506df8316cbc"+ },+ {+ "path": "uipc-patches/0002-det-assembly-candidates.patch",+ "sha256": "b586e2b1c69ec5a94172d50eb7dc36ad7b3eb0b404ec70913d5df10ce4e4d4fd"+ },+ {+ "path": "uipc-patches/0003-det-segmental-reduce.patch",+ "sha256": "66ffae86d3e4380ffa3a4de3491c676926f382cec9c3d9c5b238c0542c34f0a0"+ }+ ],+ "patched_sha256": {+ "src/backends/cuda/affine_body/abd_linear_subsystem.cu": "10c557fae84fbc6429b45fba6bf76f0f7f3e5e5b9a7756b3c5905e3af72d9e23",+ "src/backends/cuda/algorithm/details/fast_segmental_reduce.inl": "b997c37d5a62fbdb44704b9628ed2a6465d489f3c1e4e8eba0c5f71fc3ab0e46",+ "src/backends/cuda/collision_detection/atomic_counting_lbvh.cu": "f67e5b97b566e8fbc3d7cfb7aed54af0392c43f87834516be9d5b74712aff314",+ "src/backends/cuda/collision_detection/atomic_counting_lbvh.h": "11b44f3fdce0c8a45831f10f031b0848f60ce5166b8cd8d65007d57702229a0c",+ "src/backends/cuda/collision_detection/details/atomic_counting_lbvh.inl": "900109265e5ddafab649dfc2898549c8cd763ab4cc6bfece02c738272f931d4d",+ "src/backends/cuda/collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu": "e40f01804445c1a520d6f69fa5c85a34f299821f536cb063450b24c2ad83720c",+ "src/backends/cuda/finite_element/fem_linear_subsystem.cu": "b72c825a20f0a6700c6b4c8ed418ccc20a4b76b0b929820c2f2becf59bb32b68",+ "src/backends/cuda/linear_system/det_reduce.h": "ad5d692967277a899fb579f7fc55887932a8a69d3f5375f8a4dbbfdd1b0f42cd",+ "src/backends/cuda/linear_system/det_scatter.h": "770a8d9d6f997c24c374126ba44ada53d1aa3fd018decd31d30c13fd226eed57",+ "src/backends/cuda/linear_system/det_spmv.h": "790490c0be68eb6591b330e2d6bde6fcf7237442ec9b12be87091ca5cb637d18",+ "src/backends/cuda/linear_system/global_linear_system.cu": "7ce5a043f1737e74cf19f6da8c03de4b930c0f3ca5621c0d0169fc0e3522b694",+ "src/backends/cuda/linear_system/global_linear_system.h": "92fe6b95568dc437c16537943c1d43327d96ca355b49d23452f6575bd1ad83d6",+ "src/backends/cuda/linear_system/linear_fused_pcg.cu": "2746efc71d35543c04d74443a4410b7e7f743f445acddb531d9ca21213158902",+ "src/backends/cuda/linear_system/spmv.cu": "4fede669aacbf96a9715091314d4cd42c3edd6d4b4e1e9ecb50d471e2e715385"+ },+ "tinygltf": {+ "commit": "26422192e2908a562b641175dde18489824e609e",+ "archive_sha512": "ff80b49c01c4b1ad636e5c5651c5bd04ee3058cc068f0858ebe401c113aeeadb3db43bac7f987b6a2073d8cbe5de65da28e909fb5041839127695ddcd960295d",+ "original_sha512": "89397dc2c8884a54ea0c370251449459a200057b5e470210c4468f43c4623947500630b1a67ff6319e0998e648487367398f134711bc7d2c42ebdbd7097770b3"+ },+ "build_policy": {+ "link_optimization": "upstream-default",+ "compile_jobs": 3,+ "stop_memory_percent": 90,+ "stop_on_cpu": false+ },+ "wheel_platform": "manylinux_2_34_x86_64",+ "recipe": {+ "base": {+ "release_commit": "2dafa5f2b2f596d3be78d92bb1b4377b548c4c7f",+ "config": "images/topogym/uipc-build.json",+ "config_sha256": "a5ad9b9069f8e4ac065cf38969dc0e27dbc8afb8a7b9da56a3fe0a7f020e29f6",+ "audited_uipc_build_sha256": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1"+ },+ "changed": {+ "architectures": [+ "89-real;120-real;120-virtual",+ "86-real;86-virtual"+ ],+ "required_sass": [+ [+ "sm_89",+ "sm_120"+ ],+ [+ "sm_86"+ ]+ ]+ },+ "compile_stage": "Dockerfile.uipc lines 10-30 = the release images/topogym/Dockerfile lines 10-30, verbatim",+ "audit_change": "audit/verify_uipc_wheel.py = the release script with the PTX requirement taken from the config's -virtual architectures (release: compute_120)",+ "files_sha256": {+ "Dockerfile.uipc": "a14f67baa396da3e91ffd5c4dd9cb0a9d15102779fe75fef42377d97bfd9f6f2",+ "requirements/uipc-build.lock": "d7eec54b98afd492e30d1814471316f49a344ca9931d93575f85b8d51c697116",+ "images/topogym/build_uipc.sh": "c33ed31fcfcdcbf4d2145509751f6fafb5d8e5c3f29ad1ef7caa4d78744a063e",+ "images/topogym/verify_uipc_wheel.py": "bf68d15a272c622dd48dbe5db9a5329e2ad5052401ffeecd07ee66866fa4001f",+ "images/topogym/uipc-patches/0001-det-linear-solve.patch": "bf33bba6b823d27d4537c23bde94495d80f727145efc01c35444506df8316cbc",+ "images/topogym/uipc-patches/0002-det-assembly-candidates.patch": "b586e2b1c69ec5a94172d50eb7dc36ad7b3eb0b404ec70913d5df10ce4e4d4fd",+ "images/topogym/uipc-patches/0003-det-segmental-reduce.patch": "66ffae86d3e4380ffa3a4de3491c676926f382cec9c3d9c5b238c0542c34f0a0",+ "audit/verify_uipc_wheel.py": "2a0d5d331c3fcbb7b20d968b01755936baae5c3230351bf5c758ffc562bd6581"+ },+ "recipe_sha256": "fba5c8093147a793ecc12e71f745a58f81f367fb329297b8de37e0d245d73646"+ }+}diff --git a/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0001-det-linear-solve.patch b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0001-det-linear-solve.patchnew file mode 100644index 0000000000..3b3d33ed9f--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0001-det-linear-solve.patch@@ -0,0 +1,771 @@+From c64c5dcfefed2dc04534daace78353522f4122eb Mon Sep 17 00:00:00 2001+From: qineng-det <[email protected]>+Date: Mon, 5 Oct 2026 14:00:38 -0500+Subject: [PATCH 1/4] cuda: reproducible linear solve (TopoGym determinism+ series 1/4)++Replaces the float atomics on the global linear solve path with fixed-order+sums. Physics unchanged; only the summation order is fixed, so identical+inputs give bit-identical iterates in every process (same GPU model).++Atomics replaced:+- linear_fused_pcg.cu fused_dot: per-warp sums atomicAdd'ed into d_result+ -> det::sum (det_reduce.h): every thread sums a fixed index set, a+ cub::BlockReduce per block, and the last block to finish (integer atomic+ counter) sums the per-block partials in index order; one launch.+- spmv.cu Spmv::rbk_sym_spmv / rbk_sym_spmv_dot as used by+ GlobalLinearSystem (symmetric BCOO, one triangle stored): row segments+ added across warps with atomic adds, the transposed half+ y_j += A_ij^T x_i scattered with atomic adds, warp dot sums atomicAdd'ed+ -> DetSymSpmv (det_spmv.h): after every assembly, an integer-only plan+ (cub radix sort of (row, col) keys) expands A into a row-sorted block CSR+ with both triangles (blocks copied, transposed where needed) and splits+ the block rows into short rows (< 33 blocks) and long rows (the+ affine-body rows that touch many contacts). The SpMV gives each short+ row 4 lanes (lane l sums blocks l, l + 4, ... in order; a fixed xor+ butterfly combines them) and each long row a whole thread block (a fixed+ cub::BlockReduce tree); both loop over their row lists with a fixed+ grid stride. The fused dot sums each lane group's rows in loop order,+ each thread block's groups in group order, and the last thread block+ to finish sums the per-block partials in index order.++Checks: the same assembled system solved twice in one process: solution+entries that differ, rope_threading medium 15009 of 15165 -> 0 (55+solves), knot_untying medium K2 0 of 96852 (244 solves); PCG iteration+counts equal. Kernel time on the same matrix in the same process (stock /+this patch, SpMV, SpMV + dot): rope medium (5055 block rows, longest row+206 blocks) 8.2 / 8.3 us, 11.2 / 10.3 us; knot medium (32284 block rows,+longest row 883 blocks) 22.4 / 22.5 us, 26.7 / 26.4 us.+---+ src/backends/cuda/linear_system/det_reduce.h | 90 +++++ src/backends/cuda/linear_system/det_spmv.h | 78 +++++ .../linear_system/global_linear_system.cu | 7 +-+ .../cuda/linear_system/global_linear_system.h | 2 ++ .../cuda/linear_system/linear_fused_pcg.cu | 38 +-+ src/backends/cuda/linear_system/spmv.cu | 414 +++++++++++++++++++ 6 files changed, 595 insertions(+), 34 deletions(-)+ create mode 100644 src/backends/cuda/linear_system/det_reduce.h+ create mode 100644 src/backends/cuda/linear_system/det_spmv.h++diff --git a/src/backends/cuda/linear_system/det_reduce.h b/src/backends/cuda/linear_system/det_reduce.h+new file mode 100644+index 0000000..f120db8+--- /dev/null++++ b/src/backends/cuda/linear_system/det_reduce.h+@@ -0,0 +1,90 @@++#pragma once++// Deterministic reductions (TopoGym determinism series, patch 0001).++//++// Replaces float atomicAdd reductions (e.g. warp sums atomically added into one device scalar), whose summation order++// follows the GPU scheduler and so changes the rounding from run to run. Here the grid size is a function of n only,++// every thread sums a fixed index set in a fixed order and cub::BlockReduce combines a block with a fixed shuffle tree;++// the last block to finish (found with an integer atomic counter) then sums the per-block partials in index order.++// Which block happens to be last does not matter: it computes the same fixed-order sum. One kernel launch per sum.++// Same GPU model and n => same bits.++#include <type_define.h>++#include <cub/block/block_reduce.cuh>++#include <muda/buffer/device_buffer.h>++++namespace uipc::backend::cuda::det++{++constexpr int kBlockDim = 256;++constexpr int kMaxGrid = 1024;++++inline int grid_size(int n)++{++ int g = (n + kBlockDim * 4 - 1) / (kBlockDim * 4);++ return g < 1 ? 1 : (g > kMaxGrid ? kMaxGrid : g);++}++++// scratch of one call site: per-block partials and the completion counter (0 between calls)++struct SumScratch++{++ muda::DeviceBuffer<Float> partial;++ muda::DeviceBuffer<unsigned int> counter;++};++++template <typename Load>++__global__ void sum_kernel(int n, Load load, Float* partial, unsigned int* counter, Float* out)++{++ using BlockReduce = cub::BlockReduce<Float, kBlockDim>;++ __shared__ typename BlockReduce::TempStorage temp;++ __shared__ bool last;++ Float acc = 0;++ for(int i = blockIdx.x * kBlockDim + threadIdx.x; i < n; i += gridDim.x * kBlockDim)++ acc += load(i);++ Float s = BlockReduce(temp).Sum(acc);++ if(threadIdx.x == 0)++ {++ partial[blockIdx.x] = s;++ __threadfence();++ last = atomicAdd(counter, 1u) == gridDim.x - 1; // integer count: order-independent++ }++ __syncthreads();++ if(!last)++ return;++ __threadfence();++ Float acc2 = 0;++ for(int i = threadIdx.x; i < static_cast<int>(gridDim.x); i += kBlockDim)++ acc2 += __ldcg(partial + i);++ Float total = BlockReduce(temp).Sum(acc2);++ if(threadIdx.x == 0)++ {++ *out = total;++ *counter = 0;++ }++}++++// *out (device) = sum_{i<n} load(i), bit-reproducible. Default stream.++template <typename Load>++void sum(int n, Load load, SumScratch& scratch, Float* out)++{++ int g = grid_size(n);++ if(scratch.partial.size() < static_cast<size_t>(g))++ scratch.partial.resize(g);++ if(scratch.counter.size() == 0)++ {++ scratch.counter.resize(1);++ cudaMemset(scratch.counter.data(), 0, sizeof(unsigned int));++ }++ sum_kernel<<<g, kBlockDim>>>(n, load, scratch.partial.data(), scratch.counter.data(), out);++}++++struct DotLoad++{++ const Float* x;++ const Float* y;++ __device__ Float operator()(int i) const { return x[i] * y[i]; }++};++++struct ArrayLoad++{++ const Float* a;++ __device__ Float operator()(int i) const { return a[i]; }++};++} // namespace uipc::backend::cuda::det+diff --git a/src/backends/cuda/linear_system/det_spmv.h b/src/backends/cuda/linear_system/det_spmv.h+new file mode 100644+index 0000000..c93e6cd+--- /dev/null++++ b/src/backends/cuda/linear_system/det_spmv.h+@@ -0,0 +1,78 @@++#pragma once++// Deterministic symmetric block SpMV (TopoGym determinism series, patch 0001).++//++// The symmetric BCOO matrix stores one triangle. Spmv::rbk_sym_spmv(_dot) scatters every off-diagonal block into two++// block rows with atomic adds (y_i += A_ij x_j across warp segments, y_j += A_ij^T x_i) and atomically adds warp sums++// into the dot product, so y and p^T A p round differently from run to run. DetSymSpmv instead expands A, after every++// assembly, into a row-sorted block CSR holding both triangles (integer-only plan: cub radix sort of (row, col) keys;++// then the blocks, transposed where needed, are copied into that order) and splits the block rows into short and long++// ones. A short row gets 4 lanes (lane l sums the row's blocks l, l + 4, ... in order, a fixed xor butterfly combines++// them); a long row (the affine-body rows that touch many contacts) gets a whole thread block (a fixed cub::BlockReduce++// tree). The fused dot sums each lane group's rows in loop order and each thread block's groups in group order, and the++// last thread block to finish sums the per-block partials in index order. Every partial sum has a fixed place in a fixed++// order: no result depends on the scheduler.++#include <algorithm>++#include <type_define.h>++#include <uipc/common/log.h>++#include <linear_system/det_reduce.h>++#include <muda/buffer/device_buffer.h>++#include <muda/buffer/var_view.h>++#include <muda/ext/linear_system/bcoo_matrix_view.h>++#include <muda/ext/linear_system/dense_vector_view.h>++++namespace uipc::backend::cuda++{++class DetSymSpmv++{++ public:++ // the expanded CSR of A's current values and sparsity (call after every assembly / conversion of A)++ void build(muda::CBCOOMatrixView<Float, 3> A);++++ // y = a * A * x + b * y++ void spmv(Float a,++ muda::CBCOOMatrixView<Float, 3> A,++ muda::CDenseVectorView<Float> x,++ Float b,++ muda::DenseVectorView<Float> y);++++ // y = a * A * x + b * y and d_dot = x^T (a * A * x)++ void spmv_dot(Float a,++ muda::CBCOOMatrixView<Float, 3> A,++ muda::CDenseVectorView<Float> x,++ Float b,++ muda::DenseVectorView<Float> y,++ muda::VarView<Float> d_dot);++++ bool built() const { return m_built; }++++++ private:++ void run(Float a, muda::CBCOOMatrixView<Float, 3> A, muda::CDenseVectorView<Float> x, Float b,++ muda::DenseVectorView<Float> y, Float* dot_out);++++ bool m_built = false;++ int m_rows = 0;++ int m_entries = 0;++ int m_triplets = 0;++ const Matrix3x3* m_values = nullptr; // A's block storage at build time++ int m_n_short = 0;++ int m_n_long = 0;++++ muda::DeviceBuffer<int> m_entry_counts; // per triplet: 1 (diagonal) or 2++ muda::DeviceBuffer<int> m_entry_offsets;++ muda::DeviceBuffer<unsigned long long> m_keys_in;++ muda::DeviceBuffer<unsigned long long> m_keys_out;++ muda::DeviceBuffer<int> m_vals_in; // 2 * triplet + transposed++ muda::DeviceBuffer<int> m_vals_out;++ muda::DeviceBuffer<int> m_row_counts;++ muda::DeviceBuffer<int> m_row_offsets;++ muda::DeviceBuffer<Matrix3x3> m_csr_blocks; // row-sorted blocks of both triangles++ muda::DeviceBuffer<int> m_csr_cols;++ muda::DeviceBuffer<int> m_row_flag; // 1 = long row++ muda::DeviceBuffer<int> m_row_pos;++ muda::DeviceBuffer<int> m_short_rows;++ muda::DeviceBuffer<int> m_long_rows;++ det::SumScratch m_dot_scratch; // fused dot: per-block partials + counter++ muda::DeviceBuffer<std::byte> m_temp;++};++} // namespace uipc::backend::cuda+diff --git a/src/backends/cuda/linear_system/global_linear_system.cu b/src/backends/cuda/linear_system/global_linear_system.cu+index b7615c4..2fefbdc 100644+--- a/src/backends/cuda/linear_system/global_linear_system.cu++++ b/src/backends/cuda/linear_system/global_linear_system.cu+@@ -226,6 +226,7 @@ void GlobalLinearSystem::Impl::build_linear_system()++ converter.ge2sym(triplet_A);+ converter.convert(triplet_A, bcoo_A);++ det_spmver.build(bcoo_A.cview()); // TopoGym determinism series, patch 0001++ _assemble_preconditioner();++@@ -497,7 +498,8 @@ void GlobalLinearSystem::Impl::spmv(Float a,+ Float b,+ muda::DenseVectorView<Float> y)+ {+- spmver.rbk_sym_spmv(a, bcoo_A.cview(), x, b, y);++ // TopoGym determinism series, patch 0001: gather SpMV (no atomic scatter)++ det_spmver.spmv(a, bcoo_A.cview(), x, b, y);++ // Just some debug options+ // * spmver.sym_spmv(a, bcoo_A.cview(), x, b, y); // Slightly slower+@@ -508,7 +510,8 @@ void GlobalLinearSystem::Impl::spmv_dot(muda::CDenseVectorView<Float> x,+ muda::DenseVectorView<Float> y,+ muda::VarView<Float> d_dot)+ {+- spmver.rbk_sym_spmv_dot(1.0, bcoo_A.cview(), x, 0.0, y, d_dot);++ // TopoGym determinism series, patch 0001: gather SpMV + two-pass dot (no atomics)++ det_spmver.spmv_dot(1.0, bcoo_A.cview(), x, 0.0, y, d_dot);+ }++ bool GlobalLinearSystem::Impl::accuracy_statisfied(muda::DenseVectorView<Float> r)+diff --git a/src/backends/cuda/linear_system/global_linear_system.h b/src/backends/cuda/linear_system/global_linear_system.h+index d03f138..42d74d2 100644+--- a/src/backends/cuda/linear_system/global_linear_system.h++++ b/src/backends/cuda/linear_system/global_linear_system.h+@@ -1,4 +1,5 @@+ #pragma once++#include <linear_system/det_spmv.h>+ #include <sim_system.h>+ #include <functional>+ #include <uipc/common/list.h>+@@ -308,6 +309,7 @@ class GlobalLinearSystem : public SimSystem+ muda::DeviceDenseMatrix<Float> debug_A; // dense A for debug++ Spmv spmver;++ DetSymSpmv det_spmver; // TopoGym determinism series, patch 0001+ MatrixConverter<Float, 3> converter;++ bool initialized = false;+diff --git a/src/backends/cuda/linear_system/linear_fused_pcg.cu b/src/backends/cuda/linear_system/linear_fused_pcg.cu+index 705b621..6ab6fc4 100644+--- a/src/backends/cuda/linear_system/linear_fused_pcg.cu++++ b/src/backends/cuda/linear_system/linear_fused_pcg.cu+@@ -3,6 +3,8 @@+ #include <linear_system/global_linear_system.h>+ #include <uipc/common/timer.h>+ #include <cub/warp/warp_reduce.cuh>++#include <linear_system/det_reduce.h>++#include <muda/buffer/device_buffer.h>+ namespace uipc::backend::cuda+ {+ REGISTER_SIM_SYSTEM(LinearFusedPCG);+@@ -115,42 +117,14 @@ void LinearFusedPCG::check_iter_rz_nan_inf(Float rz, SizeT k)+ }+ }++-// d_result = x^T * y (cublas-free, device-only, CUB warp reduction)++// d_result = x^T * y, bit-reproducible (TopoGym determinism series, patch 0001: replaces the warp sums atomically added++// into d_result, whose order followed the scheduler).+ void fused_dot(muda::CDenseVectorView<Float> x,+ muda::CDenseVectorView<Float> y,+ muda::VarView<Float> d_result)+ {+- using namespace muda;+-+- cudaMemsetAsync(d_result.data(), 0, sizeof(Float));+-+- constexpr int block_dim = 256;+- constexpr int warp_size = 32;+- constexpr int num_warps = block_dim / warp_size;+- int n = x.size();+- int block_count = (n + block_dim - 1) / block_dim;+-+- Launch(block_count, block_dim)+- .file_line(__FILE__, __LINE__)+- .apply(+- [x = x.cviewer().name("x"),+- y = y.cviewer().name("y"),+- d_result = d_result.viewer().name("d_result"),+- n] __device__() mutable+- {+- using WarpReduce = cub::WarpReduce<Float, warp_size>;+- __shared__ typename WarpReduce::TempStorage temp_storage[num_warps];+-+- int i = blockIdx.x * blockDim.x + threadIdx.x;+- Float val = (i < n) ? x(i) * y(i) : Float(0);+-+- int warp_id = threadIdx.x / warp_size;+- int lane_id = threadIdx.x & (warp_size - 1);+- Float warp_sum = WarpReduce(temp_storage[warp_id]).Sum(val);+-+- if(lane_id == 0)+- muda::atomic_add(d_result.data(), warp_sum);+- });++ static det::SumScratch scratch;++ det::sum(static_cast<int>(x.size()), det::DotLoad{x.data(), y.data()}, scratch, d_result.data());+ }++ // Same as linear_pcg update_xr: alpha = rz/pAp, x += alpha*p, r -= alpha*Ap. Alpha computed on device from d_rz, d_pAp.+diff --git a/src/backends/cuda/linear_system/spmv.cu b/src/backends/cuda/linear_system/spmv.cu+index e54f421..bec5d1c 100644+--- a/src/backends/cuda/linear_system/spmv.cu++++ b/src/backends/cuda/linear_system/spmv.cu+@@ -1,4 +1,8 @@+ #include <linear_system/spmv.h>++#include <linear_system/det_spmv.h>++#include <linear_system/det_reduce.h>++#include <cub/device/device_scan.cuh>++#include <cub/device/device_radix_sort.cuh>+ #include <muda/launch/launch.h>+ #include <cub/warp/warp_reduce.cuh>+ #include <cub/warp/warp_scan.cuh>+@@ -629,4 +633,414 @@ void Spmv::cpu_sym_spmv(Float a,+ // Copy result back to device+ y.buffer_view().copy_from(y_host.data());+ }++++// ---- DetSymSpmv (TopoGym determinism series, patch 0001; see det_spmv.h) ---------------------------------------------++namespace det_spmv_detail++{++__global__ void count_entries(int T, const int* ri, const int* ci, int* counts)++{++ int t = blockIdx.x * blockDim.x + threadIdx.x;++ if(t < T)++ counts[t] = (ri[t] == ci[t]) ? 1 : 2;++ else if(t == T)++ counts[t] = 0;++}++++__global__ void fill_entries(int T, const int* ri, const int* ci, const int* offsets, unsigned long long* keys, int* vals)++{++ int t = blockIdx.x * blockDim.x + threadIdx.x;++ if(t >= T)++ return;++ unsigned long long i = static_cast<unsigned int>(ri[t]);++ unsigned long long j = static_cast<unsigned int>(ci[t]);++ int o = offsets[t];++ keys[o] = (i << 32) | j;++ vals[o] = 2 * t;++ if(i != j)++ {++ keys[o + 1] = (j << 32) | i;++ vals[o + 1] = 2 * t + 1;++ }++}++++__global__ void count_rows(int m, const unsigned long long* keys, int* row_counts)++{++ int e = blockIdx.x * blockDim.x + threadIdx.x;++ if(e < m)++ atomicAdd(&row_counts[keys[e] >> 32], 1); // integer counts: the result does not depend on the order++}++++__global__ void pack_csr(int m, const int* vals, const int* ri, const int* ci, const Matrix3x3* blocks,++ Matrix3x3* csr_blocks, int* csr_cols)++{++ int e = blockIdx.x * blockDim.x + threadIdx.x;++ if(e >= m)++ return;++ int v = vals[e];++ int t = v >> 1;++ if(v & 1)++ {++ csr_blocks[e] = blocks[t].transpose();++ csr_cols[e] = ri[t];++ }++ else++ {++ csr_blocks[e] = blocks[t];++ csr_cols[e] = ci[t];++ }++}++++// Rows are split once per assembly (integer only) into short rows (at most kLongRowMin - 1 blocks) and long rows. A++// short row gets LS lanes (lane l sums the row's blocks l, l + LS, ... in order, a fixed xor butterfly combines the++// lanes); a long row gets a whole thread block (a fixed cub::BlockReduce tree combines the threads). Both groups loop over their row list with a fixed grid stride (grid sizes depend++// only on the row counts), every lane of a warp takes part in every shuffle. With a dot product, each lane group sums++// its rows' dots in loop order, the thread block sums its groups in group order into partial[block], and the last++// thread block to finish (integer atomic counter) sums the partials in index order. Every partial sum has a fixed place++// in a fixed order, so y and the dot do not depend on the scheduler.++constexpr int kSpmvBlock = 128;++constexpr int kShortLanes = 4; // lanes per short row++constexpr int kLongRowMin = 33; // rows with at least this many blocks take a whole thread block++constexpr int kMaxShortGrid = 512;++constexpr int kMaxLongGrid = 64;++++__global__ void flag_long_rows(int rows, const int* row_offsets, int* flag)++{++ int r = blockIdx.x * blockDim.x + threadIdx.x;++ if(r < rows)++ flag[r] = (row_offsets[r + 1] - row_offsets[r]) >= kLongRowMin ? 1 : 0;++ else if(r == rows)++ flag[r] = 0;++}++++__global__ void split_rows(int rows, const int* flag, const int* pos, int* short_rows, int* long_rows)++{++ int r = blockIdx.x * blockDim.x + threadIdx.x;++ if(r >= rows)++ return;++ if(flag[r])++ long_rows[pos[r]] = r;++ else++ short_rows[r - pos[r]] = r;++}++++// one row by L lanes; every lane calls it (shuffles); returns the row's dot contribution on lane 0 of the group++template <int L>++__device__ __forceinline__ Float row_product(bool valid,++ int r,++ int lane,++ Float a,++ Float b,++ const int* row_offsets,++ const Matrix3x3* csr_blocks,++ const int* csr_cols,++ const Float* x,++ Float* y)++{++ constexpr unsigned full = 0xffffffffu;++ Float acc0 = 0, acc1 = 0, acc2 = 0;++ if(valid)++ {++ int end = row_offsets[r + 1];++ for(int e = row_offsets[r] + lane; e < end; e += L)++ {++ const Matrix3x3& blk = csr_blocks[e];++ int c = csr_cols[e];++ Float x0 = x[3 * c], x1 = x[3 * c + 1], x2 = x[3 * c + 2];++ acc0 += blk(0, 0) * x0 + blk(0, 1) * x1 + blk(0, 2) * x2;++ acc1 += blk(1, 0) * x0 + blk(1, 1) * x1 + blk(1, 2) * x2;++ acc2 += blk(2, 0) * x0 + blk(2, 1) * x1 + blk(2, 2) * x2;++ }++ }++#pragma unroll++ for(int k = L / 2; k > 0; k >>= 1)++ {++ acc0 += __shfl_xor_sync(full, acc0, k, L);++ acc1 += __shfl_xor_sync(full, acc1, k, L);++ acc2 += __shfl_xor_sync(full, acc2, k, L);++ }++ Float rd = 0;++ if(valid && lane == 0)++ {++ Float ax0 = a * acc0, ax1 = a * acc1, ax2 = a * acc2;++ rd = x[3 * r] * ax0 + x[3 * r + 1] * ax1 + x[3 * r + 2] * ax2;++ if(b != 0)++ {++ ax0 += b * y[3 * r];++ ax1 += b * y[3 * r + 1];++ ax2 += b * y[3 * r + 2];++ }++ y[3 * r] = ax0;++ y[3 * r + 1] = ax1;++ y[3 * r + 2] = ax2;++ }++ return rd;++}++++// blocks [0, grid_short): short rows, LS lanes each; blocks [grid_short, gridDim.x): long rows, full warps++template <int LS, bool WithDot>++__global__ void gather_spmv(int n_short,++ int n_long,++ int grid_short,++ const int* short_rows,++ const int* long_rows,++ Float a,++ Float b,++ const int* row_offsets,++ const Matrix3x3* csr_blocks,++ const int* csr_cols,++ const Float* x,++ Float* y,++ Float* partial,++ unsigned int* counter,++ Float* dot_out)++{++ __shared__ Float group_dot[kSpmvBlock / LS];++ __shared__ bool last;++ Float mine = 0;++ int lane, group, groups;++ if(static_cast<int>(blockIdx.x) < grid_short)++ {++ constexpr int RPB = kSpmvBlock / LS;++ lane = threadIdx.x % LS;++ group = threadIdx.x / LS;++ groups = RPB;++ int stride = grid_short * RPB;++ int rounds = (n_short + stride - 1) / stride; // the same for every thread++ for(int k = 0; k < rounds; ++k)++ {++ int i = blockIdx.x * RPB + group + k * stride;++ bool valid = i < n_short;++ mine += row_product<LS>(valid, valid ? short_rows[i] : 0, lane, a, b, row_offsets, csr_blocks, csr_cols, x, y);++ }++ }++ else++ {++ // long rows: one thread block per row (thread t sums the row's blocks t, t + kSpmvBlock, ... in order; a++ // cub::BlockReduce, a fixed tree, combines the threads); the blocks loop over the long-row list with a fixed stride++ using BlockReduceRow = cub::BlockReduce<Float, kSpmvBlock>;++ __shared__ typename BlockReduceRow::TempStorage row_temp;++ int grid_long = gridDim.x - grid_short;++ int rounds = (n_long + grid_long - 1) / grid_long; // the same for every thread++ lane = threadIdx.x;++ group = 0;++ groups = 1;++ for(int k = 0; k < rounds; ++k)++ {++ int i = (blockIdx.x - grid_short) + k * grid_long;++ bool valid = i < n_long; // the same for the whole thread block++ int r = valid ? long_rows[i] : 0;++ Float acc0 = 0, acc1 = 0, acc2 = 0;++ if(valid)++ {++ int end = row_offsets[r + 1];++ for(int e = row_offsets[r] + threadIdx.x; e < end; e += kSpmvBlock)++ {++ const Matrix3x3& blk = csr_blocks[e];++ int c = csr_cols[e];++ Float x0 = x[3 * c], x1 = x[3 * c + 1], x2 = x[3 * c + 2];++ acc0 += blk(0, 0) * x0 + blk(0, 1) * x1 + blk(0, 2) * x2;++ acc1 += blk(1, 0) * x0 + blk(1, 1) * x1 + blk(1, 2) * x2;++ acc2 += blk(2, 0) * x0 + blk(2, 1) * x1 + blk(2, 2) * x2;++ }++ }++ Float s0 = BlockReduceRow(row_temp).Sum(acc0);++ __syncthreads();++ Float s1 = BlockReduceRow(row_temp).Sum(acc1);++ __syncthreads();++ Float s2 = BlockReduceRow(row_temp).Sum(acc2);++ __syncthreads();++ if(valid && threadIdx.x == 0)++ {++ Float ax0 = a * s0, ax1 = a * s1, ax2 = a * s2;++ mine += x[3 * r] * ax0 + x[3 * r + 1] * ax1 + x[3 * r + 2] * ax2;++ if(b != 0)++ {++ ax0 += b * y[3 * r];++ ax1 += b * y[3 * r + 1];++ ax2 += b * y[3 * r + 2];++ }++ y[3 * r] = ax0;++ y[3 * r + 1] = ax1;++ y[3 * r + 2] = ax2;++ }++ }++ }++ if constexpr(WithDot)++ {++ if(lane == 0)++ group_dot[group] = mine;++ __syncthreads();++ if(threadIdx.x == 0)++ {++ Float s = 0;++ for(int g = 0; g < groups; ++g)++ s += group_dot[g];++ partial[blockIdx.x] = s;++ __threadfence();++ last = atomicAdd(counter, 1u) == gridDim.x - 1; // integer count: order-independent++ }++ __syncthreads();++ if(!last)++ return;++ __threadfence();++ using BlockReduce = cub::BlockReduce<Float, kSpmvBlock>;++ __shared__ typename BlockReduce::TempStorage temp;++ Float acc = 0;++ for(int i = threadIdx.x; i < static_cast<int>(gridDim.x); i += kSpmvBlock)++ acc += __ldcg(partial + i);++ Float total = BlockReduce(temp).Sum(acc);++ if(threadIdx.x == 0)++ {++ *dot_out = total;++ *counter = 0;++ }++ }++}++++template <int LS>++void launch_gather(int n_short, int n_long, const int* short_rows, const int* long_rows, Float a, Float b,++ const int* row_offsets, const Matrix3x3* csr_blocks, const int* csr_cols, const Float* x, Float* y,++ det::SumScratch* scratch, Float* dot_out)++{++ constexpr int rpb_short = kSpmvBlock / LS;++ int grid_short = n_short > 0 ? std::min((n_short + rpb_short - 1) / rpb_short, kMaxShortGrid) : 0;++ int grid_long = n_long > 0 ? std::min(n_long, kMaxLongGrid) : 0;++ int grid = grid_short + grid_long;++ if(grid == 0)++ return;++ if(dot_out)++ {++ if(scratch->partial.size() < static_cast<size_t>(grid))++ scratch->partial.resize(grid);++ if(scratch->counter.size() == 0)++ {++ scratch->counter.resize(1);++ cudaMemset(scratch->counter.data(), 0, sizeof(unsigned int));++ }++ gather_spmv<LS, true><<<grid, kSpmvBlock>>>(n_short, n_long, grid_short, short_rows, long_rows, a, b, row_offsets,++ csr_blocks, csr_cols, x, y, scratch->partial.data(),++ scratch->counter.data(), dot_out);++ }++ else++ {++ gather_spmv<LS, false><<<grid, kSpmvBlock>>>(n_short, n_long, grid_short, short_rows, long_rows, a, b,++ row_offsets, csr_blocks, csr_cols, x, y, nullptr, nullptr, nullptr);++ }++}++} // namespace det_spmv_detail++++void DetSymSpmv::build(muda::CBCOOMatrixView<Float, 3> A)++{++ using namespace det_spmv_detail;++ constexpr int bd = 256;++ m_triplets = A.triplet_count();++ m_rows = A.total_rows();++ int T = m_triplets;++ const int* ri = A.row_indices().data();++ const int* ci = A.col_indices().data();++++ m_entry_counts.resize(T + 1);++ m_entry_offsets.resize(T + 1);++ count_entries<<<(T + 1 + bd - 1) / bd, bd>>>(T, ri, ci, m_entry_counts.data());++ size_t bytes = 0;++ cub::DeviceScan::ExclusiveSum(nullptr, bytes, m_entry_counts.data(), m_entry_offsets.data(), T + 1);++ if(m_temp.size() < bytes)++ m_temp.resize(bytes);++ cub::DeviceScan::ExclusiveSum((void*)m_temp.data(), bytes, m_entry_counts.data(), m_entry_offsets.data(), T + 1);++ int m = 0;++ cudaMemcpy(&m, m_entry_offsets.data() + T, sizeof(int), cudaMemcpyDeviceToHost);++ m_entries = m;++++ m_keys_in.resize(m);++ m_keys_out.resize(m);++ m_vals_in.resize(m);++ m_vals_out.resize(m);++ if(T > 0)++ fill_entries<<<(T + bd - 1) / bd, bd>>>(T, ri, ci, m_entry_offsets.data(), m_keys_in.data(), m_vals_in.data());++ bytes = 0;++ cub::DeviceRadixSort::SortPairs(nullptr, bytes, m_keys_in.data(), m_keys_out.data(), m_vals_in.data(),++ m_vals_out.data(), m);++ if(m_temp.size() < bytes)++ m_temp.resize(bytes);++ cub::DeviceRadixSort::SortPairs((void*)m_temp.data(), bytes, m_keys_in.data(), m_keys_out.data(),++ m_vals_in.data(), m_vals_out.data(), m);++++ m_row_counts.resize(m_rows + 1);++ m_row_offsets.resize(m_rows + 1);++ cudaMemset(m_row_counts.data(), 0, (m_rows + 1) * sizeof(int));++ if(m > 0)++ count_rows<<<(m + bd - 1) / bd, bd>>>(m, m_keys_out.data(), m_row_counts.data());++ bytes = 0;++ cub::DeviceScan::ExclusiveSum(nullptr, bytes, m_row_counts.data(), m_row_offsets.data(), m_rows + 1);++ if(m_temp.size() < bytes)++ m_temp.resize(bytes);++ cub::DeviceScan::ExclusiveSum((void*)m_temp.data(), bytes, m_row_counts.data(), m_row_offsets.data(), m_rows + 1);++++ m_csr_blocks.resize(m);++ m_csr_cols.resize(m);++ m_values = A.values().data();++ if(m > 0)++ pack_csr<<<(m + bd - 1) / bd, bd>>>(m, m_vals_out.data(), ri, ci, m_values, m_csr_blocks.data(), m_csr_cols.data());++++ // short / long row lists (integer only)++ m_row_flag.resize(m_rows + 1);++ m_row_pos.resize(m_rows + 1);++ flag_long_rows<<<(m_rows + 1 + bd - 1) / bd, bd>>>(m_rows, m_row_offsets.data(), m_row_flag.data());++ bytes = 0;++ cub::DeviceScan::ExclusiveSum(nullptr, bytes, m_row_flag.data(), m_row_pos.data(), m_rows + 1);++ if(m_temp.size() < bytes)++ m_temp.resize(bytes);++ cub::DeviceScan::ExclusiveSum((void*)m_temp.data(), bytes, m_row_flag.data(), m_row_pos.data(), m_rows + 1);++ int n_long = 0;++ cudaMemcpy(&n_long, m_row_pos.data() + m_rows, sizeof(int), cudaMemcpyDeviceToHost);++ m_n_long = n_long;++ m_n_short = m_rows - n_long;++ m_short_rows.resize(std::max(m_n_short, 1));++ m_long_rows.resize(std::max(m_n_long, 1));++ if(m_rows > 0)++ split_rows<<<(m_rows + bd - 1) / bd, bd>>>(m_rows, m_row_flag.data(), m_row_pos.data(), m_short_rows.data(),++ m_long_rows.data());++ m_built = true;++}++++void DetSymSpmv::run(Float a,++ muda::CBCOOMatrixView<Float, 3> A,++ muda::CDenseVectorView<Float> x,++ Float b,++ muda::DenseVectorView<Float> y,++ Float* dot_out)++{++ using namespace det_spmv_detail;++ UIPC_ASSERT(m_built && m_triplets == A.triplet_count() && m_values == A.values().data() && 3 * m_rows == x.size()++ && x.size() == y.size(),++ "DetSymSpmv: the expanded CSR does not match the matrix (rebuild after assembling A)");++ if(m_rows <= 0)++ return;++ const int* ro = m_row_offsets.data();++ const Matrix3x3* cb = m_csr_blocks.data();++ const int* cc = m_csr_cols.data();++ const int* sr = m_short_rows.data();++ const int* lr = m_long_rows.data();++ launch_gather<kShortLanes>(m_n_short, m_n_long, sr, lr, a, b, ro, cb, cc, x.data(), y.data(), &m_dot_scratch, dot_out);++}++++void DetSymSpmv::spmv(Float a,++ muda::CBCOOMatrixView<Float, 3> A,++ muda::CDenseVectorView<Float> x,++ Float b,++ muda::DenseVectorView<Float> y)++{++ run(a, A, x, b, y, nullptr);++}++++void DetSymSpmv::spmv_dot(Float a,++ muda::CBCOOMatrixView<Float, 3> A,++ muda::CDenseVectorView<Float> x,++ Float b,++ muda::DenseVectorView<Float> y,++ muda::VarView<Float> d_dot)++{++ run(a, A, x, b, y, d_dot.data());++}+++ } // namespace uipc::backend::cuda+\ No newline at end of file+--+2.34.1+diff --git a/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0002-det-assembly-candidates.patch b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0002-det-assembly-candidates.patchnew file mode 100644index 0000000000..76867d0d7b--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0002-det-assembly-candidates.patch@@ -0,0 +1,600 @@+From 4e5008e32aab59ca738228fba007899c646900d1 Mon Sep 17 00:00:00 2001+From: qineng-det <[email protected]>+Date: Mon, 5 Oct 2026 14:00:38 -0500+Subject: [PATCH 2/4] cuda: reproducible assembly and contact candidate order+ (TopoGym determinism series 2/4)++Gradient / diagonal-Hessian assembly and contact candidate lists no longer+depend on the scheduler. Physics unchanged; only orders are fixed.++Atomics replaced:+- finite_element/fem_linear_subsystem.cu: gradient doublets atomic_add'ed+ into the global gradient (kinetic, reporters, dytopo effects) ->+ det::SegmentedAdder (det_scatter.h): stable radix sort of the doublet+ keys, run-length encode, one thread per (vertex, component) sums its run+ in production order; fixed vertices skipped as before.+- affine_body/abd_linear_subsystem.cu: reporter and dytopo gradients+ atomic_add'ed per body -> SegmentedAdder (12 per body); the diag_hessian+ atomic adds of reporter and dytopo 12x12 diagonal blocks ->+ SegmentedAdder (144 per body).+- collision_detection AtomicCountingLBVH::detect / query (linear_bvh broad+ phase): candidate pairs appended through an atomic counter, so their+ order (hence contact doublet / triplet order) followed the scheduler ->+ canonical_sort(): pairs sorted by (i, j) with cub radix sort after every+ detect / query.+- collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu:+ vertex / half-plane candidates appended through an atomic counter ->+ sorted canonically before use.+---+ .../cuda/affine_body/abd_linear_subsystem.cu | 94 ++++++++------+ .../atomic_counting_lbvh.cu | 40 +++++++ .../atomic_counting_lbvh.h | 8 +++ .../details/atomic_counting_lbvh.inl | 2 ++ ...asy_vertex_half_plane_trajectory_filter.cu | 34 ++++++ .../finite_element/fem_linear_subsystem.cu | 64 ++++------+ src/backends/cuda/linear_system/det_scatter.h | 118 +++++++++++++++++++ 7 files changed, 280 insertions(+), 80 deletions(-)+ create mode 100644 src/backends/cuda/linear_system/det_scatter.h++diff --git a/src/backends/cuda/affine_body/abd_linear_subsystem.cu b/src/backends/cuda/affine_body/abd_linear_subsystem.cu+index b4f4e4e..220d4aa 100644+--- a/src/backends/cuda/affine_body/abd_linear_subsystem.cu++++ b/src/backends/cuda/affine_body/abd_linear_subsystem.cu+@@ -10,6 +10,7 @@+ #include <affine_body/affine_body_kinetic.h>+ #include <affine_body/affine_body_constitution.h>+ #include <utils/report_extent_check.h>++#include <linear_system/det_scatter.h>++ namespace uipc::backend::cuda+ {+@@ -319,26 +320,12 @@ void ABDLinearSubsystem::Impl::_assemble_reporters(IndexT& offset,+ }++ if(reporter_gradients.doublet_count())+- {+- ParallelFor()+- .file_line(__FILE__, __LINE__)+- .apply(reporter_gradients.doublet_count(),+- [dst = info.gradients().viewer().name("dst_gradient"),+- src = reporter_gradients.cviewer().name("src_gradient"),+- is_fixed = abd().body_id_to_is_fixed.cviewer().name(+- "is_fixed")] __device__(int I) mutable+- {+- auto&& [body_i, G12] = src(I);+-+- if(is_fixed(body_i))+- {+- // Do nothing+- }+- else+- {+- dst.segment<12>(body_i * 12).atomic_add(G12);+- }+- });++ { // TopoGym determinism series, patch 0002: per-body sums in doublet order (was: atomic_add per doublet)++ static det::SegmentedAdder adder;++ auto src = reporter_gradients.view();++ adder.add(src.doublet_count(), src.indices().data(), src.subvector_offset(),++ reinterpret_cast<const Float*>(src.values().data()), 12, info.gradients().data(),++ abd().body_id_to_is_fixed.data());+ }++ if(!info.gradient_only() && reporter_hessians.triplet_count())+@@ -346,12 +333,21 @@ void ABDLinearSubsystem::Impl::_assemble_reporters(IndexT& offset,+ // get rest+ auto H3x3s = info.hessians().subview(offset);+++ // TopoGym determinism series, patch 0002: diagonal contributions collected per triplet, summed per body in++ // triplet order after the kernel (was: atomic_add into diag_hessian)++ static muda::DeviceBuffer<int> det_keys;++ static muda::DeviceBuffer<Matrix12x12> det_vals;++ static det::SegmentedAdder det_adder;++ det_keys.resize(reporter_hessians.triplet_count());++ det_vals.resize(reporter_hessians.triplet_count());+++ ParallelFor()+ .file_line(__FILE__, __LINE__)+ .apply(reporter_hessians.triplet_count(),+ [dst = H3x3s.viewer().name("dst_hessian"),+ src = reporter_hessians.cviewer().name("src_hessian"),+- diag_hessian = this->diag_hessian.viewer().name("diag_hessian"),++ det_keys = det_keys.viewer().name("det_keys"),++ det_vals = det_vals.viewer().name("det_vals"),+ is_fixed = abd().body_id_to_is_fixed.cviewer().name(+ "is_fixed")] __device__(int I) mutable+ {+@@ -362,11 +358,9 @@ void ABDLinearSubsystem::Impl::_assemble_reporters(IndexT& offset,++ bool has_fixed = (is_fixed(body_i) || is_fixed(body_j));++- // Fill diagonal hessian for diag-inv preconditioner+- if(body_i == body_j && !has_fixed)+- {+- eigen::atomic_add(diag_hessian(body_i), H12x12);+- }++ // Fill diagonal hessian for diag-inv preconditioner (summed per body after the kernel)++ det_keys(I) = (body_i == body_j && !has_fixed) ? body_i : -1;++ det_vals(I) = H12x12;++ if(has_fixed)+ {+@@ -393,6 +387,10 @@ void ABDLinearSubsystem::Impl::_assemble_reporters(IndexT& offset,+ H12x12);+ });+++ det_adder.add(reporter_hessians.triplet_count(), det_keys.data(), 0,++ reinterpret_cast<const Float*>(det_vals.data()), 144,++ reinterpret_cast<Float*>(diag_hessian.data()), nullptr);+++ offset += reporter_hessians.triplet_count() * (4 * 4);+ }+ }+@@ -411,18 +409,24 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,+ }++ if(dytopo_effect_gradient_count)+- {++ { // TopoGym determinism series, patch 0002: per-contribution G12 = J^T G3, summed per body in doublet order++ // (was: atomic_add per contribution)++ static muda::DeviceBuffer<int> det_keys;++ static muda::DeviceBuffer<Vector12> det_vals;++ static det::SegmentedAdder det_adder;++ det_keys.resize(dytopo_effect_gradient_count);++ det_vals.resize(dytopo_effect_gradient_count);+ ParallelFor()+ .file_line(__FILE__, __LINE__)+ .apply(dytopo_effect_gradient_count,+ [dytopo_effect_gradient =+ dytopo_effect_receiver->gradients().cviewer().name("dytopo_effect_gradient"),+- gradients = info.gradients().viewer().name("gradients"),++ det_keys = det_keys.viewer().name("det_keys"),++ det_vals = det_vals.viewer().name("det_vals"),+ v2b = abd().vertex_id_to_body_id.cviewer().name("v2b"),+ Js = abd().vertex_id_to_J.cviewer().name("Js"),+ is_fixed = abd().body_id_to_is_fixed.cviewer().name("is_fixed"),+- vertex_offset = vertex_offset,+- cout = KernelCout::viewer()] __device__(int I) mutable++ vertex_offset = vertex_offset] __device__(int I) mutable+ {+ const auto& [g_i, G3] = dytopo_effect_gradient(I);++@@ -432,16 +436,17 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,++ if(is_fixed(body_i))+ {+- // Do nothing++ det_keys(I) = -1;++ det_vals(I).setZero();+ }+ else+ {+- Vector12 G12 = J_i.T() * G3;+- gradients.segment<12>(body_i * 12).atomic_add(G12);+-+- // cout << "DG(" << I << "): " << G12.transpose().eval() << "\n";++ det_keys(I) = body_i;++ det_vals(I) = J_i.T() * G3;+ }+ });++ det_adder.add(dytopo_effect_gradient_count, det_keys.data(), 0,++ reinterpret_cast<const Float*>(det_vals.data()), 12, info.gradients().data(), nullptr);+ }++ if(info.gradient_only())+@@ -454,8 +459,15 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,+ auto H3x3_count = dytopo_effect_hessian_count * (4 * 4);+ auto dytopo_effect_H3x3 = info.hessians().subview(offset, H3x3_count);+++ // TopoGym determinism series, patch 0002: diagonal contributions collected per triplet, summed per body after++ // the kernel (was: atomic_add into diag_hessian)++ static muda::DeviceBuffer<int> det_hkeys;++ static muda::DeviceBuffer<Matrix12x12> det_hvals;++ static det::SegmentedAdder det_hadder;+ if(dytopo_effect_hessian_count)+ {++ det_hkeys.resize(dytopo_effect_hessian_count);++ det_hvals.resize(dytopo_effect_hessian_count);+ // Half Contact Hessian+ // ref: https://github.com/spiriMirror/libuipc/issues/272+ ParallelFor()+@@ -467,10 +479,12 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,+ v2b = abd().vertex_id_to_body_id.cviewer().name("v2b"),+ Js = abd().vertex_id_to_J.cviewer().name("Js"),+ is_fixed = abd().body_id_to_is_fixed.cviewer().name("is_fixed"),+- diag_hessian = this->diag_hessian.viewer().name("diag_hessian"),++ det_hkeys = det_hkeys.viewer().name("det_hkeys"),++ det_hvals = det_hvals.viewer().name("det_hvals"),+ vertex_offset = vertex_offset] __device__(int I) mutable+ {+ const auto& [g_i, g_j, H3x3] = dytopo_effect_hessian(I);++ det_hkeys(I) = -1;++ auto i = g_i - vertex_offset;+ auto j = g_j - vertex_offset;+@@ -521,8 +535,9 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,+ H12x12 = ABDJacobi::JT_H_J(J_i.T(), H3x3, J_j);+ }++- // Fill diagonal hessian for diag-inv preconditioner+- eigen::atomic_add(diag_hessian(body_i), H12x12);++ // Fill diagonal hessian for diag-inv preconditioner (summed per body below)++ det_hkeys(I) = body_i;++ det_hvals(I) = H12x12;++ // Since body_i == body_j, we only fill the upper triangle part+ zero_out_lower(H12x12);+@@ -535,6 +550,9 @@ void ABDLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& offset,+ R * 4, // begin col+ H12x12);+ });++ det_hadder.add(dytopo_effect_hessian_count, det_hkeys.data(), 0,++ reinterpret_cast<const Float*>(det_hvals.data()), 144,++ reinterpret_cast<Float*>(diag_hessian.data()), nullptr);+ }++ offset += H3x3_count;+diff --git a/src/backends/cuda/collision_detection/atomic_counting_lbvh.cu b/src/backends/cuda/collision_detection/atomic_counting_lbvh.cu+index 4d875b2..81b2d22 100644+--- a/src/backends/cuda/collision_detection/atomic_counting_lbvh.cu++++ b/src/backends/cuda/collision_detection/atomic_counting_lbvh.cu+@@ -1,3 +1,4 @@++#include <cub/device/device_radix_sort.cuh>+ #include <collision_detection/atomic_counting_lbvh.h>+ #include "stackless_bvh.h"++@@ -13,4 +14,43 @@ void AtomicCountingLBVH::build(muda::CBufferView<LinearBVHAABB> aabbs)+ m_aabbs = aabbs;+ m_lbvh.build(aabbs);+ }++++// TopoGym determinism series, patch 0002: every (i, id) pair occurs once per query, so sorting by the packed key gives++// one canonical candidate order; everything downstream (contact energies, gradients, Hessian triplets, compaction by++// cub::DeviceSelect) follows the candidate index.++void AtomicCountingLBVH::canonical_sort(QueryBuffer& qbuffer)++{++ using namespace muda;++ int n = static_cast<int>(qbuffer.m_size);++ if(n <= 1)++ return;++ cudaStream_t s = m_stream;++ m_sort_keys_in.resize(n);++ m_sort_keys_out.resize(n);++ ParallelFor(0, s)++ .file_line(__FILE__, __LINE__)++ .apply(n,++ [pairs = qbuffer.m_pairs.viewer().name("pairs"),++ keys = m_sort_keys_in.viewer().name("keys")] __device__(int k) mutable++ {++ const Vector2i& p = pairs(k);++ keys(k) = (static_cast<unsigned long long>(static_cast<unsigned int>(p(0))) << 32)++ | static_cast<unsigned int>(p(1));++ });++ size_t bytes = 0;++ cub::DeviceRadixSort::SortKeys(nullptr, bytes, m_sort_keys_in.data(), m_sort_keys_out.data(), n, 0, 64, s);++ if(m_sort_temp.size() < bytes)++ m_sort_temp.resize(bytes);++ cub::DeviceRadixSort::SortKeys((void*)m_sort_temp.data(), bytes, m_sort_keys_in.data(), m_sort_keys_out.data(), n,++ 0, 64, s);++ ParallelFor(0, s)++ .file_line(__FILE__, __LINE__)++ .apply(n,++ [pairs = qbuffer.m_pairs.viewer().name("pairs"),++ keys = m_sort_keys_out.viewer().name("keys")] __device__(int k) mutable++ {++ unsigned long long v = keys(k);++ pairs(k) = Vector2i(static_cast<int>(v >> 32), static_cast<int>(v & 0xffffffffull));++ });++}+ } // namespace uipc::backend::cuda+diff --git a/src/backends/cuda/collision_detection/atomic_counting_lbvh.h b/src/backends/cuda/collision_detection/atomic_counting_lbvh.h+index f97d7d7..fcf69db 100644+--- a/src/backends/cuda/collision_detection/atomic_counting_lbvh.h++++ b/src/backends/cuda/collision_detection/atomic_counting_lbvh.h+@@ -33,7 +33,15 @@ class AtomicCountingLBVH+ template <typename Pred>+ void query(muda::CBufferView<LinearBVHAABB> query_aabbs, Pred p, QueryBuffer& out_pairs);+++ // TopoGym determinism series, patch 0002: query results sorted by (i, id) (their atomic-counter order varies);++ // public because it launches extended device lambdas++ void canonical_sort(QueryBuffer& qbuffer);+++ private:++ muda::DeviceBuffer<unsigned long long> m_sort_keys_in;++ muda::DeviceBuffer<unsigned long long> m_sort_keys_out;++ muda::DeviceBuffer<std::byte> m_sort_temp;+++ muda::CBufferView<LinearBVHAABB> m_aabbs;+ muda::DeviceVar<IndexT> m_cp_num;+ LinearBVH m_lbvh;+diff --git a/src/backends/cuda/collision_detection/details/atomic_counting_lbvh.inl b/src/backends/cuda/collision_detection/details/atomic_counting_lbvh.inl+index 7331659..8b35e07 100644+--- a/src/backends/cuda/collision_detection/details/atomic_counting_lbvh.inl++++ b/src/backends/cuda/collision_detection/details/atomic_counting_lbvh.inl+@@ -53,6 +53,7 @@ void AtomicCountingLBVH::detect(Pred p, QueryBuffer& qbuffer)+ }++ qbuffer.m_size = h_cp_num;++ canonical_sort(qbuffer); // TopoGym determinism series, patch 0002+ }++ template <typename Pred>+@@ -109,5 +110,6 @@ void AtomicCountingLBVH::query(muda::CBufferView<LinearBVHAABB> query_aabbs, Pre+ }++ qbuffer.m_size = h_cp_num;++ canonical_sort(qbuffer); // TopoGym determinism series, patch 0002+ }+ } // namespace uipc::backend::cuda+diff --git a/src/backends/cuda/collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu b/src/backends/cuda/collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu+index 4d6bf12..989b82e 100644+--- a/src/backends/cuda/collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu++++ b/src/backends/cuda/collision_detection/filters/easy_vertex_half_plane_trajectory_filter.cu+@@ -1,3 +1,4 @@++#include <cub/device/device_radix_sort.cuh>+ #include <collision_detection/filters/easy_vertex_half_plane_trajectory_filter.h>+ #include <muda/cub/device/device_reduce.h>+ #include <kernel_cout.h>+@@ -124,6 +125,39 @@ void EasyVertexHalfPlaneTrajectoryFilter::Impl::filter_active(FilterActiveInfo&+ query();+ }+++ { // TopoGym determinism series, patch 0002: candidates in canonical (vertex, plane) order (their atomic-counter++ // order varies)++ static muda::DeviceBuffer<unsigned long long> keys_in, keys_out;++ static muda::DeviceBuffer<std::byte> temp;++ int n = static_cast<int>(h_num_collisions);++ if(n > 1)++ {++ keys_in.resize(n);++ keys_out.resize(n);++ ParallelFor()++ .file_line(__FILE__, __LINE__)++ .apply(n,++ [PHs = PHs.viewer().name("PHs"), keys = keys_in.viewer().name("keys")] __device__(int k) mutable++ {++ const Vector2i& p = PHs(k);++ keys(k) = (static_cast<unsigned long long>(static_cast<unsigned int>(p(0))) << 32)++ | static_cast<unsigned int>(p(1));++ });++ size_t bytes = 0;++ cub::DeviceRadixSort::SortKeys(nullptr, bytes, keys_in.data(), keys_out.data(), n);++ if(temp.size() < bytes)++ temp.resize(bytes);++ cub::DeviceRadixSort::SortKeys((void*)temp.data(), bytes, keys_in.data(), keys_out.data(), n);++ ParallelFor()++ .file_line(__FILE__, __LINE__)++ .apply(n,++ [PHs = PHs.viewer().name("PHs"), keys = keys_out.viewer().name("keys")] __device__(int k) mutable++ {++ unsigned long long v = keys(k);++ PHs(k) = Vector2i(static_cast<int>(v >> 32), static_cast<int>(v & 0xffffffffull));++ });++ }++ }+ info.PHs(PHs.view(0, h_num_collisions));++ if constexpr(PrintDebugInfo)+diff --git a/src/backends/cuda/finite_element/fem_linear_subsystem.cu b/src/backends/cuda/finite_element/fem_linear_subsystem.cu+index c95e2ee..0b7919b 100644+--- a/src/backends/cuda/finite_element/fem_linear_subsystem.cu++++ b/src/backends/cuda/finite_element/fem_linear_subsystem.cu+@@ -12,6 +12,7 @@+ #include <uipc/builtin/attribute_name.h>+ #include <uipc/common/flag.h>+ #include <utils/report_extent_check.h>++#include <linear_system/det_scatter.h>++ namespace uipc::backend::cuda+ {+@@ -247,18 +248,13 @@ void FEMLinearSubsystem::Impl::_assemble_kinetic(IndexT& hess_offset,+ info.gradient_only(), gradient_view, hessian_view, dt_attr->view()[0]};+ kinetic->compute_gradient_hessian(kinetic_info);++- ParallelFor()+- .file_line(__FILE__, __LINE__)+- .apply(kinetic_gradients.doublet_count(),+- [dst = info.gradients().viewer().name("dst_gradient"),+- src = kinetic_gradients.cviewer().name("src_gradient"),+- is_fixed = fem().is_fixed.cviewer().name("is_fixed")] __device__(int I) mutable+- {+- auto&& [i, G3] = src(I);+- if(is_fixed(i))+- return;+- dst.segment<3>(i * 3).atomic_add(G3);+- });++ { // TopoGym determinism series, patch 0002: per-vertex sums in doublet order (was: atomic_add per doublet)++ static det::SegmentedAdder adder;++ auto src = kinetic_gradients.view();++ adder.add(src.doublet_count(), src.indices().data(), src.subvector_offset(),++ reinterpret_cast<const Float*>(src.values().data()), 3, info.gradients().data(),++ fem().is_fixed.data());++ }++ hess_offset += hess_count;+ }+@@ -280,18 +276,13 @@ void FEMLinearSubsystem::Impl::_assemble_reporters(IndexT& hess_offset,+ R->assemble(assemble_info);+ }++- ParallelFor()+- .file_line(__FILE__, __LINE__)+- .apply(reporter_gradients.doublet_count(),+- [dst = info.gradients().viewer().name("dst_gradient"),+- src = reporter_gradients.cviewer().name("src_gradient"),+- is_fixed = fem().is_fixed.cviewer().name("is_fixed")] __device__(int I) mutable+- {+- auto&& [i, G3] = src(I);+- if(is_fixed(i))+- return;+- dst.segment<3>(i * 3).atomic_add(G3);+- });++ { // TopoGym determinism series, patch 0002: per-vertex sums in doublet order (was: atomic_add per doublet)++ static det::SegmentedAdder adder;++ auto src = reporter_gradients.view();++ adder.add(src.doublet_count(), src.indices().data(), src.subvector_offset(),++ reinterpret_cast<const Float*>(src.values().data()), 3, info.gradients().data(),++ fem().is_fixed.data());++ }++ // offset update+ hess_offset += hess_count;+@@ -307,24 +298,13 @@ void FEMLinearSubsystem::Impl::_assemble_dytopo_effect(IndexT& hess_offset,++ // 1) Assemble DyTopoEffect Gradient to Gradient+ if(grad_count)+- {+- ParallelFor()+- .file_line(__FILE__, __LINE__)+- .apply(grad_count,+- [dytopo_effect_gradient =+- dytopo_effect_receiver->gradients().cviewer().name("dytopo_effect_gradient"),+- gradients = info.gradients().viewer().name("gradients"),+- vertex_offset = finite_element_vertex_reporter->vertex_offset(),+- is_fixed = fem().is_fixed.cviewer().name("is_fixed")] __device__(int I) mutable+- {+- const auto& [g_i, G3] = dytopo_effect_gradient(I);+- auto i = g_i - vertex_offset; // from global to local+-+- if(is_fixed(i))+- return;+-+- gradients.segment<3>(i * 3).atomic_add(G3);+- });++ { // TopoGym determinism series, patch 0002: per-vertex sums in doublet order (was: atomic_add per doublet)++ static det::SegmentedAdder adder;++ auto src = dytopo_effect_receiver->gradients();++ adder.add(src.doublet_count(), src.indices().data(),++ src.subvector_offset() + static_cast<int>(finite_element_vertex_reporter->vertex_offset()),++ reinterpret_cast<const Float*>(src.values().data()), 3, info.gradients().data(),++ fem().is_fixed.data());+ }++ if(info.gradient_only())+diff --git a/src/backends/cuda/linear_system/det_scatter.h b/src/backends/cuda/linear_system/det_scatter.h+new file mode 100644+index 0000000..886ab9f+--- /dev/null++++ b/src/backends/cuda/linear_system/det_scatter.h+@@ -0,0 +1,118 @@++#pragma once++// Deterministic keyed accumulation (TopoGym determinism series, patch 0002).++//++// Replaces scatter loops of the form `for each contribution e: atomic_add(dst[key(e)], value(e))` (gradient doublets,++// affine-body diagonal Hessians), whose summation order follows the scheduler. SegmentedAdder sorts the contributions by++// key with a stable radix sort (so equal keys keep the order in which they were produced), finds the runs of equal keys,++// and lets one thread per (key, scalar component) sum its run in that order and add the sum to dst once. All index++// arithmetic is integer; the only float operations are the per-run sums, in a fixed order.++#include <type_define.h>++#include <muda/buffer/device_buffer.h>++#include <cub/device/device_radix_sort.cuh>++#include <cub/device/device_run_length_encode.cuh>++#include <cub/device/device_scan.cuh>++++namespace uipc::backend::cuda::det++{++namespace scatter_detail++{++ template <int Unused = 0>++ __global__ void prepare_keys(int n, const int* keys, int key_shift, int* out_keys, int* out_pos)++ {++ int e = blockIdx.x * blockDim.x + threadIdx.x;++ if(e < n)++ {++ out_keys[e] = keys[e] - key_shift;++ out_pos[e] = e;++ }++ }++++ // thread = (run, component): dst[key * dim + c] += sum over the run, in order, of values[pos * dim + c]++ template <int Unused = 0>++ __global__ void sum_runs(int runs,++ int dim,++ const int* unique_keys,++ const int* run_offsets,++ const int* run_counts,++ const int* sorted_pos,++ const Float* values,++ Float* dst,++ const IndexT* skip)++ {++ int t = blockIdx.x * blockDim.x + threadIdx.x;++ if(t >= runs * dim)++ return;++ int r = t / dim;++ int c = t - r * dim;++ int key = unique_keys[r];++ if(key < 0 || (skip && skip[key]))++ return;++ Float acc = 0;++ int begin = run_offsets[r];++ int end = begin + run_counts[r];++ for(int e = begin; e < end; ++e)++ acc += values[static_cast<size_t>(sorted_pos[e]) * dim + c];++ dst[static_cast<size_t>(key) * dim + c] += acc;++ }++} // namespace scatter_detail++++class SegmentedAdder++{++ public:++ // For every distinct k = keys[e] - key_shift >= 0 among e < n (skip[k] != 0 drops k):++ // dst[k*dim .. k*dim+dim) += sum, in e order, of values[e*dim .. e*dim+dim).++ // `keys`, `values`, `dst`, `skip` are device pointers; default stream.++ void add(int n, const int* keys, int key_shift, const Float* values, int dim, Float* dst, const IndexT* skip = nullptr)++ {++ using namespace scatter_detail;++ if(n <= 0)++ return;++ constexpr int bd = 256;++ m_keys.resize(n);++ m_keys_sorted.resize(n);++ m_pos.resize(n);++ m_pos_sorted.resize(n);++ m_unique.resize(n);++ m_counts.resize(n);++ m_offsets.resize(n);++ m_num_runs.resize(1);++ prepare_keys<<<(n + bd - 1) / bd, bd>>>(n, keys, key_shift, m_keys.data(), m_pos.data());++++ size_t bytes = 0;++ cub::DeviceRadixSort::SortPairs(nullptr, bytes, m_keys.data(), m_keys_sorted.data(), m_pos.data(),++ m_pos_sorted.data(), n);++ reserve_temp(bytes);++ cub::DeviceRadixSort::SortPairs((void*)m_temp.data(), bytes, m_keys.data(), m_keys_sorted.data(), m_pos.data(),++ m_pos_sorted.data(), n);++++ bytes = 0;++ cub::DeviceRunLengthEncode::Encode(nullptr, bytes, m_keys_sorted.data(), m_unique.data(), m_counts.data(),++ m_num_runs.data(), n);++ reserve_temp(bytes);++ cub::DeviceRunLengthEncode::Encode((void*)m_temp.data(), bytes, m_keys_sorted.data(), m_unique.data(),++ m_counts.data(), m_num_runs.data(), n);++ int runs = 0;++ cudaMemcpy(&runs, m_num_runs.data(), sizeof(int), cudaMemcpyDeviceToHost);++++ bytes = 0;++ cub::DeviceScan::ExclusiveSum(nullptr, bytes, m_counts.data(), m_offsets.data(), runs);++ reserve_temp(bytes);++ cub::DeviceScan::ExclusiveSum((void*)m_temp.data(), bytes, m_counts.data(), m_offsets.data(), runs);++++ int threads = runs * dim;++ if(threads > 0)++ sum_runs<<<(threads + bd - 1) / bd, bd>>>(runs, dim, m_unique.data(), m_offsets.data(), m_counts.data(),++ m_pos_sorted.data(), values, dst, skip);++ }++++ private:++ void reserve_temp(size_t bytes)++ {++ if(m_temp.size() < bytes)++ m_temp.resize(bytes);++ }++++ muda::DeviceBuffer<int> m_keys, m_keys_sorted, m_pos, m_pos_sorted, m_unique, m_counts, m_offsets, m_num_runs;++ muda::DeviceBuffer<std::byte> m_temp;++};++} // namespace uipc::backend::cuda::det+--+2.34.1+diff --git a/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0003-det-segmental-reduce.patch b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0003-det-segmental-reduce.patchnew file mode 100644index 0000000000..bb15fe5aa9--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/uipc-patches/0003-det-segmental-reduce.patch@@ -0,0 +1,176 @@+From 55de83ee0982f2786c2fcbd4824b06fd6fa29335 Mon Sep 17 00:00:00 2001+From: qineng-det <[email protected]>+Date: Mon, 5 Oct 2026 14:00:38 -0500+Subject: [PATCH 3/4] cuda: reproducible FastSegmentalReduce (TopoGym+ determinism series 3/4)++FastSegmentalReduce (matrix converter: duplicate triplet blocks and doublet+segments; external articulation constraint: G^theta) reduces every warp's+piece of a segment with cub's warp-segmented reduce, then atomically added+the pieces of a segment that crosses a warp boundary into out(key): with+three or more pieces the order followed the scheduler.++Atomics replaced:+- fast_segmental_reduce.inl (scalar and matrix variants): pass 1 takes+ the head flags straight from the keys, reduces every piece in the warp's+ fixed shuffle order and lets the piece's head assign out(key); pass 2+ (one thread per segment start) overwrites every segment that crosses a+ warp boundary with the in-order reduction of all its elements.++Pass 1 no longer reads cub's reduced flags word: the invalid lanes of+the last, partly filled warp (key -1, neighbour keys not read, also -1)+join the input's last segment, and lane 31 among them flags it as+cross-warp. Upstream tolerated that (an atomic add into the zero-filled+output); a write rule keyed on the flag drops the segment (the first+version of this patch did: preconditioner NaN at rope_threading medium+frame 121).+---+ .../details/fast_segmental_reduce.inl | 112 +++++++++++++-----+ 1 file changed, 81 insertions(+), 31 deletions(-)++diff --git a/src/backends/cuda/algorithm/details/fast_segmental_reduce.inl b/src/backends/cuda/algorithm/details/fast_segmental_reduce.inl+index 8c6eca7..dfcb2f0 100644+--- a/src/backends/cuda/algorithm/details/fast_segmental_reduce.inl++++ b/src/backends/cuda/algorithm/details/fast_segmental_reduce.inl+@@ -99,25 +99,48 @@ FastSegmentalReduce<BlockSize, WarpSize>& FastSegmentalReduce<BlockSize, WarpSiz+ }+ }++- flags.flags = WarpReduceInt(index_storage[warp_id])+- .HeadSegmentedReduce(flags.flags, flags.is_head, op);+-+- value = WarpReduceT(t_storage[warp_id])+- .HeadSegmentedReduce(value, flags.is_head, op);+-++ // TopoGym determinism series (patch 0003): head flags straight from the keys; the warp reduces each++ // segment piece in its fixed shuffle order and the piece's head assigns it. The second pass below then++ // overwrites every segment that crosses a warp boundary with the in-order reduction of all its++ // elements (was: the pieces of such segments were atomically added, in scheduler order; and the write++ // rule read the reduced flags word, whose fourth byte is never initialised).++ const int head = flags.is_head;++ value = WarpReduceT(t_storage[warp_id]).HeadSegmentedReduce(value, head, op);++++ if(head && flags.is_valid)++ {++ out(i) = value;++ }++ });++- if(flags.is_head && flags.is_valid)++ if(block_count > 0) // TopoGym determinism series (patch 0003): second pass++ Launch(block_count, block_dim, 0, this->stream())++ .file_line(__FILE__, __LINE__)++ .apply(++ [out = out.viewer().name("out"),++ in_size = size,++ get_key_op = get_key_op,++ get_value_op = get_value_op,++ op = op] __device__() mutable++ {++ // TopoGym determinism series (patch 0003): segments that cross a warp boundary, reduced in index order++ int e = blockDim.x * blockIdx.x + threadIdx.x;++ if(e >= static_cast<int>(in_size))++ return;++ int key = get_key_op(e);++ if(e > 0 && get_key_op(e - 1) == key)++ return; // not a segment start++ int last = e;++ while(last + 1 < static_cast<int>(in_size) && get_key_op(last + 1) == key)++ ++last;++ if(e / warp_size == last / warp_size)++ return; // inside one warp: pass 1 wrote it++ ValueT acc = get_value_op(e);++ for(int k = e + 1; k <= last; ++k)+ {+- if(flags.is_cross_warp)+- {+- auto& out_value = out(i);+- atomic_add(&out_value, value);+- }+- else+- {+- out(i) = value;+- }++ acc = op(acc, get_value_op(k));+ }++ out(key) = acc;+ });++ return *this;+@@ -228,31 +251,58 @@ FastSegmentalReduce<BlockSize, WarpSize>& FastSegmentalReduce<BlockSize, WarpSiz+ }+ }++- flags.flags = WarpReduceInt(index_storage[warp_id])+- .HeadSegmentedReduce(flags.flags, flags.is_head, op);+-++ // TopoGym determinism series (patch 0003): head flags straight from the keys; the warp reduces each++ // segment piece in its fixed shuffle order and the piece's head assigns it. The second pass below then++ // overwrites every segment that crosses a warp boundary with the in-order reduction of all its++ // elements (was: the pieces of such segments were atomically added, in scheduler order; and the write++ // rule read the reduced flags word, whose fourth byte is never initialised).++ const int head = flags.is_head;+ for(int j = 0; j < M; j++)+ {+ for(int k = 0; k < N; k++)+ {+ value(j, k) =+- WarpReduceT(t_storage[warp_id])+- .HeadSegmentedReduce(value(j, k), flags.is_head, op);++ WarpReduceT(t_storage[warp_id]).HeadSegmentedReduce(value(j, k), head, op);+ }+ }++- if(flags.is_head && flags.is_valid)++ if(head && flags.is_valid)+ {+- if(flags.is_cross_warp)+- {+- auto& out_value = out(i);+- eigen::atomic_add(out_value, value);+- }+- else+- {+- out(i) = value;+- }++ out(i) = value;++ }++ });++++ if(block_count > 0) // TopoGym determinism series (patch 0003): second pass++ Launch(block_count, block_dim, 0, this->stream())++ .kernel_name("segmental_reduce_cross_warp")++ .apply(++ [out = out.viewer().name("out"),++ in_size = size,++ get_key_op = get_key_op,++ get_value_op = get_value_op,++ op = op] __device__() mutable++ {++ // TopoGym determinism series (patch 0003): segments that cross a warp boundary, reduced in index order++ int e = blockDim.x * blockIdx.x + threadIdx.x;++ if(e >= static_cast<int>(in_size))++ return;++ int key = get_key_op(e);++ if(e > 0 && get_key_op(e - 1) == key)++ return; // not a segment start++ int last = e;++ while(last + 1 < static_cast<int>(in_size) && get_key_op(last + 1) == key)++ ++last;++ if(e / warp_size == last / warp_size)++ return; // inside one warp: pass 1 wrote it++ Matrix acc = get_value_op(e);++ for(int k = e + 1; k <= last; ++k)++ {++ Matrix v = get_value_op(k);++ for(int r = 0; r < M; r++)++ for(int c = 0; c < N; c++)++ acc(r, c) = op(acc(r, c), v(r, c));+ }++ out(key) = acc;+ });++ return *this;+--+2.34.1+diff --git a/images/robotangle/uipc-sm86-build/images/topogym/verify_uipc_wheel.py b/images/robotangle/uipc-sm86-build/images/topogym/verify_uipc_wheel.pynew file mode 100644index 0000000000..f8519de24c--- /dev/null+++ b/images/robotangle/uipc-sm86-build/images/topogym/verify_uipc_wheel.py@@ -0,0 +1,160 @@+#!/usr/bin/env python3+"""Build-only CMake fix, the hash-checked determinism source patches, CUDA wheel audit and hash-checked runtime install."""+import argparse+import email+import hashlib+import json+import os+from pathlib import Path+import re+import subprocess+import tempfile+import zipfile+++def sha(path):+ with Path(path).open('rb') as stream:+ return hashlib.file_digest(stream, 'sha256').hexdigest()+++def materials(source, config):+ for name, expected in config['material_sha256'].items():+ if sha(source / name) != expected:+ raise ValueError(f'original material implementation changed: {name}')+++def patched(source, config):+ for name, expected in config.get('patched_sha256', {}).items():+ if not (source / name).is_file() or sha(source / name) != expected:+ raise ValueError(f'patched IPC source differs: {name}')+++def apply_patches(source, config):+ # TopoGym determinism series (uipc-build.json source_patches): fixed-order sums instead of float atomics in the+ # linear solve, assembly, candidate lists and segmented reductions; physics and materials unchanged.+ for item in config.get('source_patches', []):+ patch = Path('/recipe') / item['path']+ if sha(patch) != item['sha256']:+ raise ValueError(f'IPC source patch hash mismatch: {item["path"]}')+ subprocess.run(['git', '-C', str(source), 'apply', '--whitespace=nowarn', str(patch)], check=True)+ patched(source, config)+++def prepare(source, config):+ materials(source, config)+ path = source / 'src/backends/cuda/CMakeLists.txt'+ if sha(path) != config['cmake_before_sha256']:+ raise ValueError('unexpected original CUDA CMake file')+ old = ' CUDA_ARCHITECTURES ${UIPC_CUDA_ARCHITECTURES}\n'+ text = path.read_text()+ if text.count(old) != 1:+ raise ValueError('expected exactly one CUDA target property')+ # A list must remain one property value. Materials stay original; the only solver source changes are the hash-checked+ # determinism patches (summation order).+ path.write_text(text.replace(old, ' CUDA_ARCHITECTURES "${UIPC_CUDA_ARCHITECTURES}"\n'))+ apply_patches(source, config)+++def audit(folder, config, source):+ materials(source, config)+ head = subprocess.check_output(['git', '-C', str(source), 'rev-parse', 'HEAD'], text=True).strip()+ if head != config['source_commit']:+ raise ValueError('IPC source commit changed')+ changed = subprocess.check_output(['git', '-C', str(source), 'diff', '--name-only'], text=True).splitlines()+ tracked = set(subprocess.check_output(['git', '-C', str(source), 'ls-files'], text=True).splitlines())+ patched_files = config.get('patched_sha256', {})+ expected = sorted(['src/backends/cuda/CMakeLists.txt', *(f for f in patched_files if f in tracked)])+ if sorted(changed) != expected:+ raise ValueError(f'unexpected upstream source changes: {changed}')+ patched(source, config)+ wheels = list(folder.glob('*.whl'))+ if len(wheels) != 1:+ raise ValueError('expected one repaired CPython 3.11 wheel')+ wheel = wheels[0]+ with zipfile.ZipFile(wheel) as archive, tempfile.TemporaryDirectory() as tmp:+ metadata = [p for p in archive.namelist() if p.endswith('.dist-info/METADATA')]+ package = email.message_from_bytes(archive.read(metadata[0]))+ if package['Version'] != config['version']:+ raise ValueError('unexpected wheel version')+ libraries = [p for p in archive.namelist() if p.endswith('/libuipc_backend_cuda.so')]+ if len(libraries) != 1:+ raise ValueError('missing/ambiguous IPC CUDA backend')+ library = Path(tmp) / 'libuipc_backend_cuda.so'+ library.write_bytes(archive.read(libraries[0]))+ elf = subprocess.check_output(['cuobjdump', '--list-elf', str(library)], text=True)+ # RDC builds retain PTX in relocatable fatbins, beside linked SASS.+ ptx = subprocess.check_output(['cuobjdump', '--all-fatbin', '--list-ptx', str(library)], text=True)+ sass = sorted(set(re.findall(r'\bsm_\d+\b', elf)))+ if not set(config['required_sass']) <= set(sass):+ raise ValueError(f'wheel lacks required native CUDA kernels: {sass}')+ if not re.search(r'(?:sm|compute)_120\b', ptx):+ raise ValueError('wheel lacks compute-120 PTX')+ record = dict(config, wheel=wheel.name, wheel_sha256=sha(wheel), backend_sha256=sha(library),+ backend_path=libraries[0], sass=sass, ptx_listing=ptx.splitlines(),+ ptx_scope='all_fatbins_including_relocatable',+ cuda_compiler=subprocess.check_output(['nvcc', '--version'], text=True),+ submodules=subprocess.check_output(['git', '-C', str(source), 'submodule', 'status', '--recursive'], text=True),+ cmake_after_sha256=sha(source/'src/backends/cuda/CMakeLists.txt'),+ source_changes=changed, source_added=sorted(f for f in patched_files if f not in tracked),+ materials_unchanged=True)+ (folder / 'uipc-build.json').write_text(json.dumps(record, indent=2) + '\n')+++def without_pyuipc(text):+ lines = text.splitlines(keepends=True)+ out, found, i = [], 0, 0+ while i < len(lines):+ if lines[i].startswith('pyuipc=='):+ if not lines[i].startswith('pyuipc==0.0.25 '):+ raise ValueError('unexpected baseline IPC requirement')+ found += 1+ while lines[i].rstrip().endswith('\\'):+ i += 1+ i += 1+ else:+ out.append(lines[i]); i += 1+ if found != 1:+ raise ValueError('expected exactly one original IPC requirement')+ return ''.join(out)+++def dependencies(lock):+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'runtime.lock'+ requirements.write_text(without_pyuipc(lock.read_text()))+ subprocess.run(['uv', 'pip', 'install', '--system', '--require-hashes', '--torch-backend',+ os.environ.get('TOPOGYM_CUDA_FLAVOR', 'cu128'),+ '-r', str(requirements)], check=True)+++def install(folder, lock=None):+ record = json.loads((folder / 'uipc-build.json').read_text())+ wheel = folder / record['wheel']+ if wheel.parent != folder or sha(wheel) != record['wheel_sha256']:+ raise ValueError('IPC wheel hash mismatch')+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'wheel.lock'+ requirements.write_text(f'pyuipc @ {wheel.resolve().as_uri()} --hash=sha256:{record["wheel_sha256"]}\n')+ subprocess.run(['uv', 'pip', 'install', '--system', '--no-deps', '--require-hashes',+ '-r', str(requirements)], check=True)+ import importlib.metadata as metadata+ package = metadata.distribution('pyuipc')+ if package.version != record['version'] or sha(package.locate_file(record['backend_path'])) != record['backend_sha256']:+ raise ValueError('installed IPC differs from audited build')+++if __name__ == '__main__':+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('operation', choices=('prepare', 'audit', 'install', 'dependencies'))+ parser.add_argument('path', type=Path)+ parser.add_argument('config_or_lock', type=Path, nargs='?')+ parser.add_argument('source', type=Path, nargs='?')+ args = parser.parse_args()+ if args.operation == 'dependencies':+ dependencies(args.path)+ elif args.operation == 'install':+ install(args.path, args.config_or_lock)+ else:+ config = json.loads(args.config_or_lock.read_text())+ if args.operation == 'prepare': prepare(args.path, config)+ else: audit(args.path, config, args.source)diff --git a/images/robotangle/uipc-sm86-build/requirements/uipc-build.lock b/images/robotangle/uipc-sm86-build/requirements/uipc-build.locknew file mode 100644index 0000000000..1800563b50--- /dev/null+++ b/images/robotangle/uipc-sm86-build/requirements/uipc-build.lock@@ -0,0 +1,179 @@+# This file was autogenerated by uv via the following command:+# uv pip compile requirements/uipc-build.in --python-version 3.11 --generate-hashes --output-file requirements/uipc-build.lock+auditwheel==6.5.0 \+ --hash=sha256:4fbcbd5854054bb1dd7870db03727b871b96b18147db57259561c058603987d7 \+ --hash=sha256:e08d2eede0259be6feff597d041c06175026e93248a1a97143acc52c57714d80+ # via -r requirements/uipc-build.in+build==1.3.0 \+ --hash=sha256:698edd0ea270bde950f53aed21f3a0135672206f3911e0176261a31e0e07b397 \+ --hash=sha256:7145f0b5061ba90a1500d60bd1b13ca0a8a4cebdd0cc16ed8adf1c0e739f43b4+ # via -r requirements/uipc-build.in+cmake==3.31.10 \+ --hash=sha256:1debc3a0823ce5d8d1bc17154599bbbb337c2681f93622b618bc78f46576e42a \+ --hash=sha256:2f766bb46367e5e0559fa33184653754bce044583a06014dcaebf8e6dff8a1f1 \+ --hash=sha256:3c17bb24dba15f8ecc3fd706afe04264410ef88796f4115c119327c961d5dc57 \+ --hash=sha256:422a54711aa977af19d59b8f6010354cdda0b72a2e6d702b6d892e3e2cdf98a2 \+ --hash=sha256:4cefb0a28ac1268b4eed4b595bf3aaff8de9704089066027700ec36584eccab8 \+ --hash=sha256:678fc23db37cc69f01e18eb28790450ecc9401fd2fcd43364cc18f92330c12c2 \+ --hash=sha256:6970bb75c4dfc28cc31ff0cd848194d09094ae00d605181e1345b2ff70b61050 \+ --hash=sha256:7c300e4ae68fbc1414a85505f7feb262cee82ff3304a286885ebf803b11a997c \+ --hash=sha256:8d2ec5fc45d305227020c82213140a51a0cebe3c84f0299036f05716b3a52f60 \+ --hash=sha256:91410816db3beefe2f6032d721f9978c98dc7646e9992c0325486597164fab81 \+ --hash=sha256:a4a5615f31f692c9b9aa8b365704e4b76172348af6fa40e16fea3f118bb01194 \+ --hash=sha256:a7864605238759a4ae8e3bd1fda2bb03978e3e37df310852662dcf53866413c8 \+ --hash=sha256:ad697643a00d9ba85179590a383c4f7401169b55ebf4b8b2938daf28c6bdeb6d \+ --hash=sha256:b059a1810a2ce766b3e531bdc8d730bc192e260a9fa7dec7a0eb7a053d6063c7 \+ --hash=sha256:b331984de38dbda22d676f8812c8905526341ba7b397fe8c359255ff4d051193 \+ --hash=sha256:c2e5361dea9754ed3b06cf834894fb47dcbe7036d5e5d87acaeb10ff3dd5fd10 \+ --hash=sha256:e135d5f1e59f1dc1c80eea87321977d6c0eff86cb601c28e0965a1dd457ea587 \+ --hash=sha256:ec3d14a0e72e401b3665034dc37901df17f0b4e9c5b163be6cfedfb93470ac0f \+ --hash=sha256:f1ea1fe826355560e8976c3d5794d9357444209bc0e0d56676c71e6a571fd474+ # via -r requirements/uipc-build.in+ninja==1.13.0 \+ --hash=sha256:11be2d22027bde06f14c343f01d31446747dbb51e72d00decca2eb99be911e2f \+ --hash=sha256:1c97223cdda0417f414bf864cfb73b72d8777e57ebb279c5f6de368de0062988 \+ --hash=sha256:3c0b40b1f0bba764644385319028650087b4c1b18cdfa6f45cb39a3669b81aa9 \+ --hash=sha256:3d00c692fb717fd511abeb44b8c5d00340c36938c12d6538ba989fe764e79630 \+ --hash=sha256:3d7d7779d12cb20c6d054c61b702139fd23a7a964ec8f2c823f1ab1b084150db \+ --hash=sha256:4a40ce995ded54d9dc24f8ea37ff3bf62ad192b547f6c7126e7e25045e76f978 \+ --hash=sha256:4be9c1b082d244b1ad7ef41eb8ab088aae8c109a9f3f0b3e56a252d3e00f42c1 \+ --hash=sha256:5f8e1e8a1a30835eeb51db05cf5a67151ad37542f5a4af2a438e9490915e5b72 \+ --hash=sha256:60056592cf495e9a6a4bea3cd178903056ecb0943e4de45a2ea825edb6dc8d3e \+ --hash=sha256:6739d3352073341ad284246f81339a384eec091d9851a886dfa5b00a6d48b3e2 \+ --hash=sha256:8cfbb80b4a53456ae8a39f90ae3d7a2129f45ea164f43fadfa15dc38c4aef1c9 \+ --hash=sha256:aa45b4037b313c2f698bc13306239b8b93b4680eb47e287773156ac9e9304714 \+ --hash=sha256:b4f2a072db3c0f944c32793e91532d8948d20d9ab83da9c0c7c15b5768072200 \+ --hash=sha256:be7f478ff9f96a128b599a964fc60a6a87b9fa332ee1bd44fa243ac88d50291c \+ --hash=sha256:d741a5e6754e0bda767e3274a0f0deeef4807f1fec6c0d7921a0244018926ae5 \+ --hash=sha256:e8bad11f8a00b64137e9b315b137d8bb6cbf3086fbdc43bf1f90fd33324d2e96 \+ --hash=sha256:fa2a8bfc62e31b08f83127d1613d10821775a0eb334197154c4d6067b7068ff1 \+ --hash=sha256:fb46acf6b93b8dd0322adc3a4945452a4e774b75b91293bafcc7b7f8e6517dfa \+ --hash=sha256:fb8ee8719f8af47fed145cced4a85f0755dd55d45b2bddaf7431fa89803c5f3e+ # via -r requirements/uipc-build.in+numpy==2.3.5 \+ --hash=sha256:00dc4e846108a382c5869e77c6ed514394bdeb3403461d25a829711041217d5b \+ --hash=sha256:0472f11f6ec23a74a906a00b48a4dcf3849209696dff7c189714511268d103ae \+ --hash=sha256:04822c00b5fd0323c8166d66c701dc31b7fbd252c100acd708c48f763968d6a3 \+ --hash=sha256:052e8c42e0c49d2575621c158934920524f6c5da05a1d3b9bab5d8e259e045f0 \+ --hash=sha256:09a1bea522b25109bf8e6f3027bd810f7c1085c64a0c7ce050c1676ad0ba010b \+ --hash=sha256:0cd00b7b36e35398fa2d16af7b907b65304ef8bb4817a550e06e5012929830fa \+ --hash=sha256:0d8163f43acde9a73c2a33605353a4f1bc4798745a8b1d73183b28e5b435ae28 \+ --hash=sha256:1062fde1dcf469571705945b0f221b73928f34a20c904ffb45db101907c3454e \+ --hash=sha256:11e06aa0af8c0f05104d56450d6093ee639e15f24ecf62d417329d06e522e017 \+ --hash=sha256:17531366a2e3a9e30762c000f2c43a9aaa05728712e25c11ce1dbe700c53ad41 \+ --hash=sha256:1978155dd49972084bd6ef388d66ab70f0c323ddee6f693d539376498720fb7e \+ --hash=sha256:1ed1ec893cff7040a02c8aa1c8611b94d395590d553f6b53629a4461dc7f7b63 \+ --hash=sha256:2dcd0808a421a482a080f89859a18beb0b3d1e905b81e617a188bd80422d62e9 \+ --hash=sha256:2e2eb32ddb9ccb817d620ac1d8dae7c3f641c1e5f55f531a33e8ab97960a75b8 \+ --hash=sha256:2feae0d2c91d46e59fcd62784a3a83b3fb677fead592ce51b5a6fbb4f95965ff \+ --hash=sha256:3095bdb8dd297e5920b010e96134ed91d852d81d490e787beca7e35ae1d89cf7 \+ --hash=sha256:30bc11310e8153ca664b14c5f1b73e94bd0503681fcf136a163de856f3a50139 \+ --hash=sha256:3101e5177d114a593d79dd79658650fe28b5a0d8abeb8ce6f437c0e6df5be1a4 \+ --hash=sha256:396084a36abdb603546b119d96528c2f6263921c50df3c8fd7cb28873a237748 \+ --hash=sha256:3997b5b3c9a771e157f9aae01dd579ee35ad7109be18db0e85dbdbe1de06e952 \+ --hash=sha256:414802f3b97f3c1eef41e530aaba3b3c1620649871d8cb38c6eaff034c2e16bd \+ --hash=sha256:51c1e14eb1e154ebd80e860722f9e6ed6ec89714ad2db2d3aa33c31d7c12179b \+ --hash=sha256:51c55fe3451421f3a6ef9a9c1439e82101c57a2c9eab9feb196a62b1a10b58ce \+ --hash=sha256:5ee6609ac3604fa7780e30a03e5e241a7956f8e2fcfe547d51e3afa5247ac47f \+ --hash=sha256:612a95a17655e213502f60cfb9bf9408efdc9eb1d5f50535cc6eb365d11b42b5 \+ --hash=sha256:6203fdf9f3dc5bdaed7319ad8698e685c7a3be10819f41d32a0723e611733b42 \+ --hash=sha256:63c0e9e7eea69588479ebf4a8a270d5ac22763cc5854e9a7eae952a3908103f7 \+ --hash=sha256:66f85ce62c70b843bab1fb14a05d5737741e74e28c7b8b5a064de10142fad248 \+ --hash=sha256:6cf9b429b21df6b99f4dee7a1218b8b7ffbbe7df8764dc0bd60ce8a0708fed1e \+ --hash=sha256:70b37199913c1bd300ff6e2693316c6f869c7ee16378faf10e4f5e3275b299c3 \+ --hash=sha256:727fd05b57df37dc0bcf1a27767a3d9a78cbbc92822445f32cc3436ba797337b \+ --hash=sha256:74ae7b798248fe62021dbf3c914245ad45d1a6b0cb4a29ecb4b31d0bfbc4cc3e \+ --hash=sha256:784db1dcdab56bf0517743e746dfb0f885fc68d948aba86eeec2cba234bdf1c0 \+ --hash=sha256:86945f2ee6d10cdfd67bcb4069c1662dd711f7e2a4343db5cecec06b87cf31aa \+ --hash=sha256:86d835afea1eaa143012a2d7a3f45a3adce2d7adc8b4961f0b362214d800846a \+ --hash=sha256:872a5cf366aec6bb1147336480fef14c9164b154aeb6542327de4970282cd2f5 \+ --hash=sha256:8b973c57ff8e184109db042c842423ff4f60446239bd585a5131cc47f06f789d \+ --hash=sha256:8cba086a43d54ca804ce711b2a940b16e452807acebe7852ff327f1ecd49b0d4 \+ --hash=sha256:8f7f0e05112916223d3f438f293abf0727e1181b5983f413dfa2fefc4098245c \+ --hash=sha256:900218e456384ea676e24ea6a0417f030a3b07306d29d7ad843957b40a9d8d52 \+ --hash=sha256:93eebbcf1aafdf7e2ddd44c2923e2672e1010bddc014138b229e49725b4d6be5 \+ --hash=sha256:9c75442b2209b8470d6d5d8b1c25714270686f14c749028d2199c54e29f20b4d \+ --hash=sha256:9ee2197ef8c4f0dfe405d835f3b6a14f5fee7782b5de51ba06fb65fc9b36e9f1 \+ --hash=sha256:a414504bef8945eae5f2d7cb7be2d4af77c5d1cb5e20b296c2c25b61dff2900c \+ --hash=sha256:a4b9159734b326535f4dd01d947f919c6eefd2d9827466a696c44ced82dfbc18 \+ --hash=sha256:a80afd79f45f3c4a7d341f13acbe058d1ca8ac017c165d3fa0d3de6bc1a079d7 \+ --hash=sha256:aa5bc7c5d59d831d9773d1170acac7893ce3a5e130540605770ade83280e7188 \+ --hash=sha256:acfd89508504a19ed06ef963ad544ec6664518c863436306153e13e94605c218 \+ --hash=sha256:aeffcab3d4b43712bb7a60b65f6044d444e75e563ff6180af8f98dd4b905dfd2 \+ --hash=sha256:afaffc4393205524af9dfa400fa250143a6c3bc646c08c9f5e25a9f4b4d6a903 \+ --hash=sha256:b0c7088a73aef3d687c4deef8452a3ac7c1be4e29ed8bf3b366c8111128ac60c \+ --hash=sha256:b46b4ec24f7293f23adcd2d146960559aaf8020213de8ad1909dba6c013bf89c \+ --hash=sha256:b501b5fa195cc9e24fe102f21ec0a44dffc231d2af79950b451e0d99cea02234 \+ --hash=sha256:bf06bc2af43fa8d32d30fae16ad965663e966b1a3202ed407b84c989c3221e82 \+ --hash=sha256:c804e3a5aba5460c73955c955bdbd5c08c354954e9270a2c1565f62e866bdc39 \+ --hash=sha256:c8a9958e88b65c3b27e22ca2a076311636850b612d6bbfb76e8d156aacde2aaf \+ --hash=sha256:cc0a57f895b96ec78969c34f682c602bf8da1a0270b09bc65673df2e7638ec20 \+ --hash=sha256:cc8920d2ec5fa99875b670bb86ddeb21e295cb07aa331810d9e486e0b969d946 \+ --hash=sha256:ccc933afd4d20aad3c00bcef049cb40049f7f196e0397f1109dba6fed63267b0 \+ --hash=sha256:ce581db493ea1a96c0556360ede6607496e8bf9b3a8efa66e06477267bc831e9 \+ --hash=sha256:d0f23b44f57077c1ede8c5f26b30f706498b4862d3ff0a7298b8411dd2f043ff \+ --hash=sha256:d21644de1b609825ede2f48be98dfde4656aefc713654eeee280e37cadc4e0ad \+ --hash=sha256:d6889ec4ec662a1a37eb4b4fb26b6100841804dac55bd9df579e326cdc146227 \+ --hash=sha256:de5672f4a7b200c15a4127042170a694d4df43c992948f5e1af57f0174beed10 \+ --hash=sha256:e6a0bc88393d65807d751a614207b7129a310ca4fe76a74e5c7da5fa5671417e \+ --hash=sha256:ed89927b86296067b4f81f108a2271d8926467a8868e554eaf370fc27fa3ccaf \+ --hash=sha256:ee3888d9ff7c14604052b2ca5535a30216aa0a58e948cdd3eeb8d3415f638769 \+ --hash=sha256:f0963b55cdd70fad460fa4c1341f12f976bb26cb66021a5580329bd498988310 \+ --hash=sha256:f16417ec91f12f814b10bafe79ef77e70113a2f5f7018640e7425ff979253425 \+ --hash=sha256:f28620fe26bee16243be2b7b874da327312240a7cdc38b769a697578d2100013 \+ --hash=sha256:f4255143f5160d0de972d28c8f9665d882b5f61309d8362fdd3e103cf7bf010c \+ --hash=sha256:ffac52f28a7849ad7576293c0cb7b9f08304e8f7d738a8cb8a90ec4c55a998eb \+ --hash=sha256:ffe22d2b05504f786c867c8395de703937f934272eb67586817b46188b4ded6d \+ --hash=sha256:fffe29a1ef00883599d1dc2c51aa2e5d80afe49523c261a74933df395c15c520+ # via -r requirements/uipc-build.in+packaging==26.3 \+ --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \+ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c+ # via+ # auditwheel+ # build+ # scikit-build-core+ # setuptools-scm+patchelf==0.17.2.4 \+ --hash=sha256:09fd848d625a165fc7b7e07745508c24077129b019c4415a882938781d43adf8 \+ --hash=sha256:2931a1b5b85f3549661898af7bf746afbda7903c7c9a967cfc998a3563f84fad \+ --hash=sha256:343bb1b94e959f9070ca9607453b04390e36bbaa33c88640b989cefad0aa049e \+ --hash=sha256:680a266a70f60a7a4f4c448482c5bdba80cc8e6bb155a49dcc24238ba49927b0 \+ --hash=sha256:7076d9e127230982e20a81a6e2358d3343004667ba510d9f822d4fdee29b0d71 \+ --hash=sha256:970ee5cd8af33e5ea2099510b2f9013fa1b8d5cd763bf3fd3961281c18101a09 \+ --hash=sha256:ae44cb3c857d50f54b99e5697aa978726ada33a8a6129d4b8b7ffd28b996652d \+ --hash=sha256:d842b51f0401460f3b1f3a3a67d2c266a8f515a5adfbfa6e7b656cb3ac2ed8bc \+ --hash=sha256:d9b35ebfada70c02679ad036407d9724ffe1255122ba4ac5e4be5868618a5689+ # via -r requirements/uipc-build.in+pathspec==1.1.1 \+ --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \+ --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189+ # via scikit-build-core+pybind11==3.1.0 \+ --hash=sha256:a1cc06b524ab3edca51f8ad3895f9c4fa20b8b19283173dff4ae781449dc9639 \+ --hash=sha256:b8488090f8acffbcb6b5d6a85571a6827a0a2981ffb75e5a0b27b87c4a6b7dd0+ # via -r requirements/uipc-build.in+pybind11-stubgen==3.0.0 \+ --hash=sha256:859b7b7dbd31d00f722f19152216b5506e8a5d3fdf586944de0cade80f972298 \+ --hash=sha256:b0a908ae99204e201a5148c17dc3cb789021a339ab9dc1d0517a23a87490204c+ # via -r requirements/uipc-build.in+pyelftools==0.33 \+ --hash=sha256:660d82dcbeb8e83d1702bd97f223f761625da06111c0cc988eac6b8ab0c1b61f \+ --hash=sha256:f215ad5f47d3f1373a21496a6c9e0707c622840d0622f23ff7ce08678b020036+ # via auditwheel+pyproject-hooks==1.3.3 \+ --hash=sha256:5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b \+ --hash=sha256:defda19b854fa0d3bd4f76ea4ddcba8abd7dcfcdd585a6690ade050744fc5f43+ # via build+scikit-build-core==0.11.6 \+ --hash=sha256:5982ccd839735be99cfd3b92a8847c6c196692f476c215da84b79d2ad12f9f1b \+ --hash=sha256:ce6d8fe64e6b4c759ea0fb95d2f8a68f60d2df31c2989838633b8ec930736360+ # via -r requirements/uipc-build.in+setuptools==84.0.0 \+ --hash=sha256:51a52592b3b99e102b609654876bd65f19f999935166d1352678931132b0c670 \+ --hash=sha256:f4695c21257f0d9b537ec2692c941d02ee143b7cc1276941349a546573b2ef73+ # via setuptools-scm+setuptools-scm==9.2.2 \+ --hash=sha256:1c674ab4665686a0887d7e24c03ab25f24201c213e82ea689d2f3e169ef7ef57 \+ --hash=sha256:30e8f84d2ab1ba7cb0e653429b179395d0c33775d54807fc5f1dd6671801aef7+ # via -r requirements/uipc-build.indiff --git a/images/robotangle/verify_uipc_wheel.py b/images/robotangle/verify_uipc_wheel.pynew file mode 100644index 0000000000..a9bfe6f752--- /dev/null+++ b/images/robotangle/verify_uipc_wheel.py@@ -0,0 +1,204 @@+#!/usr/bin/env python3+"""Build-only CMake fix, the hash-checked determinism source patches, CUDA wheel audit and hash-checked runtime install.++robot_coding_bench copy (images/robotangle/): images/topogym/verify_uipc_wheel.py of release 2dafa5f2b with two changes.+- audit requires the PTX of every `<N>-virtual` architecture of the config (the release script: compute_120 only).+ images/robotangle/uipc-sm86-build/audit/verify_uipc_wheel.py is this script without `check`; the sm_86 wheel was built with it.+- check (new): a prebuilt wheel against its uipc-build.json in the recipe's builder image, without the source tree. The+ RoboTangle image build runs it on both libuipc builds (images/robotangle/Dockerfile, stage uipc-check)."""+import argparse+import email+import hashlib+import json+import os+from pathlib import Path+import re+import subprocess+import tempfile+import zipfile+++def sha(path):+ with Path(path).open('rb') as stream:+ return hashlib.file_digest(stream, 'sha256').hexdigest()+++def materials(source, config):+ for name, expected in config['material_sha256'].items():+ if sha(source / name) != expected:+ raise ValueError(f'original material implementation changed: {name}')+++def patched(source, config):+ for name, expected in config.get('patched_sha256', {}).items():+ if not (source / name).is_file() or sha(source / name) != expected:+ raise ValueError(f'patched IPC source differs: {name}')+++def apply_patches(source, config):+ # TopoGym determinism series (uipc-build.json source_patches): fixed-order sums instead of float atomics in the+ # linear solve, assembly, candidate lists and segmented reductions; physics and materials unchanged.+ for item in config.get('source_patches', []):+ patch = Path('/recipe') / item['path']+ if sha(patch) != item['sha256']:+ raise ValueError(f'IPC source patch hash mismatch: {item["path"]}')+ subprocess.run(['git', '-C', str(source), 'apply', '--whitespace=nowarn', str(patch)], check=True)+ patched(source, config)+++def prepare(source, config):+ materials(source, config)+ path = source / 'src/backends/cuda/CMakeLists.txt'+ if sha(path) != config['cmake_before_sha256']:+ raise ValueError('unexpected original CUDA CMake file')+ old = ' CUDA_ARCHITECTURES ${UIPC_CUDA_ARCHITECTURES}\n'+ text = path.read_text()+ if text.count(old) != 1:+ raise ValueError('expected exactly one CUDA target property')+ # A list must remain one property value. Materials stay original; the only solver source changes are the hash-checked+ # determinism patches (summation order).+ path.write_text(text.replace(old, ' CUDA_ARCHITECTURES "${UIPC_CUDA_ARCHITECTURES}"\n'))+ apply_patches(source, config)+++def audit(folder, config, source):+ materials(source, config)+ head = subprocess.check_output(['git', '-C', str(source), 'rev-parse', 'HEAD'], text=True).strip()+ if head != config['source_commit']:+ raise ValueError('IPC source commit changed')+ changed = subprocess.check_output(['git', '-C', str(source), 'diff', '--name-only'], text=True).splitlines()+ tracked = set(subprocess.check_output(['git', '-C', str(source), 'ls-files'], text=True).splitlines())+ patched_files = config.get('patched_sha256', {})+ expected = sorted(['src/backends/cuda/CMakeLists.txt', *(f for f in patched_files if f in tracked)])+ if sorted(changed) != expected:+ raise ValueError(f'unexpected upstream source changes: {changed}')+ patched(source, config)+ wheels = list(folder.glob('*.whl'))+ if len(wheels) != 1:+ raise ValueError('expected one repaired CPython 3.11 wheel')+ wheel = wheels[0]+ with zipfile.ZipFile(wheel) as archive, tempfile.TemporaryDirectory() as tmp:+ metadata = [p for p in archive.namelist() if p.endswith('.dist-info/METADATA')]+ package = email.message_from_bytes(archive.read(metadata[0]))+ if package['Version'] != config['version']:+ raise ValueError('unexpected wheel version')+ libraries = [p for p in archive.namelist() if p.endswith('/libuipc_backend_cuda.so')]+ if len(libraries) != 1:+ raise ValueError('missing/ambiguous IPC CUDA backend')+ library = Path(tmp) / 'libuipc_backend_cuda.so'+ library.write_bytes(archive.read(libraries[0]))+ elf = subprocess.check_output(['cuobjdump', '--list-elf', str(library)], text=True)+ # RDC builds retain PTX in relocatable fatbins, beside linked SASS.+ ptx = subprocess.check_output(['cuobjdump', '--all-fatbin', '--list-ptx', str(library)], text=True)+ sass = sorted(set(re.findall(r'\bsm_\d+\b', elf)))+ if not set(config['required_sass']) <= set(sass):+ raise ValueError(f'wheel lacks required native CUDA kernels: {sass}')+ # The PTX each `<N>-virtual` architecture of the config embeds (the release config's 120-virtual: compute_120).+ for arch in re.findall(r'(\d+)-virtual', config['architectures']) or ['120']:+ if not re.search(rf'(?:sm|compute)_{arch}\b', ptx):+ raise ValueError(f'wheel lacks compute-{arch} PTX')+ record = dict(config, wheel=wheel.name, wheel_sha256=sha(wheel), backend_sha256=sha(library),+ backend_path=libraries[0], sass=sass, ptx_listing=ptx.splitlines(),+ ptx_scope='all_fatbins_including_relocatable',+ cuda_compiler=subprocess.check_output(['nvcc', '--version'], text=True),+ submodules=subprocess.check_output(['git', '-C', str(source), 'submodule', 'status', '--recursive'], text=True),+ cmake_after_sha256=sha(source/'src/backends/cuda/CMakeLists.txt'),+ source_changes=changed, source_added=sorted(f for f in patched_files if f not in tracked),+ materials_unchanged=True)+ (folder / 'uipc-build.json').write_text(json.dumps(record, indent=2) + '\n')+++def check(folder):+ """A prebuilt wheel (<folder>: the wheel and its uipc-build.json) is the one its record names: the wheel, version and+ CUDA backend hashes; the backend's native kernels (SASS) and PTX listing equal the record's (cuobjdump of this builder),+ cover required_sass and hold the PTX of every `-virtual` architecture. Returns a summary."""+ record = json.loads((folder / 'uipc-build.json').read_text())+ wheel = folder / record['wheel']+ if wheel.parent != folder or sha(wheel) != record['wheel_sha256']:+ raise ValueError(f'{folder}: wheel hash differs from its uipc-build.json')+ with zipfile.ZipFile(wheel) as archive, tempfile.TemporaryDirectory() as tmp:+ metadata = [p for p in archive.namelist() if p.endswith('.dist-info/METADATA')]+ if email.message_from_bytes(archive.read(metadata[0]))['Version'] != record['version']:+ raise ValueError(f'{folder}: wheel version differs from its uipc-build.json')+ library = Path(tmp) / 'libuipc_backend_cuda.so'+ library.write_bytes(archive.read(record['backend_path']))+ if sha(library) != record['backend_sha256']:+ raise ValueError(f'{folder}: CUDA backend hash differs from its uipc-build.json')+ elf = subprocess.check_output(['cuobjdump', '--list-elf', str(library)], text=True)+ ptx = subprocess.check_output(['cuobjdump', '--all-fatbin', '--list-ptx', str(library)], text=True)+ sass = sorted(set(re.findall(r'\bsm_\d+\b', elf)))+ if sass != record['sass'] or ptx.splitlines() != record['ptx_listing']:+ raise ValueError(f'{folder}: native kernels or PTX differ from its uipc-build.json')+ if not set(record['required_sass']) <= set(sass):+ raise ValueError(f'{folder}: wheel lacks required native CUDA kernels: {sass}')+ for arch in re.findall(r'(\d+)-virtual', record['architectures']) or ['120']:+ if not re.search(rf'(?:sm|compute)_{arch}\b', ptx):+ raise ValueError(f'{folder}: wheel lacks compute-{arch} PTX')+ return dict(folder=str(folder), wheel_sha256=record['wheel_sha256'], uipc_build_sha256=sha(folder / 'uipc-build.json'),+ version=record['version'], source_commit=record['source_commit'], architectures=record['architectures'],+ sass=sass, ptx=sorted(set(re.findall(r'sm_\d+', ' '.join(ptx.splitlines())))))+++def without_pyuipc(text):+ lines = text.splitlines(keepends=True)+ out, found, i = [], 0, 0+ while i < len(lines):+ if lines[i].startswith('pyuipc=='):+ if not lines[i].startswith('pyuipc==0.0.25 '):+ raise ValueError('unexpected baseline IPC requirement')+ found += 1+ while lines[i].rstrip().endswith('\\'):+ i += 1+ i += 1+ else:+ out.append(lines[i]); i += 1+ if found != 1:+ raise ValueError('expected exactly one original IPC requirement')+ return ''.join(out)+++def dependencies(lock):+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'runtime.lock'+ requirements.write_text(without_pyuipc(lock.read_text()))+ subprocess.run(['uv', 'pip', 'install', '--system', '--require-hashes', '--torch-backend',+ os.environ.get('TOPOGYM_CUDA_FLAVOR', 'cu128'),+ '-r', str(requirements)], check=True)+++def install(folder, lock=None):+ record = json.loads((folder / 'uipc-build.json').read_text())+ wheel = folder / record['wheel']+ if wheel.parent != folder or sha(wheel) != record['wheel_sha256']:+ raise ValueError('IPC wheel hash mismatch')+ with tempfile.TemporaryDirectory() as tmp:+ requirements = Path(tmp) / 'wheel.lock'+ requirements.write_text(f'pyuipc @ {wheel.resolve().as_uri()} --hash=sha256:{record["wheel_sha256"]}\n')+ subprocess.run(['uv', 'pip', 'install', '--system', '--no-deps', '--require-hashes',+ '-r', str(requirements)], check=True)+ import importlib.metadata as metadata+ package = metadata.distribution('pyuipc')+ if package.version != record['version'] or sha(package.locate_file(record['backend_path'])) != record['backend_sha256']:+ raise ValueError('installed IPC differs from audited build')+++if __name__ == '__main__':+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('operation', choices=('prepare', 'audit', 'install', 'dependencies', 'check'))+ parser.add_argument('path', type=Path)+ parser.add_argument('config_or_lock', type=Path, nargs='?')+ parser.add_argument('source', type=Path, nargs='?')+ args, more = parser.parse_known_args()+ if more and args.operation != 'check':+ parser.error(f'unrecognized arguments: {" ".join(more)}')+ if args.operation == 'check': # check <folder> [<folder> ...]: one JSON summary per wheel+ folders = [args.path] + [p for p in (args.config_or_lock, args.source) if p] + [Path(p) for p in more]+ print(json.dumps([check(f.resolve()) for f in folders], indent=1))+ elif args.operation == 'dependencies':+ dependencies(args.path)+ elif args.operation == 'install':+ install(args.path, args.config_or_lock)+ else:+ config = json.loads(args.config_or_lock.read_text())+ if args.operation == 'prepare': prepare(args.path, config)+ else: audit(args.path, config, args.source)diff --git a/scripts/robotangle/assets.json b/scripts/robotangle/assets.jsonindex 3e2340664f..6cc9355243 100644--- a/scripts/robotangle/assets.json+++ b/scripts/robotangle/assets.json@@ -3,6 +3,8 @@"image/release-2dafa5f2b.tar.gz": "d7b6fa7a514592a0677d587374630bb1c3c95ef30d3c6db104ce3aff33ba237d","image/uipc-prebuilt/pyuipc-0.0.25+topogym.det1.cuda128-cp311-cp311-manylinux_2_34_x86_64.whl": "a50f5fdda86289aa08cbcfcbce0bb81fe983e6c829372fa316f9936f662d02e9","image/uipc-prebuilt/uipc-build.json": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "image/uipc-sm86/pyuipc-0.0.25+topogym.det1.cuda128-cp311-cp311-manylinux_2_34_x86_64.whl": "d7f2fd659e1db6ffe1e0ed32b1aefc3b60945204e6371efadfdd2ac674b8ea1c",+ "image/uipc-sm86/uipc-build.json": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011","instances/blanket-flatten-easy-i00/instance.json": "8c88216f6f6a97224af9c243c81f00cad3b434874f4514611c159799b98aad65","instances/blanket-flatten-easy-i00/instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","instances/blanket-flatten-easy-i00/instance_assets/initial_state/arrays.npz": "285bbe9895dfa1939fdc8345b65bb756f39d4d5978808c7db3f63890dbff91f7",@@ -462,5 +464,5 @@"release_archive": "image/release-2dafa5f2b.tar.gz","repo": "eai-v2-internal/robotangle-assets","repo_type": "dataset",- "revision": "7f7f95dd3719e3677f146732264668e82ca7a3f8"+ "revision": "08eb48360ce62b5ded7810c3dfb178b4a5e5e6fe"}diff --git a/scripts/robotangle/assets.py b/scripts/robotangle/assets.pyindex 6cd0c274e1..3eeaff718e 100644--- a/scripts/robotangle/assets.py+++ b/scripts/robotangle/assets.py@@ -14,6 +14,8 @@ The dataset holds:image/release-<commit9>.tar.gz git archive of the release commit (release.json), the paths theimage copiesimage/uipc-prebuilt/ the audited libuipc wheel and its uipc-build.json+ image/uipc-sm86/ the sm_86 libuipc build of the same recipe and its uipc-build.json+ (since image 0.2.21; release.json uipc_builds)Access: a member of eai-v2-internal, logged in with `hf auth login` or with HF_TOKEN in the environment. The token isnever printed. fetch needs huggingface_hub (pip install huggingface_hub); check and pin use the standard library only."""diff --git a/scripts/robotangle/check_context.py b/scripts/robotangle/check_context.pyindex 71dd6e0dbd..733660412b 100644--- a/scripts/robotangle/check_context.py+++ b/scripts/robotangle/check_context.py@@ -26,7 +26,8 @@ def public_source(ctx: pathlib.Path) -> dict:def main() -> int:ctx = pathlib.Path(sys.argv[1])- rt = json.loads((pathlib.Path(__file__).resolve().parent / "release.json").read_text())["runtime"]+ rel = json.loads((pathlib.Path(__file__).resolve().parent / "release.json").read_text())+ rt = rel["runtime"]bad = []src = public_source(ctx)if src != rt["source"]:@@ -34,6 +35,12 @@ def main() -> int:uj = ctx / "images/topogym/uipc-prebuilt/uipc-build.json"if not uj.is_file() or hashlib.sha256(uj.read_bytes()).hexdigest() != rt["uipc_build_sha256"]:bad.append(f"{uj}: missing or not the audited uipc-build.json ({rt['uipc_build_sha256'][:12]}…)")+ # the per-arch libuipc builds (release.json uipc_builds): the default one is the audited wheel above; a build with its+ # own prefix is in the context as its dataset folder without "image/" (fetch_image_context.sh: image/uipc-sm86 -> uipc-sm86)+ for arch, b in sorted(rel.get("uipc_builds", {}).items()):+ bj = ctx / b["dataset"].removeprefix("image/") / "uipc-build.json" if b.get("prefix") else uj+ if not bj.is_file() or hashlib.sha256(bj.read_bytes()).hexdigest() != b["uipc_build_sha256"]:+ bad.append(f"{bj}: missing or not the {arch} uipc-build.json ({b['uipc_build_sha256'][:12]}…)")for b in bad:print("FAIL", b)if not bad:diff --git a/scripts/robotangle/fetch_image_context.sh b/scripts/robotangle/fetch_image_context.shindex 5ca4af2597..307c808d8f 100755--- a/scripts/robotangle/fetch_image_context.sh+++ b/scripts/robotangle/fetch_image_context.sh@@ -1,9 +1,11 @@#!/usr/bin/env bash-# Prepare the RoboTangle image build context images/robotangle/context/ (images/robotangle/BUILD_ONLY), from our private+# Prepare the RoboTangle image build context images/robotangle/context/ (images/robotangle/README.md), from our private# Hugging Face dataset at the revision pinned in scripts/robotangle/assets.json. Every file's sha256 is checked there.# - image/release-<commit>.tar.gz: the release tree (scripts/robotangle/release.json `release_commit`), only the paths# images/topogym/Dockerfile copies;# - image/uipc-prebuilt/: the audited libuipc wheel and its uipc-build.json, which the task bindings name;+# - image/uipc-sm86/: the sm86 libuipc build of the same recipe and its uipc-build.json (release.json uipc_builds), which+# the image installs in /opt/uipc_sm86 (install_uipc_prefix.py) and checks with verify_uipc_wheel.py, as the audited one;# - instances/: every task's frozen instance. The image keeps them under /opt/robotangle/instances, and# stage_instance.py copies a task's own instance into it at task build / sim start.# Then scripts/robotangle/check_context.py checks the context against the runtime the tasks are bound to.@@ -17,9 +19,13 @@ ARCHIVE="$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["relrm -rf "$OUT"; mkdir -p "$OUT"tar -xzf "$DL/$ARCHIVE" -C "$OUT"mkdir -p "$OUT/images/topogym/uipc-prebuilt"; cp "$DL"/image/uipc-prebuilt/* "$OUT/images/topogym/uipc-prebuilt/"+mkdir -p "$OUT/uipc-sm86"; cp "$DL"/image/uipc-sm86/* "$OUT/uipc-sm86/"cp -a "$DL/instances" "$OUT/instances"cp "$ROOT/images/robotangle/stage_instance.py" "$OUT/stage_instance.py"-# the release's .dockerignore admits only what images/topogym/Dockerfile copies; ours also copies these two-printf '%s\n' '# robot_coding_bench (scripts/robotangle/fetch_image_context.sh): the frozen instances and their staging script' \- '!instances/' '!instances/**' '!stage_instance.py' >> "$OUT/.dockerignore"+cp "$ROOT/images/robotangle/install_uipc_prefix.py" "$ROOT/images/robotangle/verify_uipc_wheel.py" "$OUT/"+# the release's .dockerignore admits only what images/topogym/Dockerfile copies; ours also reads these+printf '%s\n' '# robot_coding_bench (scripts/robotangle/fetch_image_context.sh): the frozen instances and their staging script,' \+ '# the sm86 libuipc build, its installer and the wheel check' \+ '!instances/' '!instances/**' '!stage_instance.py' '!uipc-sm86/' '!uipc-sm86/**' '!install_uipc_prefix.py' \+ '!verify_uipc_wheel.py' >> "$OUT/.dockerignore"python3 "$ROOT/scripts/robotangle/check_context.py" "$OUT"diff --git a/scripts/robotangle/mk_tasks.py b/scripts/robotangle/mk_tasks.pyindex 561c83bc30..8aa9eac7ed 100644--- a/scripts/robotangle/mk_tasks.py+++ b/scripts/robotangle/mk_tasks.py@@ -156,7 +156,7 @@ def provenance(base: str, rec: dict) -> str:"which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at ""every session start.")rows.append(f"- Release: dev/jianwen `{REL['release_commit'][:9]}` (task templates `{REL['template_commit'][:9]}`), "- f"image `{IMAGE}` (BUILD_ONLY, images/robotangle/).")+ f"image `{IMAGE}` (images/robotangle/).")rows.append("- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the ""simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.")return "\n".join(rows)@@ -178,13 +178,29 @@ def rewrite_toml(s: str, base: str, rec: dict) -> str:return s+def changes(mode: str) -> list[str]:+ """The README Change Log (PROTOCOL §2.8: published tasks fixed in place)."""+ grader = ("The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) "+ "as a grader error; it counted as instance_mismatch." if mode == "standard" else "The graders are unchanged.")+ return [+ "- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc "+ "wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the "+ "same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the "+ "audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every "+ "other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling "+ "hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the "+ f"image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). {grader} The scene, frozen "+ "instance and pass rule are unchanged, so the task keeps its name.",+ ]++def rewrite_readme(s: str, base: str, mode: str, rec: dict) -> str:s = text(s).replace("from `tests/instance.json`", "from the frozen instance (`/tests/instance.json`, staged from the image and ""checked against `tests/runtime_binding.json`)")s = re.sub(r"(?ms)^## Reference solution\n.*?(?=^## )", "## Reference solution\n" + ref_solution(mode, rec) + "\n\n", s)nop = nop_words(base, mode, rec)s = re.sub(r"(?ms)^(## Verification\n.*?)(?=^## )", lambda m: m.group(1).rstrip() + "\n\n" + nop + "\n\n", s)- return s.rstrip() + "\n\n### Provenance\n" + provenance(base, rec) + "\n"+ return s.rstrip() + "\n\n### Provenance\n" + provenance(base, rec) + "\n\n### Change Log\n" + "\n".join(changes(mode)) + "\n"def binding(base: str, inst_dir: pathlib.Path | None = None) -> bytes:@@ -203,6 +219,9 @@ def binding(base: str, inst_dir: pathlib.Path | None = None) -> bytes:assert lock["asset_files"] == assets, f"{base}: instance_assets differ from the binding"lock["tooling_sha256"] = sha((SHARED / "rcb_topogym.py").read_bytes())lock["runtime"] = REL["runtime"]+ # both libuipc builds the tooling chooses from by the GPU's compute capability (rcb_topogym.select_uipc_build), by their+ # uipc-build.json sha256; the runtime's own uipc_build_sha256 stays the audited build, the image's default+ lock["uipc_builds"] = {name: b["uipc_build_sha256"] for name, b in sorted(REL["uipc_builds"].items())}return (json.dumps(lock, indent=2) + "\n").encode()@@ -220,6 +239,24 @@ def copy_tree(src: pathlib.Path, dst: pathlib.Path) -> None:(dst / p.relative_to(src)).mkdir(parents=True, exist_ok=True)+GPU_OLD = ("# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`\n"+ "# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).\n")+GPU_NEW = ("# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and\n"+ "# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's\n"+ "# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's\n"+ "# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.\n")+++def gpu_lines(name: str, s: str) -> str:+ """Compose files: one GPU through the device reservation only, as images/robopaint/ (no `runtime: nvidia`)."""+ if not name.endswith("docker-compose.yaml"):+ return s+ assert s.count(GPU_OLD) == 1 and len(re.findall(r"(?m)^\s*runtime: nvidia\n", s)) == 1, f"{name}: unexpected GPU block"+ s = re.sub(r"(?m)^\s*runtime: nvidia\n", "", s.replace(GPU_OLD, GPU_NEW))+ assert "count: 1" in s and "capabilities: [gpu]" in s and "NVIDIA_DRIVER_CAPABILITIES: all" in s, name+ return s++def image_lines(s: str) -> str:s = re.sub(r"(?m)^FROM\s+" + IMAGE_RX.pattern, "FROM " + IMAGE, s)return re.sub(r"(?m)^(\s*image:\s*)" + IMAGE_RX.pattern, lambda m: m.group(1) + IMAGE, s)@@ -259,7 +296,7 @@ def render(base: str, out: pathlib.Path, inst_src: pathlib.Path | None = None) -put(t / "instruction.md", text(rd("instruction.md")).replace("RoboTangle", "RoboTangle (simulator package `topogym`)", 1).encode())for n in ("environment/Dockerfile", "environment/docker-compose.yaml", "tests/Dockerfile", "tests/docker-compose.yaml"):if (up / n).is_file():- put(t / n, staged(n, image_lines(rd(n)), base).encode())+ put(t / n, staged(n, gpu_lines(n, image_lines(rd(n))), base).encode())put(t / "tests/test.sh", (up / "tests/test.sh").read_bytes(), exe=True)lock = binding(base, inst_src)tool = (SHARED / "rcb_topogym.py").read_bytes()@@ -298,7 +335,8 @@ def render(base: str, out: pathlib.Path, inst_src: pathlib.Path | None = None) -def snapshot(d: pathlib.Path) -> dict:- return {p.relative_to(d).as_posix(): (p.read_bytes(), os.stat(p).st_mode & 0o777) for p in sorted(d.rglob("*")) if p.is_file()}+ return {p.relative_to(d).as_posix(): (p.read_bytes(), 0o755 if os.stat(p).st_mode & 0o100 else 0o644) # exec bit only+ for p in sorted(d.rglob("*")) if p.is_file()}def main(argv: list[str]) -> int:diff --git a/scripts/robotangle/release.json b/scripts/robotangle/release.jsonindex c3ffbd7b83..b1688c22fd 100644--- a/scripts/robotangle/release.json+++ b/scripts/robotangle/release.json@@ -1400,8 +1400,27 @@},"uipc_build_sha256": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1"},- "runtime_notes": "source = the public simulator source of release_commit (images/topogym/prune.py rule); python, dependencies: the release's pinned locks; uipc_build_sha256 = the audited libuipc wheel of every lab evidence image (merged-v17..v19), installed with UIPC_WHEEL=prebuilt (images/robotangle/BUILD_ONLY).",+ "runtime_notes": "source = the public simulator source of release_commit (images/topogym/prune.py rule); python, dependencies: the release's pinned locks; uipc_build_sha256 = the audited libuipc wheel of every lab evidence image (merged-v17..v19), installed with UIPC_WHEEL=prebuilt (images/robotangle/README.md); it is the image's default build (/opt/uipc-build.json). uipc_builds: the two libuipc builds of one recipe (same pyuipc version and source commit, which the frozen IPC settled states hold) that the tooling chooses from at Session start, before uipc is imported (rcb_topogym.select_uipc_build): the audited wheel on compute capability 8.9 and 12.x or without a visible GPU, the sm86 build (/opt/uipc_sm86) on any other GPU. A task's runtime binding carries both (uipc_builds); the session's runtime_binding names the one in use.","template_commit": "2dafa5f2b2f596d3be78d92bb1b4377b548c4c7f",- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",- "tooling_version": "19"+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073",+ "tooling_version": "19",+ "uipc_builds": {+ "audited": {+ "architectures": "89-real;120-real;120-virtual",+ "dataset": "image/uipc-prebuilt",+ "prefix": null,+ "rule": "compute capability 8.9 or 12.x (SASS sm_89, sm_120), or no visible GPU",+ "uipc_build_sha256": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "wheel_sha256": "a50f5fdda86289aa08cbcfcbce0bb81fe983e6c829372fa316f9936f662d02e9"+ },+ "sm86": {+ "architectures": "86-real;86-virtual",+ "dataset": "image/uipc-sm86",+ "prefix": "/opt/uipc_sm86",+ "recipe": "images/robotangle/uipc-sm86-build (recipe_sha256 fba5c8093147a793ecc12e71f745a58f81f367fb329297b8de37e0d245d73646)",+ "rule": "any other compute capability: SASS sm_86 on 8.6 and 8.7, its compute_86 PTX (driver JIT) on 9.x and 10.x",+ "uipc_build_sha256": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011",+ "wheel_sha256": "d7f2fd659e1db6ffe1e0ed32b1aefc3b60945204e6371efadfdd2ac674b8ea1c"+ }+ }}diff --git a/scripts/robotangle/shared/rcb_topogym.py b/scripts/robotangle/shared/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/scripts/robotangle/shared/rcb_topogym.py+++ b/scripts/robotangle/shared/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/scripts/robotangle/shared/standard/grade.py b/scripts/robotangle/shared/standard/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/scripts/robotangle/shared/standard/grade.py+++ b/scripts/robotangle/shared/standard/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/dataset.toml b/tasks/dataset.tomlindex 2129b4b060..be03ba9077 100644--- a/tasks/dataset.toml+++ b/tasks/dataset.toml@@ -4859,419 +4859,419 @@ digest = "sha256:8e41c22f5a7f3b0c1137874d2841fc3e074a3ef4645faa1182b110f919b4d79[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-easy-i00-privileged"-digest = "sha256:5eef1c1a53064e5f43ee98286d67fdd5f64b18e7c63fde8b768458f054e31681"+digest = "sha256:a350f73feb43a55cbae5d754612dfc8445ed13f54220f01de5622e98d05924ef"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-easy-i00-standard"-digest = "sha256:76509eb44a2da878935d620083c0139aebdf3341e4f556b884fed0e5f848dde3"+digest = "sha256:9d09d044ba07d26105160e54c62833220224512f8a597b2522a07562d26e1ad5"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-hard-i00-privileged"-digest = "sha256:30c190b880bb487bc822d29e9e352331754eed826fe43be8ab5d9fb25f9bf9ce"+digest = "sha256:77404fabc5a5d2448e504db966717e615c62bf4c479fcb53f252e25f07d4b74c"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-hard-i00-standard"-digest = "sha256:bb50ba19fc945748156ae45f757198ab9a98ff207eb4c94232cba0146c5150a3"+digest = "sha256:f0aebc44c71a6fb38fc0ee0b918e5d62107db869a7a4b793cafb1f48761dc20d"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-medium-i00-privileged"-digest = "sha256:d7b4c399b66c0b4aedfc902375e27acc1ff45d40c4351ddcf407e58a1a7c9b72"+digest = "sha256:8271085456a1fb6bae2d862d57b0e9b0d4df544113e7e43bbde18305263494f8"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-medium-i00-standard"-digest = "sha256:6774b3e7613c177df98b6977628a3479a43e30ab004e83cab686ba6eb188c191"+digest = "sha256:d3d5aef0aaee65c74851769a4ed01576c7ebd61b40c1e792a127b9bba7f8c6b3"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-very-easy-i00-privileged"-digest = "sha256:6cc2a204740c581d8cd25abc45c4b24eda801c8e7dcd7bf5142c3427aa3ecaf7"+digest = "sha256:5f428189db59d85562662db0356856d12a302d03abacc3b94399cb10f02ce3df"[[tasks]]name = "robot-coding-bench/robotangle-blanket-flatten-very-easy-i00-standard"-digest = "sha256:2fcab2aa87e59894ae0d53cc647010bdb1932303c37b5e68550a3b3fe4e29fc5"+digest = "sha256:fc241fe026946682055eb6e68fc479c4ba738a6d54547f85b0207f55de21537b"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-easier-i00-privileged"-digest = "sha256:1f9150888037e6fa90cc0ae0af46978b4d495956c194ce41e1c7e6d970355f86"+digest = "sha256:a9995c03680928659a9f464177f1d5e8dc6470efb1e44fc90e832e494a52fb39"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-easier-i00-standard"-digest = "sha256:cba718743e82e7aefc3a3e51c161194f6f0ff2eb3661b664a9547493edffb6da"+digest = "sha256:e1c0101a284dd58610ed71976eef7491a62d35d0e59bb3983471b81d4b5a5eb6"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-easy-i00-privileged"-digest = "sha256:a7afd33db98c2490416ed135f5f1c7d25747cafed4b15b9d9477e6d665b3babd"+digest = "sha256:b7e45ca171d6d43028157c7dd7d4f5f37344b4f191c2188d513cfd330088de59"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-easy-i00-standard"-digest = "sha256:f7317e3d1931bdd8f1d3ccd01cabeff4a3637dbcf57525fac0ff66f7a4b2ab79"+digest = "sha256:f2baf4f6363461e720d0e14bc0b737fa15077853d6a8b5be7c6852753c0be046"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-hard-i00-privileged"-digest = "sha256:587a71d7c4723881a9a67a500562bb4c63f21c7fcb2e0256cd7176c41abd5cd5"+digest = "sha256:878282b01afd8a1bffab87a6551611af712e6ed3829e56770c13e66764a673bd"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-hard-i00-standard"-digest = "sha256:15d46ad9fb8cdd181322c52e221fa5b6499b117a2b8725119bbbda9838beff1e"+digest = "sha256:b50a1cdbd4445f5a224cf85801ead6ed08aa195c643f8140696dd409c2bc15f1"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-medium-i00-privileged"-digest = "sha256:2df205f9bb68cb65d922ff4a7a82b9d8d4f4852a6a30be2e28ade3a5e4685fce"+digest = "sha256:215464bdbb58ca49e384d1aef1dadf675ed28ff971dab236cf1e5b89df22614e"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-medium-i00-standard"-digest = "sha256:e3ec606b368027bff1a1c393ccb8f9373ee1feac293566a3c56e065d3ba6e1cc"+digest = "sha256:70063bd92795b680e78e66058fa1035b273e2c1b8cadd894a6a8787e39a76a08"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-very-easy-i00-privileged"-digest = "sha256:96d89c611b9472387d1d10da0980023c8e8d42a0b2e1dbc86eb8e77650412a5f"+digest = "sha256:61bed5e7ae418fee31d7d8f5b8ff88cb6b2e085af4de1641f5926b4cafac65be"[[tasks]]name = "robot-coding-bench/robotangle-buzz-wire-3d-very-easy-i00-standard"-digest = "sha256:0837e1ca63a89eea663c62e2b2766c5915587c871f902299dfd8332a83efd778"+digest = "sha256:87565a62b6109961debe6f79682ef6acf87ebba729e98cfea6a9c30a828fce84"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-easier-i00-privileged"-digest = "sha256:f871f9db03385475b605ae270596952ccbd02c23dabcd6a60ad0581c21e98c63"+digest = "sha256:ec775ebf14496a308904e17bef3a0baf84ebacac1a7527e7bfb3b924bce4e672"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-easier-i00-standard"-digest = "sha256:2e6ba7127323207e59421e9646c690623897c306256256c5ed05cb6ce58e492b"+digest = "sha256:caea3bb93e1536ae05bdae51456ea1451133d73be222141d05b3bf62f637f12d"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-easy-i00-privileged"-digest = "sha256:62962b061b6754fd9398d126ca1295b90146734fdbc414b51e179f3ef8492541"+digest = "sha256:895601411ad0465f87398bbbe14cfbfcd4fc691da415b0d7b2ec554a22a245cc"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-easy-i00-standard"-digest = "sha256:a48ced4826e2e7f25693b3d73778d33552353852f16a450ce3cf7bfd85fcf7e5"+digest = "sha256:caeb746035ee63b465d7a84796b2c27c8dce035633e02ec9cc61b7fa0f3e8f1a"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-hard-i00-privileged"-digest = "sha256:7e9ed0d1d9281e8a2572300e06b5856c3aea9d0c808190954de0d1ca0555e7d1"+digest = "sha256:bc60fc4651f18ad60600cc22385f1ec72ec91b34b3073c0f6dc4de0757fa1607"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-hard-i00-standard"-digest = "sha256:6912ef5de84ce429de0a17b6ee8322aba1522bbab89539dd3853cf7a1c967d99"+digest = "sha256:6f40fe3ae819e4d6bd9c79065338510364a7a011784348e696f02dfdf21c3cad"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-medium-i00-privileged"-digest = "sha256:f585d044346bfbf7de507147ecf5849a3ff7582489b323928decc6c45037d550"+digest = "sha256:7a1caaca7167774362ce31a1602a9bfaf24f3ae3ef166c20c964e7e1ef01a372"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-medium-i00-standard"-digest = "sha256:1f788d7f8eb0f0b313cf3a2fef14cfe57f4ae7e5f92df2471df5393db45583e7"+digest = "sha256:2871656a6b5c66b269e819d3a50d4eb3e1028bb48699fa41d6b57989a3456793"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-very-easy-i00-privileged"-digest = "sha256:e91b3e31514d4ccb58cdb478cac37fe27947e3ef9f162890283f42559a25384b"+digest = "sha256:3bb1d75be9a27e844c8d528d0d3a1d879c464620e5f46a23810b27d658a69816"[[tasks]]name = "robot-coding-bench/robotangle-cast-coil-very-easy-i00-standard"-digest = "sha256:b8e269451e9cb62e81392e247a3f8cdf767d3a79a7fd861981ae25e751c39e28"+digest = "sha256:4da87ef1ac4fe688b781359dadca5093e64dfe46b14d85a2c88e039fee90ba91"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-easier-i00-privileged"-digest = "sha256:5c1d038a2ad08715bc062248c95a9bf26cccbc27f0e09cab6688402d47fab35b"+digest = "sha256:2633a2bfeb1609601552b6c026466cef8fe7e932112eae90801ac5589194a3fb"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-easier-i00-standard"-digest = "sha256:6fa2988e4f10b17d3268f7427df405bb8c529013ea80b0744d5f6a04755b5da3"+digest = "sha256:cb3a280c9a9c9b38bd08d3be1f3360d75d93857a660e0f1e93262217ca900a04"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-easy-i00-privileged"-digest = "sha256:d9e30b1392703041a9aa679053cbf2eec2371894d571163b24b607afbf617f82"+digest = "sha256:eced195c0f03fa62e0d253e5d19709356ce7c03d698f4443daa4af99301f54e7"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-easy-i00-standard"-digest = "sha256:2a2b82fae0c75993b116b4eff6c2dfa46cea901f3d2d3c625c9ec8d1e1ea959c"+digest = "sha256:ef4317a767b26c7851a7a37873cb087a45abcd3ae94828fd3b5e38d262c58b23"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-hard-i00-privileged"-digest = "sha256:fd17db0e3f07c9b1d45763c58f752a299f03df8da211ef710b2dfce26c03e417"+digest = "sha256:80a06e26907898eaad918c48c797d0dc4b7be78c41605b56bcb5d3dd928c776f"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-hard-i00-standard"-digest = "sha256:7c54a28f4bd6377e26e69596d43cae9630714e5a6e50d0ffef966ddd20dbd905"+digest = "sha256:616791fa74a258dd5293b60d15ccf9563a95a2b6ce3fe40629795313e37ea25a"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-medium-i00-privileged"-digest = "sha256:4ebafaf7daa81c9b7e6c8b469a5b7448db06c1f168876cf69b44cae246995290"+digest = "sha256:a1cdf8052141fc1426f3909805def4c5b7270aff3ffe6a4cbdb58dbd8c1a0b42"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-medium-i00-standard"-digest = "sha256:94d13d1be17601027895318845f5aaa752e03d7e154a515c8053e8be5e4a20c9"+digest = "sha256:ddc30dd3704d8a6e8b8263abb057a2ba356dbc97985aa653e975a93a6d133a4d"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-very-easy-i00-privileged"-digest = "sha256:d5a8d5b47b887217e54ae2b8035089f31b8dafabeede2d7c39a2d9a2acabc002"+digest = "sha256:f940ce9960b04d127a2cdaf1d0c0687ece7ef6c3142133d2d309823357b459cf"[[tasks]]name = "robot-coding-bench/robotangle-cast-keyhole-very-easy-i00-standard"-digest = "sha256:726b5d11732775a53a8bcd30943349ef6f65cace791d478386fc5f8b642a4cb4"+digest = "sha256:7266608a2f6520ad842168acb4ebe5335dcbb35b58b9a9bca260ea32b100448b"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-easier-i00-privileged"-digest = "sha256:59278feea1a2ae0d1af4a4f37a0b92d40f769b554880ab7a6ca647345362b9fe"+digest = "sha256:83bf145771fe7f7259319dea002c5cee3d1df94313e5817b0706e96aa6f0b83c"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-easier-i00-standard"-digest = "sha256:76c83734f1a7aa23a50f66feb232e0d71ba967aa14685b679444cc2ad327df42"+digest = "sha256:bfecf5fd64362e5bd5b07b21da68dd5175ee3bab88ef0bbd8e17218562d1cce1"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-easy-i00-privileged"-digest = "sha256:4e0ffc8db4514de051c06b401e00f33ae4d533536efc4431484b583d6ae697a2"+digest = "sha256:8a584603e75ca8f252d9ac8add83a17b7acef845f1b0d5f303bf703027f04d7c"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-easy-i00-standard"-digest = "sha256:cc409dcc5c0ee875d10fab9b7a3996ca47d8db044b39c50cb51ced76b5740ec3"+digest = "sha256:d3293e93d040e4d2ef7ca7b413a0e8b1740ccc730ce28012b48ba2da6c3e0dc7"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-hard-i00-privileged"-digest = "sha256:91af3844923290657f7b86354322a300d0a2483442e0d027dab0b4171f535a5b"+digest = "sha256:298de8c378ae9ca5b3f87a46b088a7c4250c89892564f267eff2e2a62c44a8f5"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-hard-i00-standard"-digest = "sha256:37ef79d86ffd3c872754b80e16666ab9f5335581f1128e71bcd3e8e093298a38"+digest = "sha256:180f7b33a8c7381e0d1cc24267f2bcc633a37345acaa646d09177ac3409fd7ff"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-medium-i00-privileged"-digest = "sha256:4bccb8564bfe1a56529fafd6d9684be529b13da7fe57f37de33c0b2b685af936"+digest = "sha256:cdbe79a7b53e7da1faa12f9afa902ee99b97cf41a6d3f75d84a7c15797a240c5"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-medium-i00-standard"-digest = "sha256:7df18276c2be4b71d1df11b203142d0ebf980e4ab9e6deca142453d1b5766a26"+digest = "sha256:c3f1f06629f1b3de24666306fd8b4e5484791a13e3d3acf0127134653fd00e1a"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-very-easy-i00-privileged"-digest = "sha256:162c0f25bcefb4b8a579493890fc7ea769eb51198950a6a7d2328cd441de1a3a"+digest = "sha256:7abcdf1f23f4b432e3609f6bc7e0986f629122d4fa58e83402d925fb1e3502d4"[[tasks]]name = "robot-coding-bench/robotangle-fiber-bundling-very-easy-i00-standard"-digest = "sha256:72c4e9e367757ad78c9df597be452242cb38ebc792450c17289abf553213f8b0"+digest = "sha256:2bc1646547091b14bfe9fb6f7cd413920196a24cf864b6c6ace49dd9ff208e11"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-easier-i00-privileged"-digest = "sha256:bc532f7de463ea5a893eb969433376cb1b85982ac9711f56d95be7d33e0dfee1"+digest = "sha256:2b644155b2a32e2f36c8b93c1cc4ab79d079d4032a1d2ff2446c5f79fdce9f68"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-easier-i00-standard"-digest = "sha256:c4aa9b1894b896d6dc5dcdac179a840b63321aefa5129b0937a79e5983a1fe9f"+digest = "sha256:4b9b0fa99455531f61cc62285ef5ff35d52899e49ceda4f7ddf4918b2655c948"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-easy-i00-privileged"-digest = "sha256:b21a724b75b5e4e7268492285b716920f8ff3750bef077799510e4460b70f43f"+digest = "sha256:821a77ff3b585dc918effa717c2756304a15017d38d8d0cf38f23df0126c8eb6"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-easy-i00-standard"-digest = "sha256:00ee36345375cb4ce526a76face8b0535eac51aee1467e1a5ea46ffddeae8f97"+digest = "sha256:7049fd536145f2abf002e02e7c0bd63d1d42881eb98025a22b99ede658213f97"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-hard-i00-privileged"-digest = "sha256:3eb1c73bcf2b6067bb6b928700b10567792a137d70f6a5d6a7eccd9e2d9cad49"+digest = "sha256:a93f5e29d06f7c5caf750e33e98acffeedf55b7d91209091d642cb72e30ead03"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-hard-i00-standard"-digest = "sha256:8daa4591b1040f914c2e0bcb716b03c0770cb064488a4314c69d47355536931c"+digest = "sha256:f94f0e65bafffef8e818e4347ccd7346f88c91028236e5f6fce8ffc83a69756a"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-medium-i00-privileged"-digest = "sha256:76082faad2d6f45ff6ac5f6f98d2bab02ea1eeeeabadf2d95875e203c051232b"+digest = "sha256:e14e63505b6b5c7f84dde3ef9838b956969d04ada7ea397970d1286741c67cbb"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-medium-i00-standard"-digest = "sha256:03eb9bb414775ecf2b6e0479c522d73b1c6ef22a4806ab2472bb4ed67cdd8503"+digest = "sha256:b9719174e6c5e8dc45e2a41dae325496ffd7704523dfabb15496f1676fc04393"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-very-easy-i00-privileged"-digest = "sha256:f86ddced0eba8fd60e92e3823dfa27da03bf691e892aba332e0b9eb0c1123566"+digest = "sha256:19b7005865eaf96ed0cd87eb7f7828e1b3ff46c336b9b340f22a79b0e4835817"[[tasks]]name = "robot-coding-bench/robotangle-hedgehog-in-cage-very-easy-i00-standard"-digest = "sha256:c19b02fb4d8676bd3f86f657f7e609601a11887daec3ac1844ddaaa2fb12df27"+digest = "sha256:df86f80876d0446efa1d0e32c75815d585d7660cc6ec97947547b67f9bc5ed08"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-easier-i00-privileged"-digest = "sha256:97d9e8b3bcca62f9b9883349e3054f56dc4021277d337538a45d26eee7e399cb"+digest = "sha256:09ba399a9932944329710b1a7e477795881a2bfce7ec7876aa8e99641564eec7"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-easier-i00-standard"-digest = "sha256:ec346b6f345b47c8d67b90288f2755148977bd0fdb4cc63bae869dae0be5bf57"+digest = "sha256:bde42a1e2fd55e77e0074076eccb3f2917d8e9748fc42dbdca9a3f2c56a95954"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-easy-i00-privileged"-digest = "sha256:b6873aca4f435fd84db9822bc07a02530c2f3b0847e313fe6aaf55e39229b038"+digest = "sha256:e3260d44a461b1f496f6dd3251ca4801cc1ec37175fdf6d4f8665efad6c950f9"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-easy-i00-standard"-digest = "sha256:386e633d2bbf7edefad51dd3c91f6b1f2adb99443171ce77f2d3b07888f197b8"+digest = "sha256:91431e1f8bfeda20991cf4dee9fbf80d309dcad52aed982cabc8c231c7c305e6"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-hard-i00-privileged"-digest = "sha256:49afbbdd7b66046850d60f606ea1cbb4c267ec1d63e6052895e2baf06a740273"+digest = "sha256:eafa328f36beffb04be2270c2a856ef77b66b6e98973548ae596be93d2959246"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-hard-i00-standard"-digest = "sha256:36d95e3cffcbd62a4db4fc59f411c6340d291d49761636b031de9baafeab4336"+digest = "sha256:da1647b9af57a43277981f7e53a8581d79646cc7bc5560ae202f6baa5c07a54e"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-medium-i00-privileged"-digest = "sha256:9d52b8255454067e11b66f44bf9cdaf186bb5be70480b0d1be60476f5104bef6"+digest = "sha256:346843ceea21beee35e67b6b0e8920b9b09fd93522693e475aba3bda55e0d6ba"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-medium-i00-standard"-digest = "sha256:c63460ef19bc97f69d81bcb77141d0efbf427c50bba7265a102b413e3cca8826"+digest = "sha256:0efdf9e81b9f366a48e9d7f51072233df170c073877e0468b82a2e9d49f20898"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-very-easy-i00-privileged"-digest = "sha256:58a7199c4a60465c8b95f14fa6f2eb049159c28e4fb1eb8312e1bfb66817278b"+digest = "sha256:de8d167374fe6971c36d4540cd5f33eeadd78c84666a2dc7a5d717411ad2fc90"[[tasks]]name = "robot-coding-bench/robotangle-horseshoe-ring-very-easy-i00-standard"-digest = "sha256:ae658aa6fb8ed5ab2f0830f13ed6301156486caac71ba99c97aafd4491b8d545"+digest = "sha256:720ed7f84a5e9076462464e2126b4937f515d95eb6fe8459f3532af7610292f7"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-easier-i00-privileged"-digest = "sha256:641f6e34d5b361d5b25e32a15ada4f2de1b63588d7f45161f035d7d8326bca50"+digest = "sha256:0208bb8aaef0d0035e85699d307acf18502626efca3138a8c95bc2d6a7fab3e0"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-easier-i00-standard"-digest = "sha256:8a13a27f352bc943d38ea184fc91088811a2d5ec97f049f8a91ac3c8b4e1022f"+digest = "sha256:08e40141d04de0dd92514ad71c58026e2e2c8af33baa51502a217f3826aa17d5"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-easy-i00-privileged"-digest = "sha256:75799b2332ed2c69ba23d20f0122e3ed94b373338967cc815c3da09e4cafd6fb"+digest = "sha256:149d8a5508d045c93c87356792fc0e26deb2bf51694ead8488edebf2093f44d8"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-easy-i00-standard"-digest = "sha256:8b9301ba51f7ec613c7d09e915307eb2ba7237ca6f8bcd5efcca064019a8e7a2"+digest = "sha256:b093fb1a2b78c3b0b9c21dc29819ce963f2f22d825ec869b11027d28ba8457d3"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-hard-i00-privileged"-digest = "sha256:294d627ab7bfbf7eb1330eadb890a4a1eba984e98f79b8de510380410ddd41c4"+digest = "sha256:1ae72352642ee6b3c0050dc7f9d936b44c184f8f65f76fc839fea0181f669f94"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-hard-i00-standard"-digest = "sha256:752b33ab2472d195b15834b150f0655664889fb008b66d85ce2c9e4dce4f5f0c"+digest = "sha256:0c7428fa82dc23df3628bb0424fee2f94907fc18ce98ae8c1482ab4ebce23efa"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-medium-i00-privileged"-digest = "sha256:8bd10e56671bd07ef8e864ef07709a75e7682216ff7d21d3b7624b3853c6bab6"+digest = "sha256:f79c710e4e0108d834bbb6163ba0bd0e9b2916bde980c72000e6008cadfaa2d6"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-medium-i00-standard"-digest = "sha256:079401474284da65358a608574d2c82568379de628067431acc6903474d69421"+digest = "sha256:447dfc4f2683ab7420037bb95cc67f6b59dc23a5b435cee48d71f323d75af8a8"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-very-easy-i00-privileged"-digest = "sha256:7bb81da248a117d515b6eda10e81eb91d9b8d92c8ffee980b2ec1ca098ed66a0"+digest = "sha256:2ec91aa42622dc3b84177363e07c66222e7ac03017fe794144bfff9d13ee2a54"[[tasks]]name = "robot-coding-bench/robotangle-interlocked-claws-very-easy-i00-standard"-digest = "sha256:fabe075b8bff0f649746773c1a36d30abfb8fca1c68b317ff1650a18efe62a3e"+digest = "sha256:405acf0bd5894c628de8a1e5878245e355ae14877b26ed5a4965f1845269ad8d"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-easier-i00-privileged"-digest = "sha256:5cb778c76698df6beb6eab28cdadd02af04ac3af57c04985c8c3ed732573dfb8"+digest = "sha256:7067d1f5d16c3a20c105580c47e00a23d6a0a86f99109bf9c7237ea4061b8672"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-easier-i00-standard"-digest = "sha256:d861b006bd10122449f9c18fca064cfac1430e35af88e2d683f2c6dd4fb384dc"+digest = "sha256:6bcb31ed8bc7288ffdc38bd631440d9c0b888ac981774682d4032b663a4233c4"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-easy-i00-privileged"-digest = "sha256:2572bd4b3b8f8a7bf5b23f117a6c239750ea5f4b7d79025b68d14a7205eb37e5"+digest = "sha256:99d6984a53be66ab947efee43af37f5ac91bf6273bb5c2425906e7031d1d1cf9"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-easy-i00-standard"-digest = "sha256:c4a2a7f9348289a0459c658fa9a469ee9e87cabf51d67bdb8b441f45210e1a28"+digest = "sha256:facd5529b035d1aca10c3421f24851e653f3d20e95263125f90266565b6550a7"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-hard-i00-privileged"-digest = "sha256:033e5552fd44d313d6fdf3b8ca9516a230e313d5ed8989bd28c52cb37c43384d"+digest = "sha256:f50e79c2609f2d274294dbbd633b450e479033bc1c1212d19e4d55d05045f3c9"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-hard-i00-standard"-digest = "sha256:2d0c5dbcfaee1ca8512246fd5d45f089eb7dea399f39e5dd2df9ef3ab085b0dd"+digest = "sha256:7fd504b363bd5ea7a762c25e7b401b1d3b7cada1b2430587eb36c1551de26e7d"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-medium-i00-privileged"-digest = "sha256:ee6e84b4be05bcafb7bab34d72e8bce1e9cd70acbc926208d8e7c137265b4514"+digest = "sha256:fd6dca0da9f1d71530a7f775cb0419ac0c17c4873bb7a465f6afed78127786c1"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-medium-i00-standard"-digest = "sha256:b82c4af2ee66bb714e4f5de914668f64d1f0fc9260e0a998fdeba3ae296172bb"+digest = "sha256:91d839a426174920a0e07d36e0525b695ca07b7c8e70e6fe4210980e4ef2dd67"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-very-easy-i00-privileged"-digest = "sha256:7e111ff148c37ef291217ae0a7e305d02a0a1169039e2768dab02a3ee03dd32d"+digest = "sha256:5e827dbc298ee4824666e9bf41b76cafda84e09000da4e1f566035538c214f40"[[tasks]]name = "robot-coding-bench/robotangle-knot-untying-very-easy-i00-standard"-digest = "sha256:68c0440cbeb135e0c5f9003010448d6e557d933a779a1d632e9cab8e4afc760a"+digest = "sha256:d393aed06adf1afcd6afdb533c448c54705133a0a0aceacbeeb8768ad0f82a73"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-easier-i00-privileged"-digest = "sha256:61ca2c60252d8d85ea300cdb5592065a0eb07f0c60083c24354d5f4b080dfc27"+digest = "sha256:fa755dc96297f08f47aa27d28d1dad07583a833cf62b8b3ac50d7d03e7e09e28"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-easier-i00-standard"-digest = "sha256:dd86ddd656986af0ae9ec5d2ed77f98e1e03d198dd347749fb1eaed365438632"+digest = "sha256:ec61da6c12f46e1ecfa92202608eaaed2ee35c098e485629715582eccff08a74"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-easy-i00-privileged"-digest = "sha256:ccbd95f0b47c469c508ed9fd2d3bb42f1186d9642d8f82006af4f268a31eac65"+digest = "sha256:9e365fe6598aac323623e0d031d6b89b370d7a5744f875fcec9b3b18bc34c07c"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-easy-i00-standard"-digest = "sha256:392fa300b6d9788644ef26c600a1c8964636c9415f59f0efb23a8f413201f97e"+digest = "sha256:6bbabaee3ef5991bb65b706fd14a0244aa325caa2cf096aa88411f802a539934"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-hard-i00-privileged"-digest = "sha256:4a1df4904b81e5d683932ab993d81d54c5bd6942814088ba4fb19ece2ec78b29"+digest = "sha256:8da97f3ef3758ce82cfaef5b4351b76e9407579710241aa106e7396679dea1af"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-hard-i00-standard"-digest = "sha256:f2f1817a140c496025e6dbe618867cd9af8cd8e261cac0f906145dfe6117d4b2"+digest = "sha256:e78add14ca0e581f32fb40ab9bd4dc40060881a75863502d4969fc60f7168701"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-medium-i00-privileged"-digest = "sha256:1ab6b079c6aa9011fac47756f84a77e453888db1b2814c6b5af425d485339af3"+digest = "sha256:5d89d7aebd644e1bd5237024668a34a0ce379696bb32dc1e5e738ffba4950560"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-medium-i00-standard"-digest = "sha256:c386a8410557e610c6ccc769e4de091dc1d4d63fcb728fdc425b58f6ce4ecbc3"+digest = "sha256:01f3f4dd4e023818faeb35ad43b6a22d317cafb88b1a8327a160e1d8af837aeb"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-very-easy-i00-privileged"-digest = "sha256:6e758075acdacca8c355f21633734062a4451f5977904359f23ce2c0443d9b19"+digest = "sha256:0663d135b24df88b81506be7a6184de1284daaeabc17427099831ad33c31ead4"[[tasks]]name = "robot-coding-bench/robotangle-lock-picking-very-easy-i00-standard"-digest = "sha256:950036070d53c67557302c73b3fe0e7e80992d4554e7e62e29c2d9252b311d07"+digest = "sha256:a5edc4985923a22eea8fcbd97083d23152b6ee6f431a970f8225d0b8c775888a"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-easy-i00-privileged"-digest = "sha256:0eab49cda5aa1de68850c2e771d12fdbb2e108e6ede08b5feae5bb3489e2603b"+digest = "sha256:8471bc8c7e953d15bcbd541a7f7b9e96b786c5e8490127f9bcbb18ca995f1523"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-easy-i00-standard"-digest = "sha256:b4d69a65c0a1381d20edd7e3f48b0c3c1e382a4e834cfd6a6bd47500ef56dade"+digest = "sha256:a2effb7710ad0bef2eff93da71ed55b80ecd8c594a75ce6ec0b841589aa98144"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-hard-i00-privileged"-digest = "sha256:20f63786f0afb4577473867e10153336a18440fc46520767637d1493986c45dd"+digest = "sha256:83438ed17c71ce0faa55aa8d630b8b7575c621785d77ecb85d4663993958618e"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-hard-i00-standard"-digest = "sha256:b232fd1511e7d04584055d3090f243c181201f8ce2e3c1028384689235543228"+digest = "sha256:b7c22a7a8f128713b02acbe9e0cec2fc3718b6b571237bd06e9fcb2e7713ad25"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-medium-i00-privileged"-digest = "sha256:ce0ffbbac335105e6ee0929b4cca074de772b380df32e28c03067f0ed11898f1"+digest = "sha256:561b49acbcd02077aa3a44d7ea30ca7eb02088a739f92d2f3eff7a282f3e8bac"[[tasks]]name = "robot-coding-bench/robotangle-rope-threading-medium-i00-standard"-digest = "sha256:61a76e1dc4a129237492c8d6009b20e35c4f2c0848b581a265445b531dab291e"+digest = "sha256:59ae3561c49af726f9569a8a530db916a5c7cd9bd387f835505d902b93b1bf9d"[[tasks]]name = "robot-coding-bench/humanoidbench-loco-balance-hard-i00-standard-realtime"diff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/README.md b/tasks/robotangle-blanket-flatten-easy-i00-privileged/README.mdindex f9c2488edc..1ecb96b934 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/README.md+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle blanket_flatten (ALOHA 2, Genesis): produce one replayable trajectory. Unfold and spread the blanket flat on the table without overlaps or excessive stretching, then release it and withdraw. Frozen scene instance (variation blanket_flatten_easy, seed 0).@@ -63,7 +63,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st- A failure is reported in `s.status()["episode_end"]` as "Cloth fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/Dockerfileindex 6524678439..ffe0ff7bbd 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py blanket-flatten-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/runtime_binding.jsonindex 73fee3a741..e7fa301c1c 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/environment/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "285bbe9895dfa1939fdc8345b65bb756f39d4d5978808c7db3f63890dbff91f7","instance_assets/initial_state/manifest.json": "eceb21e777c39a62c1343c676807636e3e9ff221cced5d63d63b1d87c6faaaec"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/Dockerfileindex a05b79cc20..dad906520d 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py blanket-flatten-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/runtime_binding.jsonindex 73fee3a741..e7fa301c1c 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-easy-i00-privileged/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "285bbe9895dfa1939fdc8345b65bb756f39d4d5978808c7db3f63890dbff91f7","instance_assets/initial_state/manifest.json": "eceb21e777c39a62c1343c676807636e3e9ff221cced5d63d63b1d87c6faaaec"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/README.md b/tasks/robotangle-blanket-flatten-easy-i00-standard/README.mdindex a51a3d0d7b..4c0094845c 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/README.md+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-blanket-flatten-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/docker-compose.yamlindex a1f64391c9..7496ee78b3 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/runtime_binding.jsonindex 73fee3a741..e7fa301c1c 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/environment/sim/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "285bbe9895dfa1939fdc8345b65bb756f39d4d5978808c7db3f63890dbff91f7","instance_assets/initial_state/manifest.json": "eceb21e777c39a62c1343c676807636e3e9ff221cced5d63d63b1d87c6faaaec"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/grade.py b/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/runtime_binding.jsonindex 73fee3a741..e7fa301c1c 100644--- a/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-easy-i00-standard/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "285bbe9895dfa1939fdc8345b65bb756f39d4d5978808c7db3f63890dbff91f7","instance_assets/initial_state/manifest.json": "eceb21e777c39a62c1343c676807636e3e9ff221cced5d63d63b1d87c6faaaec"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/README.md b/tasks/robotangle-blanket-flatten-hard-i00-privileged/README.mdindex 70ec5d2db9..9416ffcf8a 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/README.md+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle blanket_flatten (ALOHA 2, Genesis): produce one replayable trajectory. Unfold and spread the blanket flat on the table without overlaps or excessive stretching, then release it and withdraw. Frozen scene instance (variation blanket_flatten_hard, seed 0).@@ -63,7 +63,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st- A failure is reported in `s.status()["episode_end"]` as "Cloth fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/Dockerfileindex fef51e3faf..80c91036a4 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py blanket-flatten-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/runtime_binding.jsonindex 0ecbec473e..1d554c518e 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/environment/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "75662c1f2b5608d550c6d942ddaa8949099cb85aa7bc6811d8595845c90c0d26","instance_assets/initial_state/manifest.json": "ad206d92c9560a880827cffa2ba2a130acabace6bbc0ace8e1afe53b5b4fe35b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/Dockerfileindex 3dbb4b7670..c8d82508ee 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py blanket-flatten-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/runtime_binding.jsonindex 0ecbec473e..1d554c518e 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-hard-i00-privileged/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "75662c1f2b5608d550c6d942ddaa8949099cb85aa7bc6811d8595845c90c0d26","instance_assets/initial_state/manifest.json": "ad206d92c9560a880827cffa2ba2a130acabace6bbc0ace8e1afe53b5b4fe35b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/README.md b/tasks/robotangle-blanket-flatten-hard-i00-standard/README.mdindex 19f9bfea98..a571628ebb 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/README.md+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-blanket-flatten-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/docker-compose.yamlindex 494ff7a8a1..a196cc14cd 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/runtime_binding.jsonindex 0ecbec473e..1d554c518e 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/environment/sim/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "75662c1f2b5608d550c6d942ddaa8949099cb85aa7bc6811d8595845c90c0d26","instance_assets/initial_state/manifest.json": "ad206d92c9560a880827cffa2ba2a130acabace6bbc0ace8e1afe53b5b4fe35b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/grade.py b/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/runtime_binding.jsonindex 0ecbec473e..1d554c518e 100644--- a/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-hard-i00-standard/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "75662c1f2b5608d550c6d942ddaa8949099cb85aa7bc6811d8595845c90c0d26","instance_assets/initial_state/manifest.json": "ad206d92c9560a880827cffa2ba2a130acabace6bbc0ace8e1afe53b5b4fe35b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/README.md b/tasks/robotangle-blanket-flatten-medium-i00-privileged/README.mdindex d17a39dd27..987dd86740 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/README.md+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle blanket_flatten (ALOHA 2, Genesis): produce one replayable trajectory. Unfold and spread the blanket flat on the table without overlaps or excessive stretching, then release it and withdraw. Frozen scene instance (variation blanket_flatten_medium, seed 0).@@ -63,7 +63,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st- A failure is reported in `s.status()["episode_end"]` as "Cloth fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/Dockerfileindex 87380244f6..ae6ac4cb29 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py blanket-flatten-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/runtime_binding.jsonindex 8e353a426e..cbc268b069 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/environment/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "f4238c7d0712ddba243cc27dabe75ccec63c76583aeb06d05d46af6a47bd2c4a","instance_assets/initial_state/manifest.json": "0c65613086a9c0501a6de3b1a1f78ce1724fefb208bacece62050948c2472172"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/Dockerfileindex 693510191b..b3826947f8 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py blanket-flatten-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/runtime_binding.jsonindex 8e353a426e..cbc268b069 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-medium-i00-privileged/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "f4238c7d0712ddba243cc27dabe75ccec63c76583aeb06d05d46af6a47bd2c4a","instance_assets/initial_state/manifest.json": "0c65613086a9c0501a6de3b1a1f78ce1724fefb208bacece62050948c2472172"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/README.md b/tasks/robotangle-blanket-flatten-medium-i00-standard/README.mdindex 584cf318b1..6d61708189 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/README.md+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-blanket-flatten-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/docker-compose.yamlindex 48b198c3d0..f1c9e75fdb 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/runtime_binding.jsonindex 8e353a426e..cbc268b069 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/environment/sim/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "f4238c7d0712ddba243cc27dabe75ccec63c76583aeb06d05d46af6a47bd2c4a","instance_assets/initial_state/manifest.json": "0c65613086a9c0501a6de3b1a1f78ce1724fefb208bacece62050948c2472172"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/grade.py b/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/runtime_binding.jsonindex 8e353a426e..cbc268b069 100644--- a/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-medium-i00-standard/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "f4238c7d0712ddba243cc27dabe75ccec63c76583aeb06d05d46af6a47bd2c4a","instance_assets/initial_state/manifest.json": "0c65613086a9c0501a6de3b1a1f78ce1724fefb208bacece62050948c2472172"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/README.md b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/README.mdindex 034b720622..e977490a72 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle blanket_flatten (ALOHA 2, Genesis): produce one replayable trajectory. Unfold and spread the blanket flat on the table without overlaps or excessive stretching, then release it and withdraw. Frozen scene instance (variation very_easy, seed 0).@@ -63,7 +63,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st- A failure is reported in `s.status()["episode_end"]` as "Cloth fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/Dockerfileindex c0876f8374..6e538d9232 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py blanket-flatten-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/runtime_binding.jsonindex ebf16f8d2a..61d188bf07 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/environment/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "2b3ae142101f33adeaf5268fae5741c11348f2182ec522f83cfd278dba443621","instance_assets/initial_state/manifest.json": "1a45b373aa43cd57b33f4d4f8a7012cd2c85c55586705799fcc3f2d92a0b9bbd"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/Dockerfileindex 5261861e93..2290b38cca 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py blanket-flatten-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/runtime_binding.jsonindex ebf16f8d2a..61d188bf07 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-privileged/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "2b3ae142101f33adeaf5268fae5741c11348f2182ec522f83cfd278dba443621","instance_assets/initial_state/manifest.json": "1a45b373aa43cd57b33f4d4f8a7012cd2c85c55586705799fcc3f2d92a0b9bbd"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/README.md b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/README.mdindex 769daef42d..b5e9170242 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/README.md+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `blanket_flatten` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-blanket-flatten-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Unfold and spread the blanket flat on the table without overlaps or excessive st| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/blanket-flatten-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `db0bb489` (graded package `topospeed/v19/cand_v19b/tasks/topogym-blanket-flatten-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/blanket-flatten-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/docker-compose.yamlindex 14851587e0..672d1277ed 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex ebf16f8d2a..61d188bf07 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "2b3ae142101f33adeaf5268fae5741c11348f2182ec522f83cfd278dba443621","instance_assets/initial_state/manifest.json": "1a45b373aa43cd57b33f4d4f8a7012cd2c85c55586705799fcc3f2d92a0b9bbd"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/runtime_binding.jsonindex ebf16f8d2a..61d188bf07 100644--- a/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-blanket-flatten-very-easy-i00-standard/tests/runtime_binding.json@@ -6,7 +6,7 @@"instance_assets/initial_state/arrays.npz": "2b3ae142101f33adeaf5268fae5741c11348f2182ec522f83cfd278dba443621","instance_assets/initial_state/manifest.json": "1a45b373aa43cd57b33f4d4f8a7012cd2c85c55586705799fcc3f2d92a0b9bbd"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "db0bb48985b4cc02c47bdcd15ca5388a3d7d71286165827b7c8c6b360f77bbf5","files": 356@@ -30,5 +30,9 @@"reference": "labv19/rcb-topogym:0.2.17-dev-cu128","id": "sha256:0655430754aed4e7bc779d36be15569c3a6e8b79d43fd57f39f4e5562ef588be","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/README.md b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/README.mdindex 752c1af474..63f4fad239 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/README.md+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle buzz_wire_3d (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Guide the metal loop along the entire wire from start to finish without touching the wire, then release the tool on the finish support. Frozen scene instance (variation easier, seed 0).@@ -63,7 +63,10 @@ Guide the metal loop along the entire wire from start to finish without touching- A failure is reported in `s.status()["episode_end"]` as "wire_touched", "Wand fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/Dockerfileindex a31a4e385f..ce1fd636c1 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py buzz-wire-3d-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/runtime_binding.jsonindex a30a41a929..85f409bf32 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/Dockerfileindex 958bf424bc..30806d9186 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py buzz-wire-3d-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/runtime_binding.jsonindex a30a41a929..85f409bf32 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/README.md b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/README.mdindex 3cf3d12436..da04fb068f 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/README.md+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-buzz-wire-3d-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Guide the metal loop along the entire wire from start to finish without touching| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/docker-compose.yamlindex 820a2d6a2b..8ede3082d5 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/runtime_binding.jsonindex a30a41a929..85f409bf32 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/grade.py b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/runtime_binding.jsonindex a30a41a929..85f409bf32 100644--- a/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/README.md b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/README.mdindex aad5e70c28..3c35937c52 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/README.md+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle buzz_wire_3d (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Guide the metal loop along the entire wire from start to finish without touching the wire, then release the tool on the finish support. Frozen scene instance (variation buzz_wire_3d_easy, seed 0).@@ -63,7 +63,10 @@ Guide the metal loop along the entire wire from start to finish without touching- A failure is reported in `s.status()["episode_end"]` as "wire_touched", "Wand fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/Dockerfileindex bcd3f31888..7c1d54d0d2 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py buzz-wire-3d-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/runtime_binding.jsonindex d559d9b16c..e93bfa4abb 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/Dockerfileindex 7d3b0369dd..8516458b3b 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py buzz-wire-3d-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/runtime_binding.jsonindex d559d9b16c..e93bfa4abb 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/README.md b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/README.mdindex 66916a45ca..c0477f9ebc 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/README.md+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-buzz-wire-3d-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Guide the metal loop along the entire wire from start to finish without touching| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/docker-compose.yamlindex c7d2234636..c38931c0ed 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/runtime_binding.jsonindex d559d9b16c..e93bfa4abb 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/grade.py b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/runtime_binding.jsonindex d559d9b16c..e93bfa4abb 100644--- a/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/README.md b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/README.mdindex e1250cc54b..b38b478e31 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/README.md+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle buzz_wire_3d (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Guide the metal loop along the entire wire from start to finish without touching the wire, then release the tool on the finish support. Frozen scene instance (variation buzz_wire_3d_hard, seed 0).@@ -63,7 +63,10 @@ Guide the metal loop along the entire wire from start to finish without touching- A failure is reported in `s.status()["episode_end"]` as "wire_touched", "Wand fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/Dockerfileindex 44bcee9697..2807a445d8 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py buzz-wire-3d-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/runtime_binding.jsonindex 347f57ab84..771cdb4e32 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/Dockerfileindex 2eb56915af..8c0788d961 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py buzz-wire-3d-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/runtime_binding.jsonindex 347f57ab84..771cdb4e32 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/README.md b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/README.mdindex e49c81a303..3d33c7ca3e 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/README.md+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-buzz-wire-3d-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Guide the metal loop along the entire wire from start to finish without touching| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/docker-compose.yamlindex 92b1eff6a8..7a1124a713 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/runtime_binding.jsonindex 347f57ab84..771cdb4e32 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/grade.py b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/runtime_binding.jsonindex 347f57ab84..771cdb4e32 100644--- a/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/README.md b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/README.mdindex ce6986c3a0..14b81ea0cf 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/README.md+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle buzz_wire_3d (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Guide the metal loop along the entire wire from start to finish without touching the wire, then release the tool on the finish support. Frozen scene instance (variation buzz_wire_3d_medium, seed 0).@@ -63,7 +63,10 @@ Guide the metal loop along the entire wire from start to finish without touching- A failure is reported in `s.status()["episode_end"]` as "wire_touched", "Wand fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/Dockerfileindex dc510f9fc9..6f2cf540a6 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py buzz-wire-3d-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/runtime_binding.jsonindex 3ce3fdb149..1af84ab107 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/Dockerfileindex fdce1f0777..ec12683779 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py buzz-wire-3d-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/runtime_binding.jsonindex 3ce3fdb149..1af84ab107 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/README.md b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/README.mdindex 2a05d95d07..35f3525643 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/README.md+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-buzz-wire-3d-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Guide the metal loop along the entire wire from start to finish without touching| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-buzz-wire-3d-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/docker-compose.yamlindex 6b00c612dc..b02de11b5a 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/runtime_binding.jsonindex 3ce3fdb149..1af84ab107 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/grade.py b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/runtime_binding.jsonindex 3ce3fdb149..1af84ab107 100644--- a/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/README.md b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/README.mdindex cfa80e63a6..355c139d16 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle buzz_wire_3d (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Guide the metal loop along the entire wire from start to finish without touching the wire, then release the tool on the finish support. Frozen scene instance (variation very_easy, seed 0).@@ -63,7 +63,10 @@ Guide the metal loop along the entire wire from start to finish without touching- A failure is reported in `s.status()["episode_end"]` as "wire_touched", "Wand fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/Dockerfileindex 302cbe23eb..ab0cd86322 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py buzz-wire-3d-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/runtime_binding.jsonindex 76bc85812e..123bbb1748 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/Dockerfileindex c582afecae..6c66971ba8 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py buzz-wire-3d-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/runtime_binding.jsonindex 76bc85812e..123bbb1748 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/README.md b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/README.mdindex 55aeb0d3b7..e17334c560 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/README.md+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `buzz_wire_3d` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-buzz-wire-3d-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Guide the metal loop along the entire wire from start to finish without touching| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/buzz-wire-3d-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-buzz-wire-3d-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/buzz-wire-3d-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/docker-compose.yamlindex 98b67bf31f..f19b00a55c 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 76bc85812e..123bbb1748 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/runtime_binding.jsonindex 76bc85812e..123bbb1748 100644--- a/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-buzz-wire-3d-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/README.md b/tasks/robotangle-cast-coil-easier-i00-privileged/README.mdindex d8a3f82e76..cca6e77594 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/README.md+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_coil (ALOHA 2, Genesis): produce one replayable trajectory. Assemble the gold and silver pieces into a cube with flush outer faces, then release both on the table. Frozen scene instance (variation easier, seed 0).@@ -60,7 +60,10 @@ Assemble the gold and silver pieces into a cube with flush outer faces, then rel- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/Dockerfileindex 42b52cb502..35adc29a7c 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-coil-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/runtime_binding.jsonindex e2a1610685..d121b89c96 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/Dockerfileindex f47060c1b8..3da9737abe 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-coil-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/runtime_binding.jsonindex e2a1610685..d121b89c96 100644--- a/tasks/robotangle-cast-coil-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easier-i00-standard/README.md b/tasks/robotangle-cast-coil-easier-i00-standard/README.mdindex f38ca61b6e..721b90fe36 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/README.md+++ b/tasks/robotangle-cast-coil-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-coil-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Assemble the gold and silver pieces into a cube with flush outer faces, then rel| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-easier-i00-standard/environment/docker-compose.yamlindex 50e92eaa38..1c186128b1 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/runtime_binding.jsonindex e2a1610685..d121b89c96 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easier-i00-standard/tests/grade.py b/tasks/robotangle-cast-coil-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-coil-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-coil-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-coil-easier-i00-standard/tests/runtime_binding.jsonindex e2a1610685..d121b89c96 100644--- a/tasks/robotangle-cast-coil-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/README.md b/tasks/robotangle-cast-coil-easy-i00-privileged/README.mdindex c2849a9051..b50e43e01e 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/README.md+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_coil (ALOHA 2, Genesis): produce one replayable trajectory. Assemble the gold and silver Cast Coil pieces into their matching interlocking configuration, then release both. Frozen scene instance (variation cast_coil_easy, seed 0).@@ -60,7 +60,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/Dockerfileindex 54a8e628d7..b761f6ca05 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-coil-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/runtime_binding.jsonindex 38f1ea6756..a9c6cd8e20 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/Dockerfileindex 15a825133b..b3114b5efb 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-coil-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/runtime_binding.jsonindex 38f1ea6756..a9c6cd8e20 100644--- a/tasks/robotangle-cast-coil-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easy-i00-standard/README.md b/tasks/robotangle-cast-coil-easy-i00-standard/README.mdindex ad8d0c9ab3..dfff590e63 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/README.md+++ b/tasks/robotangle-cast-coil-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-coil-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-easy-i00-standard/environment/docker-compose.yamlindex 8a785ae7f0..3500758643 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/runtime_binding.jsonindex 38f1ea6756..a9c6cd8e20 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-easy-i00-standard/tests/grade.py b/tasks/robotangle-cast-coil-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-coil-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-coil-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-coil-easy-i00-standard/tests/runtime_binding.jsonindex 38f1ea6756..a9c6cd8e20 100644--- a/tasks/robotangle-cast-coil-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/README.md b/tasks/robotangle-cast-coil-hard-i00-privileged/README.mdindex 0cf57e824c..15de05e2b6 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/README.md+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_coil (ALOHA 2, Genesis): produce one replayable trajectory. Assemble the gold and silver Cast Coil pieces into their matching interlocking configuration, then release both. Frozen scene instance (variation cast_coil_hard, seed 0).@@ -60,7 +60,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/Dockerfileindex 85368390e5..3961b68672 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-coil-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/runtime_binding.jsonindex e47373eaa5..774fd118ee 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/Dockerfileindex c60c5b7f4a..087c71d2d4 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-coil-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/runtime_binding.jsonindex e47373eaa5..774fd118ee 100644--- a/tasks/robotangle-cast-coil-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-hard-i00-standard/README.md b/tasks/robotangle-cast-coil-hard-i00-standard/README.mdindex 2be9cd34b2..9cd19f110e 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/README.md+++ b/tasks/robotangle-cast-coil-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-coil-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-hard-i00-standard/environment/docker-compose.yamlindex eec5e53ac4..52068de4b3 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/runtime_binding.jsonindex e47373eaa5..774fd118ee 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-coil-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-hard-i00-standard/tests/grade.py b/tasks/robotangle-cast-coil-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-coil-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-coil-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-coil-hard-i00-standard/tests/runtime_binding.jsonindex e47373eaa5..774fd118ee 100644--- a/tasks/robotangle-cast-coil-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/README.md b/tasks/robotangle-cast-coil-medium-i00-privileged/README.mdindex 7fbb195529..57a955e68d 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/README.md+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_coil (ALOHA 2, Genesis): produce one replayable trajectory. Assemble the gold and silver Cast Coil pieces into their matching interlocking configuration, then release both. Frozen scene instance (variation cast_coil_medium, seed 0).@@ -60,7 +60,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/Dockerfileindex 90447690da..2d116e805c 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-coil-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/runtime_binding.jsonindex 2fadba8d27..d7d743cb72 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/Dockerfileindex 9823fc8779..0dd93d8362 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-coil-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/runtime_binding.jsonindex 2fadba8d27..d7d743cb72 100644--- a/tasks/robotangle-cast-coil-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-medium-i00-standard/README.md b/tasks/robotangle-cast-coil-medium-i00-standard/README.mdindex 588bda0dbd..bf27f384dd 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/README.md+++ b/tasks/robotangle-cast-coil-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-coil-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Assemble the gold and silver Cast Coil pieces into their matching interlocking c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-coil-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-medium-i00-standard/environment/docker-compose.yamlindex 408da8112a..bd900a8a9a 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/runtime_binding.jsonindex 2fadba8d27..d7d743cb72 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-coil-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-medium-i00-standard/tests/grade.py b/tasks/robotangle-cast-coil-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-coil-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-coil-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-coil-medium-i00-standard/tests/runtime_binding.jsonindex 2fadba8d27..d7d743cb72 100644--- a/tasks/robotangle-cast-coil-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/README.md b/tasks/robotangle-cast-coil-very-easy-i00-privileged/README.mdindex 0b9870f2a5..93906af02f 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_coil (ALOHA 2, Genesis): produce one replayable trajectory. Assemble the gold and silver pieces into a cube with flush outer faces, then release both on the table. Frozen scene instance (variation very_easy, seed 0).@@ -60,7 +60,10 @@ Assemble the gold and silver pieces into a cube with flush outer faces, then rel- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/Dockerfileindex 4a3ead0709..3ff8f9688a 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-coil-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/runtime_binding.jsonindex c21ea55268..2dc9ed53fb 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/Dockerfileindex 285df2002e..79f065618d 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-coil-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/runtime_binding.jsonindex c21ea55268..2dc9ed53fb 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/README.md b/tasks/robotangle-cast-coil-very-easy-i00-standard/README.mdindex caee0bb02f..1da410866c 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/README.md+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_coil` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-coil-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Assemble the gold and silver pieces into a cube with flush outer faces, then rel| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-coil-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-coil-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-coil-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/docker-compose.yamlindex e99107da9e..67116e87c3 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex c21ea55268..2dc9ed53fb 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/runtime_binding.jsonindex c21ea55268..2dc9ed53fb 100644--- a/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-coil-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/README.md b/tasks/robotangle-cast-keyhole-easier-i00-privileged/README.mdindex 7da171dd64..9b52f0e191 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/README.md+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_keyhole (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire silver keyhole piece inside the green dashed goal region. Keep the gold piece on the puzzle/system side. Frozen scene instance (variation easier, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/Dockerfileindex 1c7bc69cad..c5a30ff525 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-keyhole-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/runtime_binding.jsonindex e8350732df..9042c98e68 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/Dockerfileindex b82cf42337..ed54cdd5a9 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-keyhole-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/runtime_binding.jsonindex e8350732df..9042c98e68 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/README.md b/tasks/robotangle-cast-keyhole-easier-i00-standard/README.mdindex 66aec16e05..ab0319c33c 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/README.md+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-keyhole-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/docker-compose.yamlindex f5153782c3..88773c3e01 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/runtime_binding.jsonindex e8350732df..9042c98e68 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/grade.py b/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/runtime_binding.jsonindex e8350732df..9042c98e68 100644--- a/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/README.md b/tasks/robotangle-cast-keyhole-easy-i00-privileged/README.mdindex 128d4552aa..40ff118e13 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/README.md+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_keyhole (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire silver keyhole piece inside the green dashed goal region. Keep the gold piece on the puzzle/system side. Frozen scene instance (variation cast_keyhole_easy, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/Dockerfileindex 00076d29dc..29af9ae41f 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-keyhole-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/runtime_binding.jsonindex 76a57a2e3a..d5c752514f 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/Dockerfileindex 77be75db92..d43c0af4c8 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-keyhole-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/runtime_binding.jsonindex 76a57a2e3a..d5c752514f 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/README.md b/tasks/robotangle-cast-keyhole-easy-i00-standard/README.mdindex 987651cc41..e3dbbde272 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/README.md+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-keyhole-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/docker-compose.yamlindex 69428ae97b..612b731104 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/runtime_binding.jsonindex 76a57a2e3a..d5c752514f 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/grade.py b/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/runtime_binding.jsonindex 76a57a2e3a..d5c752514f 100644--- a/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/README.md b/tasks/robotangle-cast-keyhole-hard-i00-privileged/README.mdindex 7f7e47c089..14ce3cb63d 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/README.md+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_keyhole (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire silver keyhole piece inside the green dashed goal region. Keep the gold piece on the puzzle/system side. Frozen scene instance (variation cast_keyhole_hard, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/Dockerfileindex 1b42f0f398..24edb1c063 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-keyhole-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/runtime_binding.jsonindex 7bedcc5389..1fb8eab692 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/Dockerfileindex 7187386470..dc6792ca17 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-keyhole-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/runtime_binding.jsonindex 7bedcc5389..1fb8eab692 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/README.md b/tasks/robotangle-cast-keyhole-hard-i00-standard/README.mdindex 4ccf87b129..662877287f 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/README.md+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-keyhole-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/docker-compose.yamlindex 1638ddd410..3b2f893bce 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/runtime_binding.jsonindex 7bedcc5389..1fb8eab692 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/grade.py b/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/runtime_binding.jsonindex 7bedcc5389..1fb8eab692 100644--- a/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/README.md b/tasks/robotangle-cast-keyhole-medium-i00-privileged/README.mdindex 11cae30a45..91b1b98a35 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/README.md+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_keyhole (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire silver keyhole piece inside the green dashed goal region. Keep the gold piece on the puzzle/system side. Frozen scene instance (variation cast_keyhole_medium, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/Dockerfileindex a8bd49b4d3..b165716eee 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-keyhole-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/runtime_binding.jsonindex 470835f8a7..05c2764bbf 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/Dockerfileindex f745087e42..d2ffbc8943 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-keyhole-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/runtime_binding.jsonindex 470835f8a7..05c2764bbf 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/README.md b/tasks/robotangle-cast-keyhole-medium-i00-standard/README.mdindex 12f2ab1cfd..f0318658b5 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/README.md+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-keyhole-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-cast-keyhole-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/docker-compose.yamlindex 7f1223182c..692d8c7674 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/runtime_binding.jsonindex 470835f8a7..05c2764bbf 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/grade.py b/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/runtime_binding.jsonindex 470835f8a7..05c2764bbf 100644--- a/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/README.md b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/README.mdindex 67d44ee807..3571118f3a 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle cast_keyhole (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire silver keyhole piece inside the green dashed goal region. Keep the gold piece on the puzzle/system side. Frozen scene instance (variation very_easy, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/Dockerfileindex aacc50e3dc..a484776f35 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py cast-keyhole-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/runtime_binding.jsonindex 9ed3efe126..56a14bc94e 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/Dockerfileindex fa60897e34..db1e331648 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py cast-keyhole-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/runtime_binding.jsonindex 9ed3efe126..56a14bc94e 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/README.md b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/README.mdindex 4cc0c35685..ed713ad98c 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/README.md+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `cast_keyhole` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-cast-keyhole-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire silver keyhole piece inside the green dashed goal| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/cast-keyhole-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-cast-keyhole-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/cast-keyhole-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/docker-compose.yamlindex 750a73cffe..ffd926d8e6 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 9ed3efe126..56a14bc94e 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/runtime_binding.jsonindex 9ed3efe126..56a14bc94e 100644--- a/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-cast-keyhole-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/README.md b/tasks/robotangle-fiber-bundling-easier-i00-privileged/README.mdindex 5e5011b1dc..1dfc2d384d 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/README.md+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle fiber_bundling (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Manipulate the thick sheath to pass every fine fiber and the front sheath through the fixed copper ring; keep the rear terminal anchored. Frozen scene instance (variation easier, seed 0).@@ -60,7 +60,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug- A failure is reported in `s.status()["episode_end"]` as "fiber_gripper_contact", "Fiber below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/Dockerfileindex f935c8db52..a1f2951350 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py fiber-bundling-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/runtime_binding.jsonindex 4262e5c5fc..7279b88103 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/Dockerfileindex a401ee791a..d48492fa9f 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py fiber-bundling-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/runtime_binding.jsonindex 4262e5c5fc..7279b88103 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/README.md b/tasks/robotangle-fiber-bundling-easier-i00-standard/README.mdindex f62979731d..6c72213503 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/README.md+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-fiber-bundling-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/docker-compose.yamlindex 693e1ff319..48c2b17bb7 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/runtime_binding.jsonindex 4262e5c5fc..7279b88103 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/grade.py b/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/runtime_binding.jsonindex 4262e5c5fc..7279b88103 100644--- a/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/README.md b/tasks/robotangle-fiber-bundling-easy-i00-privileged/README.mdindex e05e9131ba..38a98f1585 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/README.md+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle fiber_bundling (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Manipulate the thick sheath to pass every fine fiber and the front sheath through the fixed copper ring; keep the rear terminal anchored. Frozen scene instance (variation fiber_bundling_easy, seed 0).@@ -60,7 +60,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug- A failure is reported in `s.status()["episode_end"]` as "fiber_gripper_contact", "Fiber below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/Dockerfileindex beaafa2518..dc1411503e 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py fiber-bundling-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/runtime_binding.jsonindex 16fdde5d96..d298ef1e85 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/Dockerfileindex fe0ea7c478..4e657fc5c7 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py fiber-bundling-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/runtime_binding.jsonindex 16fdde5d96..d298ef1e85 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/README.md b/tasks/robotangle-fiber-bundling-easy-i00-standard/README.mdindex 77dbc8c3a0..983010a0cb 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/README.md+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-fiber-bundling-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/docker-compose.yamlindex fd8e4c1136..03fd25734d 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/runtime_binding.jsonindex 16fdde5d96..d298ef1e85 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/grade.py b/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/runtime_binding.jsonindex 16fdde5d96..d298ef1e85 100644--- a/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/README.md b/tasks/robotangle-fiber-bundling-hard-i00-privileged/README.mdindex 601bcae058..4e5b598027 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/README.md+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle fiber_bundling (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Manipulate the thick sheath to pass every fine fiber and the front sheath through the fixed copper ring; keep the rear terminal anchored. Frozen scene instance (variation fiber_bundling_hard, seed 0).@@ -60,7 +60,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug- A failure is reported in `s.status()["episode_end"]` as "fiber_gripper_contact", "Fiber below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/Dockerfileindex 45eaaf4098..1c0ce83345 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py fiber-bundling-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/runtime_binding.jsonindex fac2135f23..c50f8806d2 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/Dockerfileindex 9efbffb190..344c405b56 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py fiber-bundling-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/runtime_binding.jsonindex fac2135f23..c50f8806d2 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/README.md b/tasks/robotangle-fiber-bundling-hard-i00-standard/README.mdindex 3c94ead92e..3c3d5092a3 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/README.md+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-fiber-bundling-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/docker-compose.yamlindex b99c141eee..801239f953 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/runtime_binding.jsonindex fac2135f23..c50f8806d2 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/grade.py b/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/runtime_binding.jsonindex fac2135f23..c50f8806d2 100644--- a/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/README.md b/tasks/robotangle-fiber-bundling-medium-i00-privileged/README.mdindex a80e348e75..70d5b7b786 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/README.md+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle fiber_bundling (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Manipulate the thick sheath to pass every fine fiber and the front sheath through the fixed copper ring; keep the rear terminal anchored. Frozen scene instance (variation fiber_bundling_medium, seed 0).@@ -60,7 +60,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug- A failure is reported in `s.status()["episode_end"]` as "fiber_gripper_contact", "Fiber below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/Dockerfileindex cfb3521c6f..f4903aa5a0 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py fiber-bundling-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/runtime_binding.jsonindex ed6e1ad1f6..ca7fbae628 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/Dockerfileindex 84084a97db..78bea38f1f 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py fiber-bundling-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/runtime_binding.jsonindex ed6e1ad1f6..ca7fbae628 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/README.md b/tasks/robotangle-fiber-bundling-medium-i00-standard/README.mdindex eaac05bc03..c9a5b5b3fd 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/README.md+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-fiber-bundling-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-fiber-bundling-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/docker-compose.yamlindex 9ca244c400..2b65b95382 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/runtime_binding.jsonindex ed6e1ad1f6..ca7fbae628 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/grade.py b/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/runtime_binding.jsonindex ed6e1ad1f6..ca7fbae628 100644--- a/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/README.md b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/README.mdindex 4c45b02896..9375ae1056 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle fiber_bundling (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Manipulate the thick sheath to pass every fine fiber and the front sheath through the fixed copper ring; keep the rear terminal anchored. Frozen scene instance (variation very_easy, seed 0).@@ -60,7 +60,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug- A failure is reported in `s.status()["episode_end"]` as "fiber_gripper_contact", "Fiber below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/Dockerfileindex 6fbff0305e..23eb2f54a1 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py fiber-bundling-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/runtime_binding.jsonindex 7b90626088..47216ce972 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/Dockerfileindex 55a39a1e69..6dd36916d8 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py fiber-bundling-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/runtime_binding.jsonindex 7b90626088..47216ce972 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/README.md b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/README.mdindex f5562cef71..3be90c17c8 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/README.md+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `fiber_bundling` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-fiber-bundling-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Manipulate the thick sheath to pass every fine fiber and the front sheath throug| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/fiber-bundling-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-fiber-bundling-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/fiber-bundling-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/docker-compose.yamlindex c159d287ac..7a66978d60 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 7b90626088..47216ce972 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/runtime_binding.jsonindex 7b90626088..47216ce972 100644--- a/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-fiber-bundling-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/README.md b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/README.mdindex 91c710c2f5..c5a06ba80d 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/README.md+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle hedgehog_in_cage (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Separate and place the whole hedgehog ball, including every spike inside the green dashed goal region. Keep all cage components on the puzzle/system side. Frozen scene instance (variation easier, seed 0).@@ -60,7 +60,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/Dockerfileindex 5e4e76fd67..4e737cfac6 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/runtime_binding.jsonindex e40d0b35d6..ece2c00417 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/Dockerfileindex 99c303df4f..368eb99a4c 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/runtime_binding.jsonindex e40d0b35d6..ece2c00417 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/README.md b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/README.mdindex bc31d7f59c..85a553a665 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/README.md+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-hedgehog-in-cage-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/docker-compose.yamlindex 43f6472699..b402c1192f 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/runtime_binding.jsonindex e40d0b35d6..ece2c00417 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/grade.py b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/runtime_binding.jsonindex e40d0b35d6..ece2c00417 100644--- a/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/README.md b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/README.mdindex cdc2c0da3c..fe39170f86 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/README.md+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle hedgehog_in_cage (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Separate and place the whole hedgehog ball, including every spike inside the green dashed goal region. Keep all cage components on the puzzle/system side. Frozen scene instance (variation hedgehog_in_cage_easy, seed 0).@@ -60,7 +60,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/Dockerfileindex a1220b2621..d6642de464 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/runtime_binding.jsonindex 39c0206b37..f91879e9e4 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/Dockerfileindex 44ffaaacbc..5248875105 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/runtime_binding.jsonindex 39c0206b37..f91879e9e4 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/README.md b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/README.mdindex 31105d3a92..a082a478b1 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/README.md+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-hedgehog-in-cage-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/docker-compose.yamlindex dcfb843cfa..5c037bdc8c 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/runtime_binding.jsonindex 39c0206b37..f91879e9e4 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/grade.py b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/runtime_binding.jsonindex 39c0206b37..f91879e9e4 100644--- a/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/README.md b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/README.mdindex 88509b2ea3..4dce8ed25b 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/README.md+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle hedgehog_in_cage (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Separate and place the whole hedgehog ball, including every spike inside the green dashed goal region. Keep all cage components on the puzzle/system side. Frozen scene instance (variation hedgehog_in_cage_hard, seed 0).@@ -60,7 +60,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/Dockerfileindex eff60df8d8..cb210cf80c 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/runtime_binding.jsonindex d146f486ea..012e5ff5cd 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/Dockerfileindex 4e4caade43..17d599603e 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/runtime_binding.jsonindex d146f486ea..012e5ff5cd 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/README.md b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/README.mdindex 3fb4e37dbe..9779b857d9 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/README.md+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-hedgehog-in-cage-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/docker-compose.yamlindex 3570756ea9..966b8cbfbe 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/runtime_binding.jsonindex d146f486ea..012e5ff5cd 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/grade.py b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/runtime_binding.jsonindex d146f486ea..012e5ff5cd 100644--- a/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/README.md b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/README.mdindex 90bcf3e082..662f42ff21 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/README.md+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle hedgehog_in_cage (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Separate and place the whole hedgehog ball, including every spike inside the green dashed goal region. Keep all cage components on the puzzle/system side. Frozen scene instance (variation hedgehog_in_cage_medium, seed 0).@@ -60,7 +60,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/Dockerfileindex d445285551..30cc0cf0d0 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/runtime_binding.jsonindex 741e14d151..8631096c25 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/Dockerfileindex 5f67799f11..0a9989f6c7 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/runtime_binding.jsonindex 741e14d151..8631096c25 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/README.md b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/README.mdindex bc1ad5cfa1..1371502a35 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/README.md+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-hedgehog-in-cage-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-hedgehog-in-cage-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/docker-compose.yamlindex f5e196fb1d..141753599e 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/runtime_binding.jsonindex 741e14d151..8631096c25 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/grade.py b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/runtime_binding.jsonindex 741e14d151..8631096c25 100644--- a/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/README.md b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/README.mdindex eea4c5fbbd..51f410d046 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle hedgehog_in_cage (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Separate and place the whole hedgehog ball, including every spike inside the green dashed goal region. Keep all cage components on the puzzle/system side. Frozen scene instance (variation very_easy, seed 0).@@ -60,7 +60,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/Dockerfileindex 669bb53b75..a405f153de 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/runtime_binding.jsonindex 3acef4102a..ab5b324d37 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/Dockerfileindex 7f8b9fac2e..5137db45f0 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py hedgehog-in-cage-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/runtime_binding.jsonindex 3acef4102a..ab5b324d37 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/README.md b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/README.mdindex a51442410e..cad66d5ea0 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/README.md+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `hedgehog_in_cage` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-hedgehog-in-cage-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the whole hedgehog ball, including every spike inside the gre| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/hedgehog-in-cage-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `hhbe/cand_hh/tasks/topogym-hedgehog-in-cage-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/hedgehog-in-cage-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/docker-compose.yamlindex df69837682..765dac2c4c 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 3acef4102a..ab5b324d37 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/runtime_binding.jsonindex 3acef4102a..ab5b324d37 100644--- a/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-hedgehog-in-cage-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/README.md b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/README.mdindex 8a97331a44..7c3c2d5cc4 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/README.md+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle horseshoe_ring (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire removable ring inside the green dashed goal region. Keep the horseshoes and chains on the puzzle/system side. Frozen scene instance (variation easier, seed 0).@@ -63,7 +63,10 @@ Separate and place the entire removable ring inside the green dashed goal region- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table", "Physical chain/eye connection lost" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/Dockerfileindex e7a30c784f..ba29600176 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py horseshoe-ring-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/runtime_binding.jsonindex fc936794a2..3212c7d1df 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/Dockerfileindex 13f634929a..6ede85eeca 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py horseshoe-ring-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/runtime_binding.jsonindex fc936794a2..3212c7d1df 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/README.md b/tasks/robotangle-horseshoe-ring-easier-i00-standard/README.mdindex 8ce93f59bb..c0a7c9de6f 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/README.md+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-horseshoe-ring-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Separate and place the entire removable ring inside the green dashed goal region| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/docker-compose.yamlindex 715ca0c781..6a26e16f03 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/runtime_binding.jsonindex fc936794a2..3212c7d1df 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/grade.py b/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/runtime_binding.jsonindex fc936794a2..3212c7d1df 100644--- a/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/README.md b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/README.mdindex 7f7c94b275..8bfaff5f66 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/README.md+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle horseshoe_ring (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire removable ring inside the green dashed goal region. Keep the horseshoes and chains on the puzzle/system side. Frozen scene instance (variation horseshoe_ring_easy, seed 0).@@ -63,7 +63,10 @@ Separate and place the entire removable ring inside the green dashed goal region- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table", "Physical chain/eye connection lost" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/Dockerfileindex c6594e66fb..80611568b6 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py horseshoe-ring-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/runtime_binding.jsonindex 0805c449f6..a9c0943a47 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/Dockerfileindex b0e9e6ce15..4a338a55fe 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py horseshoe-ring-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/runtime_binding.jsonindex 0805c449f6..a9c0943a47 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/README.md b/tasks/robotangle-horseshoe-ring-easy-i00-standard/README.mdindex 0ff84d5437..f7ce07a03f 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/README.md+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-horseshoe-ring-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Separate and place the entire removable ring inside the green dashed goal region| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/docker-compose.yamlindex 4daae4a4e7..b00aa36992 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/runtime_binding.jsonindex 0805c449f6..a9c0943a47 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/grade.py b/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/runtime_binding.jsonindex 0805c449f6..a9c0943a47 100644--- a/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/README.md b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/README.mdindex d16c0893c4..f6b61a9b94 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/README.md+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle horseshoe_ring (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire removable ring inside the green dashed goal region. Keep the horseshoes and chains on the puzzle/system side. Frozen scene instance (variation horseshoe_ring_hard, seed 0).@@ -63,7 +63,10 @@ Separate and place the entire removable ring inside the green dashed goal region- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table", "Physical chain/eye connection lost" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/Dockerfileindex 952c4ed59b..992b2d18e0 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py horseshoe-ring-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/runtime_binding.jsonindex 6307de0e82..414afa56c8 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/Dockerfileindex f64b286299..e546867ef3 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py horseshoe-ring-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/runtime_binding.jsonindex 6307de0e82..414afa56c8 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/README.md b/tasks/robotangle-horseshoe-ring-hard-i00-standard/README.mdindex 3810dc0004..86b03eab59 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/README.md+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-horseshoe-ring-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Separate and place the entire removable ring inside the green dashed goal region| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/docker-compose.yamlindex 2e0bb2407a..6af3f8a731 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/runtime_binding.jsonindex 6307de0e82..414afa56c8 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/grade.py b/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/runtime_binding.jsonindex 6307de0e82..414afa56c8 100644--- a/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/README.md b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/README.mdindex 4d3e6552c0..f9203ff8eb 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/README.md+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle horseshoe_ring (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire removable ring inside the green dashed goal region. Keep the horseshoes and chains on the puzzle/system side. Frozen scene instance (variation horseshoe_ring_medium, seed 0).@@ -63,7 +63,10 @@ Separate and place the entire removable ring inside the green dashed goal region- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table", "Physical chain/eye connection lost" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/Dockerfileindex ed8e4a544d..f6a55f90ac 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py horseshoe-ring-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/runtime_binding.jsonindex a7f14869e8..cf9fc4836f 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/Dockerfileindex af81150686..a119bc10e1 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py horseshoe-ring-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/runtime_binding.jsonindex a7f14869e8..cf9fc4836f 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/README.md b/tasks/robotangle-horseshoe-ring-medium-i00-standard/README.mdindex 2c35f896f2..f0d4b0c99c 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/README.md+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-horseshoe-ring-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Separate and place the entire removable ring inside the green dashed goal region| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-horseshoe-ring-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/docker-compose.yamlindex bf58a4fab8..7adf1bb05a 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/runtime_binding.jsonindex a7f14869e8..cf9fc4836f 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/grade.py b/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/runtime_binding.jsonindex a7f14869e8..cf9fc4836f 100644--- a/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/README.md b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/README.mdindex 6cde909bb2..b66b8cd67d 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle horseshoe_ring (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire removable ring inside the green dashed goal region. Keep the horseshoes and chains on the puzzle/system side. Frozen scene instance (variation very_easy, seed 0).@@ -63,7 +63,10 @@ Separate and place the entire removable ring inside the green dashed goal region- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table", "Physical chain/eye connection lost" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/Dockerfileindex 05e1ac22bd..3054f4effe 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py horseshoe-ring-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/runtime_binding.jsonindex 575363c94e..5313cc7b0f 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/Dockerfileindex 1f5ae14de8..03d50426cc 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py horseshoe-ring-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/runtime_binding.jsonindex 575363c94e..5313cc7b0f 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/README.md b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/README.mdindex 836e352458..f72c848ffd 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/README.md+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `horseshoe_ring` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-horseshoe-ring-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Separate and place the entire removable ring inside the green dashed goal region| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/horseshoe-ring-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `e0ae4ba9` (graded package `hsbe/tree2/runs/test_results/cand_hsbe_v2/candidate/tasks/topogym-horseshoe-ring-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/horseshoe-ring-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/docker-compose.yamlindex a82c33dae3..82748469fd 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 575363c94e..5313cc7b0f 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/runtime_binding.jsonindex 575363c94e..5313cc7b0f 100644--- a/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-horseshoe-ring-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "e0ae4ba903bb072fa1f532bf5aee780a051e8d2c25ebbebb427775a4f660b917","files": 342@@ -28,5 +28,9 @@"reference": "hsbe2/rcb-topogym:0.2.16-dev-cu128","id": "sha256:04fa65dbd8aa0dc16734392c3d735992e53fd8cc589b9e295b679c6c73ed455a","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/README.md b/tasks/robotangle-interlocked-claws-easier-i00-privileged/README.mdindex d6e87fea23..8ce0651581 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/README.md+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle interlocked_claws (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire brown claw piece inside the green dashed goal region. Keep the other claw piece on the puzzle/system side. Frozen scene instance (variation easier, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire brown claw piece inside the green dashed goal regi- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/Dockerfileindex 1698ca0cf5..cb34875fd4 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py interlocked-claws-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/runtime_binding.jsonindex e9edfe4e2a..9b414f4f8c 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/Dockerfileindex 1dc3b6a19c..421d0043bf 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py interlocked-claws-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/runtime_binding.jsonindex e9edfe4e2a..9b414f4f8c 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/README.md b/tasks/robotangle-interlocked-claws-easier-i00-standard/README.mdindex aa36aff589..32067e048f 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/README.md+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-interlocked-claws-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire brown claw piece inside the green dashed goal regi| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/docker-compose.yamlindex 199fab005a..96e29a6982 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/runtime_binding.jsonindex e9edfe4e2a..9b414f4f8c 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/grade.py b/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/runtime_binding.jsonindex e9edfe4e2a..9b414f4f8c 100644--- a/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/README.md b/tasks/robotangle-interlocked-claws-easy-i00-privileged/README.mdindex 3b96871bec..fd15dd8691 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/README.md+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle interlocked_claws (ALOHA 2, Genesis): produce one replayable trajectory. Completely separate the two claw pieces and briefly hold both still. Frozen scene instance (variation interlocked_claws_easy, seed 0).@@ -58,7 +58,10 @@ Completely separate the two claw pieces and briefly hold both still.- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/Dockerfileindex 28dfb9e318..a2f5ac759f 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py interlocked-claws-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/runtime_binding.jsonindex 4a12b7c10d..129ba44105 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/Dockerfileindex fa808ed447..20aeb6a9a8 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py interlocked-claws-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/runtime_binding.jsonindex 4a12b7c10d..129ba44105 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/README.md b/tasks/robotangle-interlocked-claws-easy-i00-standard/README.mdindex 0b7041e622..1bc7dca151 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/README.md+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-interlocked-claws-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -62,7 +62,10 @@ Completely separate the two claw pieces and briefly hold both still.| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/docker-compose.yamlindex 41ef1326f3..959176840f 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/runtime_binding.jsonindex 4a12b7c10d..129ba44105 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/grade.py b/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/runtime_binding.jsonindex 4a12b7c10d..129ba44105 100644--- a/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/README.md b/tasks/robotangle-interlocked-claws-hard-i00-privileged/README.mdindex d694f77fd0..5a49279cf7 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/README.md+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle interlocked_claws (ALOHA 2, Genesis): produce one replayable trajectory. Completely separate the two claw pieces and briefly hold both still. Frozen scene instance (variation interlocked_claws_hard, seed 0).@@ -58,7 +58,10 @@ Completely separate the two claw pieces and briefly hold both still.- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/Dockerfileindex 3aeb02f610..06cb04c48f 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py interlocked-claws-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/runtime_binding.jsonindex 6780789346..6d7323bd65 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/Dockerfileindex e51a48b2a9..cdc66e5a08 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py interlocked-claws-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/runtime_binding.jsonindex 6780789346..6d7323bd65 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/README.md b/tasks/robotangle-interlocked-claws-hard-i00-standard/README.mdindex 82830b0671..e68de7bdab 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/README.md+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-interlocked-claws-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -62,7 +62,10 @@ Completely separate the two claw pieces and briefly hold both still.| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/docker-compose.yamlindex 4e37dd0ca1..3deb759081 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/runtime_binding.jsonindex 6780789346..6d7323bd65 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/grade.py b/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/runtime_binding.jsonindex 6780789346..6d7323bd65 100644--- a/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/README.md b/tasks/robotangle-interlocked-claws-medium-i00-privileged/README.mdindex 4dfef27bac..0f2b509d8b 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/README.md+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle interlocked_claws (ALOHA 2, Genesis): produce one replayable trajectory. Completely separate the two claw pieces and briefly hold both still. Frozen scene instance (variation interlocked_claws_medium, seed 0).@@ -58,7 +58,10 @@ Completely separate the two claw pieces and briefly hold both still.- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/Dockerfileindex bfe2cbf8c7..a60a60abfe 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py interlocked-claws-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/runtime_binding.jsonindex 54076b2e39..ebded24721 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/Dockerfileindex 27fe97fc67..163d7085ae 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py interlocked-claws-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/runtime_binding.jsonindex 54076b2e39..ebded24721 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/README.md b/tasks/robotangle-interlocked-claws-medium-i00-standard/README.mdindex 53e3a8f29f..1569533c8f 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/README.md+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-interlocked-claws-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -62,7 +62,10 @@ Completely separate the two claw pieces and briefly hold both still.| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-interlocked-claws-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/docker-compose.yamlindex c45559e655..bd8758535d 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/runtime_binding.jsonindex 54076b2e39..ebded24721 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/grade.py b/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/runtime_binding.jsonindex 54076b2e39..ebded24721 100644--- a/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/README.md b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/README.mdindex d528c560b4..bde2e1bfb6 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle interlocked_claws (ALOHA 2, Genesis): produce one replayable trajectory. Separate and place the entire brown claw piece inside the green dashed goal region. Keep the other claw piece on the puzzle/system side. Frozen scene instance (variation very_easy, seed 0).@@ -60,7 +60,10 @@ Separate and place the entire brown claw piece inside the green dashed goal regi- A failure is reported in `s.status()["episode_end"]` as "A task body fell below the table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits, and `s.status()["review"]` the deep task contacts that would hold a success for review.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/Dockerfileindex 81a716f5da..052c27eda8 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py interlocked-claws-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/runtime_binding.jsonindex 064858b8b0..aae49848d2 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/Dockerfileindex eb10f7e3a6..e27303fdcd 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py interlocked-claws-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/runtime_binding.jsonindex 064858b8b0..aae49848d2 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/README.md b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/README.mdindex 50be7797c2..ca5a9acdc7 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/README.md+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `interlocked_claws` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-interlocked-claws-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -64,7 +64,10 @@ Separate and place the entire brown claw piece inside the green dashed goal regi| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/interlocked-claws-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-interlocked-claws-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/interlocked-claws-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/docker-compose.yamlindex 830b9a7106..032a652b40 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 064858b8b0..aae49848d2 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/runtime_binding.jsonindex 064858b8b0..aae49848d2 100644--- a/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-interlocked-claws-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/README.md b/tasks/robotangle-knot-untying-easier-i00-privileged/README.mdindex adeba0a44d..21215def13 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/README.md+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle knot_untying (ALOHA 2, Genesis): produce one replayable trajectory. Untie and spread the rope on the tabletop until its top-down projection has no crossings or overlaps, then release it. Frozen scene instance (variation easier, seed 0).@@ -64,7 +64,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `fc5ac3e1` (graded package `obe/cand_jwo/tasks/topogym-knot-untying-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `fc5ac3e1` (graded package `obe/cand_jwo/tasks/topogym-knot-untying-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/Dockerfileindex cd972baf54..3d684b01d7 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py knot-untying-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/runtime_binding.jsonindex 76b076dbd7..16f963892e 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "d7faa513ba6dd2a70590f4bbe277dad99e093723b51c13ada8fe80428509d843","instance_assets/ipc_state/manifest.json": "fb044ec82be0c4b0147c3c951d6bf7e5fa17e70e51c2a03498399f705c8f7c19"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "fc5ac3e19859f231860857f47a2b2bfce1ec3a0876b01b5a91faeb016c02b006","files": 356@@ -51,5 +51,9 @@"reference": "obejw/rcb-topogym:0.2.16-dev-cu128","id": "sha256:32265a72a3d23a9e00fb9e28d8b417b9a07fd5a11cde5bf765120555d59edec6","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/Dockerfileindex d11d667c2f..6ee3b8cb19 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py knot-untying-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/runtime_binding.jsonindex 76b076dbd7..16f963892e 100644--- a/tasks/robotangle-knot-untying-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easier-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "d7faa513ba6dd2a70590f4bbe277dad99e093723b51c13ada8fe80428509d843","instance_assets/ipc_state/manifest.json": "fb044ec82be0c4b0147c3c951d6bf7e5fa17e70e51c2a03498399f705c8f7c19"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "fc5ac3e19859f231860857f47a2b2bfce1ec3a0876b01b5a91faeb016c02b006","files": 356@@ -51,5 +51,9 @@"reference": "obejw/rcb-topogym:0.2.16-dev-cu128","id": "sha256:32265a72a3d23a9e00fb9e28d8b417b9a07fd5a11cde5bf765120555d59edec6","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easier-i00-standard/README.md b/tasks/robotangle-knot-untying-easier-i00-standard/README.mdindex b6c2490fed..0540f61e56 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/README.md+++ b/tasks/robotangle-knot-untying-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-knot-untying-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -65,7 +65,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `fc5ac3e1` (graded package `obe/cand_jwo/tasks/topogym-knot-untying-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `fc5ac3e1` (graded package `obe/cand_jwo/tasks/topogym-knot-untying-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-easier-i00-standard/environment/docker-compose.yamlindex 69e5363c26..7579f61672 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/runtime_binding.jsonindex 76b076dbd7..16f963892e 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easier-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "d7faa513ba6dd2a70590f4bbe277dad99e093723b51c13ada8fe80428509d843","instance_assets/ipc_state/manifest.json": "fb044ec82be0c4b0147c3c951d6bf7e5fa17e70e51c2a03498399f705c8f7c19"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "fc5ac3e19859f231860857f47a2b2bfce1ec3a0876b01b5a91faeb016c02b006","files": 356@@ -51,5 +51,9 @@"reference": "obejw/rcb-topogym:0.2.16-dev-cu128","id": "sha256:32265a72a3d23a9e00fb9e28d8b417b9a07fd5a11cde5bf765120555d59edec6","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easier-i00-standard/tests/grade.py b/tasks/robotangle-knot-untying-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-knot-untying-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-knot-untying-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-knot-untying-easier-i00-standard/tests/runtime_binding.jsonindex 76b076dbd7..16f963892e 100644--- a/tasks/robotangle-knot-untying-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easier-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "d7faa513ba6dd2a70590f4bbe277dad99e093723b51c13ada8fe80428509d843","instance_assets/ipc_state/manifest.json": "fb044ec82be0c4b0147c3c951d6bf7e5fa17e70e51c2a03498399f705c8f7c19"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "fc5ac3e19859f231860857f47a2b2bfce1ec3a0876b01b5a91faeb016c02b006","files": 356@@ -51,5 +51,9 @@"reference": "obejw/rcb-topogym:0.2.16-dev-cu128","id": "sha256:32265a72a3d23a9e00fb9e28d8b417b9a07fd5a11cde5bf765120555d59edec6","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/README.md b/tasks/robotangle-knot-untying-easy-i00-privileged/README.mdindex 828edacef0..7e6a62bc52 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/README.md+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle knot_untying (ALOHA 2, Genesis): produce one replayable trajectory. Untie and spread the rope on the tabletop until its top-down projection has no crossings or overlaps, then release it. Frozen scene instance (variation knot_untying_easy, seed 0).@@ -64,7 +64,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/Dockerfileindex 794a380ebe..b32a9f2cba 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py knot-untying-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/runtime_binding.jsonindex 76363593b1..19e7d4493a 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "2f5630adf1e1c713cb821f0024fa5254d4d872ae07d98ad728aa03535fb330ce","instance_assets/ipc_state/manifest.json": "60f9fdc3a0174c4b753d0aefdbb9f8a7b247a69cc69c88cb4d08cf7d7e63cae8"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/Dockerfileindex ad510325c0..fe803ff71f 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py knot-untying-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/runtime_binding.jsonindex 76363593b1..19e7d4493a 100644--- a/tasks/robotangle-knot-untying-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easy-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "2f5630adf1e1c713cb821f0024fa5254d4d872ae07d98ad728aa03535fb330ce","instance_assets/ipc_state/manifest.json": "60f9fdc3a0174c4b753d0aefdbb9f8a7b247a69cc69c88cb4d08cf7d7e63cae8"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easy-i00-standard/README.md b/tasks/robotangle-knot-untying-easy-i00-standard/README.mdindex f3456bbe95..10585d80e2 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/README.md+++ b/tasks/robotangle-knot-untying-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-knot-untying-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -65,7 +65,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-easy-i00-standard/environment/docker-compose.yamlindex 48424818df..b4b37aa98e 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/runtime_binding.jsonindex 76363593b1..19e7d4493a 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easy-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "2f5630adf1e1c713cb821f0024fa5254d4d872ae07d98ad728aa03535fb330ce","instance_assets/ipc_state/manifest.json": "60f9fdc3a0174c4b753d0aefdbb9f8a7b247a69cc69c88cb4d08cf7d7e63cae8"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-easy-i00-standard/tests/grade.py b/tasks/robotangle-knot-untying-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-knot-untying-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-knot-untying-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-knot-untying-easy-i00-standard/tests/runtime_binding.jsonindex 76363593b1..19e7d4493a 100644--- a/tasks/robotangle-knot-untying-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-easy-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "2f5630adf1e1c713cb821f0024fa5254d4d872ae07d98ad728aa03535fb330ce","instance_assets/ipc_state/manifest.json": "60f9fdc3a0174c4b753d0aefdbb9f8a7b247a69cc69c88cb4d08cf7d7e63cae8"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/README.md b/tasks/robotangle-knot-untying-hard-i00-privileged/README.mdindex 182880fb56..6695e8cdc4 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/README.md+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle knot_untying (ALOHA 2, Genesis): produce one replayable trajectory. Untie and spread the rope on the tabletop until its top-down projection has no crossings or overlaps, then release it. Frozen scene instance (variation knot_untying_hard, seed 0).@@ -64,7 +64,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/Dockerfileindex f8d05abcf3..8b9fab293d 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py knot-untying-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/runtime_binding.jsonindex 2fa48d8b2a..668294da0a 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "41863f1ceeec7da60af4362b611bfadb441d9039fc7ee3eea70734d80f4d3594","instance_assets/ipc_state/manifest.json": "9f8dc27b090be46357bc3cae15da510c07a3a8d66190163eb546fcc9f4acc14d"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/Dockerfileindex 9f10f3d01c..0f52721eef 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py knot-untying-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/runtime_binding.jsonindex 2fa48d8b2a..668294da0a 100644--- a/tasks/robotangle-knot-untying-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-hard-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "41863f1ceeec7da60af4362b611bfadb441d9039fc7ee3eea70734d80f4d3594","instance_assets/ipc_state/manifest.json": "9f8dc27b090be46357bc3cae15da510c07a3a8d66190163eb546fcc9f4acc14d"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-hard-i00-standard/README.md b/tasks/robotangle-knot-untying-hard-i00-standard/README.mdindex e23ab0dafd..0b301e7be5 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/README.md+++ b/tasks/robotangle-knot-untying-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-knot-untying-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -65,7 +65,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-hard-i00-standard/environment/docker-compose.yamlindex 614a4a3755..0a73498012 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/runtime_binding.jsonindex 2fa48d8b2a..668294da0a 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-knot-untying-hard-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "41863f1ceeec7da60af4362b611bfadb441d9039fc7ee3eea70734d80f4d3594","instance_assets/ipc_state/manifest.json": "9f8dc27b090be46357bc3cae15da510c07a3a8d66190163eb546fcc9f4acc14d"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-hard-i00-standard/tests/grade.py b/tasks/robotangle-knot-untying-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-knot-untying-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-knot-untying-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-knot-untying-hard-i00-standard/tests/runtime_binding.jsonindex 2fa48d8b2a..668294da0a 100644--- a/tasks/robotangle-knot-untying-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-hard-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "41863f1ceeec7da60af4362b611bfadb441d9039fc7ee3eea70734d80f4d3594","instance_assets/ipc_state/manifest.json": "9f8dc27b090be46357bc3cae15da510c07a3a8d66190163eb546fcc9f4acc14d"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/README.md b/tasks/robotangle-knot-untying-medium-i00-privileged/README.mdindex 39cee44596..2cbc9887ae 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/README.md+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle knot_untying (ALOHA 2, Genesis): produce one replayable trajectory. Untie and spread the rope on the tabletop until its top-down projection has no crossings or overlaps, then release it. Frozen scene instance (variation knot_untying_medium, seed 0).@@ -64,7 +64,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/Dockerfileindex 70ade58749..67267d1f2b 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py knot-untying-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/runtime_binding.jsonindex fd3cedeffe..b701a56293 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "8fe10920b720871841c40fa0c46d3dfc307b6cc811389fc6ceab0fbf16d4a9f9","instance_assets/ipc_state/manifest.json": "f4f48fe3ad301b51fb300cfe11939c676b36c71723349c9dda5cd25476a9e17b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/Dockerfileindex af25d3e9b8..4d4ff6ee4b 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py knot-untying-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/runtime_binding.jsonindex fd3cedeffe..b701a56293 100644--- a/tasks/robotangle-knot-untying-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-medium-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "8fe10920b720871841c40fa0c46d3dfc307b6cc811389fc6ceab0fbf16d4a9f9","instance_assets/ipc_state/manifest.json": "f4f48fe3ad301b51fb300cfe11939c676b36c71723349c9dda5cd25476a9e17b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-medium-i00-standard/README.md b/tasks/robotangle-knot-untying-medium-i00-standard/README.mdindex 34cc3f5a86..f669c4ca56 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/README.md+++ b/tasks/robotangle-knot-untying-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-knot-untying-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -65,7 +65,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-knot-untying-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-medium-i00-standard/environment/docker-compose.yamlindex b05801d937..1375afe758 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/runtime_binding.jsonindex fd3cedeffe..b701a56293 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-knot-untying-medium-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "8fe10920b720871841c40fa0c46d3dfc307b6cc811389fc6ceab0fbf16d4a9f9","instance_assets/ipc_state/manifest.json": "f4f48fe3ad301b51fb300cfe11939c676b36c71723349c9dda5cd25476a9e17b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-medium-i00-standard/tests/grade.py b/tasks/robotangle-knot-untying-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-knot-untying-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-knot-untying-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-knot-untying-medium-i00-standard/tests/runtime_binding.jsonindex fd3cedeffe..b701a56293 100644--- a/tasks/robotangle-knot-untying-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-medium-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "8fe10920b720871841c40fa0c46d3dfc307b6cc811389fc6ceab0fbf16d4a9f9","instance_assets/ipc_state/manifest.json": "f4f48fe3ad301b51fb300cfe11939c676b36c71723349c9dda5cd25476a9e17b"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/README.md b/tasks/robotangle-knot-untying-very-easy-i00-privileged/README.mdindex 7faa676624..f25fcd51a7 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle knot_untying (ALOHA 2, Genesis): produce one replayable trajectory. Untie and spread the rope on the tabletop until its top-down projection has no crossings or overlaps, then release it. Frozen scene instance (variation very_easy, seed 0).@@ -64,7 +64,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-knot-untying-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-knot-untying-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/Dockerfileindex 1d4889d5a3..618fb7c30b 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py knot-untying-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/runtime_binding.jsonindex e1b22e0a15..6cd1a1c11b 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "85955d924bb95fed01c6ad7c2da3ade509e1d8a67296393ea6dfb8fb6029f498","instance_assets/ipc_state/manifest.json": "c6080ea740fe4afc7447211a2b10d82b133f98a758155ebfb0b2f73d9134f9d3"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/Dockerfileindex d624cc089e..1956e9a6bf 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py knot-untying-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/runtime_binding.jsonindex e1b22e0a15..6cd1a1c11b 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-very-easy-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "85955d924bb95fed01c6ad7c2da3ade509e1d8a67296393ea6dfb8fb6029f498","instance_assets/ipc_state/manifest.json": "c6080ea740fe4afc7447211a2b10d82b133f98a758155ebfb0b2f73d9134f9d3"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/README.md b/tasks/robotangle-knot-untying-very-easy-i00-standard/README.mdindex 800e9a5556..afe4f6ed99 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/README.md+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `knot_untying` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-knot-untying-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -65,7 +65,10 @@ Untie and spread the rope on the tabletop until its top-down projection has no c| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-knot-untying-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/knot-untying-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-knot-untying-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/knot-untying-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/docker-compose.yamlindex 0ae150129e..2d285fb9ee 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex e1b22e0a15..6cd1a1c11b 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "85955d924bb95fed01c6ad7c2da3ade509e1d8a67296393ea6dfb8fb6029f498","instance_assets/ipc_state/manifest.json": "c6080ea740fe4afc7447211a2b10d82b133f98a758155ebfb0b2f73d9134f9d3"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/runtime_binding.jsonindex e1b22e0a15..6cd1a1c11b 100644--- a/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-knot-untying-very-easy-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.300": "85955d924bb95fed01c6ad7c2da3ade509e1d8a67296393ea6dfb8fb6029f498","instance_assets/ipc_state/manifest.json": "c6080ea740fe4afc7447211a2b10d82b133f98a758155ebfb0b2f73d9134f9d3"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/README.md b/tasks/robotangle-lock-picking-easier-i00-privileged/README.mdindex 539afd48cb..88a6be3a28 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/README.md+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle lock_picking (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Pick up the two-tab key from its rest. Insert the tabbed key through all two rotor plates and the final END plate, while respecting their slots and stops. Align the first rotor's slot with the second rotor's slot to allow insertion. Frozen scene instance (variation easier, seed 0).@@ -66,7 +66,10 @@ Pick up the two-tab key from its rest. Insert the tabbed key through all two rot- A failure is reported in `s.status()["episode_end"]` as "rotor_limit_exceeded", "Key fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/Dockerfile b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/Dockerfileindex fb67f00636..671c238205 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py lock-picking-easier-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/runtime_binding.jsonindex b8d849c032..cab2cc0232 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/Dockerfile b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/Dockerfileindex 03ea3576b9..071cdb561e 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py lock-picking-easier-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/runtime_binding.jsonindex b8d849c032..cab2cc0232 100644--- a/tasks/robotangle-lock-picking-easier-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easier-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easier-i00-standard/README.md b/tasks/robotangle-lock-picking-easier-i00-standard/README.mdindex f5cec470b7..b1c43d0ce6 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/README.md+++ b/tasks/robotangle-lock-picking-easier-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-lock-picking-easier-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Pick up the two-tab key from its rest. Insert the tabbed key through all two rot| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-easier-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-easier-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-easier-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-easier-i00-standard/environment/docker-compose.yamlindex 0a13e11ac1..c22d1c0039 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easier-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/runtime_binding.jsonindex b8d849c032..cab2cc0232 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easier-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easier-i00-standard/tests/grade.py b/tasks/robotangle-lock-picking-easier-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/tests/grade.py+++ b/tasks/robotangle-lock-picking-easier-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-lock-picking-easier-i00-standard/tests/runtime_binding.json b/tasks/robotangle-lock-picking-easier-i00-standard/tests/runtime_binding.jsonindex b8d849c032..cab2cc0232 100644--- a/tasks/robotangle-lock-picking-easier-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easier-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/README.md b/tasks/robotangle-lock-picking-easy-i00-privileged/README.mdindex 9d4539549e..99443c482a 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/README.md+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle lock_picking (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Insert the tabbed key through all three rotor plates and the final END plate, while respecting their slots and stops. Frozen scene instance (variation lock_picking_easy, seed 0).@@ -66,7 +66,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh- A failure is reported in `s.status()["episode_end"]` as "rotor_limit_exceeded", "Key fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/Dockerfileindex 8e8617850a..7777cbd9ef 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py lock-picking-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/runtime_binding.jsonindex c024386309..cd8504bedd 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/Dockerfileindex 7293ff418d..6d4443be87 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py lock-picking-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/runtime_binding.jsonindex c024386309..cd8504bedd 100644--- a/tasks/robotangle-lock-picking-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easy-i00-standard/README.md b/tasks/robotangle-lock-picking-easy-i00-standard/README.mdindex 0136ad5450..1093a3e7b8 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/README.md+++ b/tasks/robotangle-lock-picking-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-lock-picking-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-easy-i00-standard/environment/docker-compose.yamlindex 005b5e90e7..6ef1fe516e 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/runtime_binding.jsonindex c024386309..cd8504bedd 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-easy-i00-standard/tests/grade.py b/tasks/robotangle-lock-picking-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-lock-picking-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-lock-picking-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-lock-picking-easy-i00-standard/tests/runtime_binding.jsonindex c024386309..cd8504bedd 100644--- a/tasks/robotangle-lock-picking-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/README.md b/tasks/robotangle-lock-picking-hard-i00-privileged/README.mdindex 893f72f19d..4f78206fe2 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/README.md+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle lock_picking (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Insert the tabbed key through all three rotor plates and the final END plate, while respecting their slots and stops. Frozen scene instance (variation lock_picking_hard, seed 0).@@ -66,7 +66,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh- A failure is reported in `s.status()["episode_end"]` as "rotor_limit_exceeded", "Key fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/Dockerfileindex 5b05925b8a..2c4904099e 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py lock-picking-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/runtime_binding.jsonindex 4947a2a789..e23d32687d 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/Dockerfileindex 39ee79f523..4e9390a013 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py lock-picking-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/runtime_binding.jsonindex 4947a2a789..e23d32687d 100644--- a/tasks/robotangle-lock-picking-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-hard-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-hard-i00-standard/README.md b/tasks/robotangle-lock-picking-hard-i00-standard/README.mdindex 6fcaf0e421..8b9ebbc1e9 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/README.md+++ b/tasks/robotangle-lock-picking-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-lock-picking-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-hard-i00-standard/environment/docker-compose.yamlindex 8ada4af3e2..9dfc2197df 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/runtime_binding.jsonindex 4947a2a789..e23d32687d 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-lock-picking-hard-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-hard-i00-standard/tests/grade.py b/tasks/robotangle-lock-picking-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-lock-picking-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-lock-picking-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-lock-picking-hard-i00-standard/tests/runtime_binding.jsonindex 4947a2a789..e23d32687d 100644--- a/tasks/robotangle-lock-picking-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-hard-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/README.md b/tasks/robotangle-lock-picking-medium-i00-privileged/README.mdindex e77b5f96c0..fc51e45d00 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/README.md+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle lock_picking (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Insert the tabbed key through all three rotor plates and the final END plate, while respecting their slots and stops. Frozen scene instance (variation lock_picking_medium, seed 0).@@ -66,7 +66,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh- A failure is reported in `s.status()["episode_end"]` as "rotor_limit_exceeded", "Key fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/Dockerfileindex 5f1ef3150e..d0830fe333 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py lock-picking-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/runtime_binding.jsonindex ab7ff93b2d..4e21d38ee8 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/Dockerfileindex 687a00ce88..b941b14cb8 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py lock-picking-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/runtime_binding.jsonindex ab7ff93b2d..4e21d38ee8 100644--- a/tasks/robotangle-lock-picking-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-medium-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-medium-i00-standard/README.md b/tasks/robotangle-lock-picking-medium-i00-standard/README.mdindex dcc8e58845..b05daae6a8 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/README.md+++ b/tasks/robotangle-lock-picking-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-lock-picking-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Insert the tabbed key through all three rotor plates and the final END plate, wh| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-lock-picking-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-medium-i00-standard/environment/docker-compose.yamlindex c67b1994d6..e5d4452766 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/runtime_binding.jsonindex ab7ff93b2d..4e21d38ee8 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-lock-picking-medium-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-medium-i00-standard/tests/grade.py b/tasks/robotangle-lock-picking-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-lock-picking-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-lock-picking-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-lock-picking-medium-i00-standard/tests/runtime_binding.jsonindex ab7ff93b2d..4e21d38ee8 100644--- a/tasks/robotangle-lock-picking-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-medium-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/README.md b/tasks/robotangle-lock-picking-very-easy-i00-privileged/README.mdindex fd8c1a3156..3ab498b280 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/README.md+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle lock_picking (Franka Panda + Robotiq 2F-85, Genesis): produce one replayable trajectory. Pick up the two-tab key from its rest. Insert the tabbed key through all two rotor plates and the final END plate, while respecting their slots and stops. Both rotor slots start aligned for straight insertion. Frozen scene instance (variation very_easy, seed 0).@@ -66,7 +66,10 @@ Pick up the two-tab key from its rest. Insert the tabbed key through all two rot- A failure is reported in `s.status()["episode_end"]` as "rotor_limit_exceeded", "Key fell below table" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/Dockerfileindex a63b9b8fc5..ff2312c9a8 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py lock-picking-very-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/runtime_binding.jsonindex 7fe1f07a3b..fa9c936353 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/environment/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/Dockerfileindex 2c3fe88b25..6871716cfd 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py lock-picking-very-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/runtime_binding.jsonindex 7fe1f07a3b..fa9c936353 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-very-easy-i00-privileged/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/README.md b/tasks/robotangle-lock-picking-very-easy-i00-standard/README.mdindex 7a7b51052e..9de1cf1b9e 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/README.md+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `lock_picking` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-lock-picking-very-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -67,7 +67,10 @@ Pick up the two-tab key from its rest. Insert the tabbed key through all two rot| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/lock-picking-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_be/cand_be/tasks/topogym-lock-picking-very-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/lock-picking-very-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/docker-compose.yamlindex 174dc7f380..a05ebc7867 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/runtime_binding.jsonindex 7fe1f07a3b..fa9c936353 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/environment/sim/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/grade.py b/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/runtime_binding.jsonindex 7fe1f07a3b..fa9c936353 100644--- a/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-lock-picking-very-easy-i00-standard/tests/runtime_binding.json@@ -4,7 +4,7 @@"asset_files": {"instance_assets/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -28,5 +28,9 @@"reference": "labv18be/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/README.md b/tasks/robotangle-rope-threading-easy-i00-privileged/README.mdindex 65303570e2..4827742dd5 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/README.md+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle rope_threading (ALOHA 2, Genesis): produce one replayable trajectory. Thread the rope through the cyan ring (R1) then green ring (R2), in that order along the rope from material start to material end. Frozen scene instance (variation rope_threading_easy, seed 0).@@ -65,7 +65,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2), in that order a- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/Dockerfile b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/Dockerfileindex 06641fc129..3aa3af927f 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py rope-threading-easy-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/runtime_binding.jsonindex 07f27b71f5..c7913cdfcd 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "74b575837697d29a187349c7fc1a2d5bcc7b7f1c1d65671ad67907b7f0612ed3","instance_assets/ipc_state/manifest.json": "55616843f3a0c0909392386bf2b41217d28006a70d50ba24e9633c25cd2e4604"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/Dockerfile b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/Dockerfileindex 33581888bb..5c7be07f01 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py rope-threading-easy-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/runtime_binding.jsonindex 07f27b71f5..c7913cdfcd 100644--- a/tasks/robotangle-rope-threading-easy-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-easy-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "74b575837697d29a187349c7fc1a2d5bcc7b7f1c1d65671ad67907b7f0612ed3","instance_assets/ipc_state/manifest.json": "55616843f3a0c0909392386bf2b41217d28006a70d50ba24e9633c25cd2e4604"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-easy-i00-standard/README.md b/tasks/robotangle-rope-threading-easy-i00-standard/README.mdindex e6e8175afb..856fb7e7ed 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/README.md+++ b/tasks/robotangle-rope-threading-easy-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-rope-threading-easy-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -66,7 +66,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2), in that order a| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-easy-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-easy-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-easy-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-easy-i00-standard/environment/docker-compose.yamlindex ae4e9aa7f1..1d05d3d914 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-easy-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/runtime_binding.jsonindex 07f27b71f5..c7913cdfcd 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-rope-threading-easy-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "74b575837697d29a187349c7fc1a2d5bcc7b7f1c1d65671ad67907b7f0612ed3","instance_assets/ipc_state/manifest.json": "55616843f3a0c0909392386bf2b41217d28006a70d50ba24e9633c25cd2e4604"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-easy-i00-standard/tests/grade.py b/tasks/robotangle-rope-threading-easy-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/tests/grade.py+++ b/tasks/robotangle-rope-threading-easy-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-rope-threading-easy-i00-standard/tests/runtime_binding.json b/tasks/robotangle-rope-threading-easy-i00-standard/tests/runtime_binding.jsonindex 07f27b71f5..c7913cdfcd 100644--- a/tasks/robotangle-rope-threading-easy-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-easy-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "74b575837697d29a187349c7fc1a2d5bcc7b7f1c1d65671ad67907b7f0612ed3","instance_assets/ipc_state/manifest.json": "55616843f3a0c0909392386bf2b41217d28006a70d50ba24e9633c25cd2e4604"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/README.md b/tasks/robotangle-rope-threading-hard-i00-privileged/README.mdindex 79caf5daba..79f4e999f5 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/README.md+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle rope_threading (ALOHA 2, Genesis): produce one replayable trajectory. Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring (R3), in that order along the rope from material start to material end. Frozen scene instance (variation rope_threading_hard, seed 0).@@ -65,7 +65,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/Dockerfile b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/Dockerfileindex d30f0fe33e..ad8f56b40a 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py rope-threading-hard-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/runtime_binding.jsonindex 8dbe08f03c..3907d30c29 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "3a13c3fa98e240c962f7777aa244a22bf271ce871b9af7d645392802261f4a76","instance_assets/ipc_state/manifest.json": "ee59c0caded15cec0791fd89f52143cf1849e0a1b54ea9da1706a0d5c26d41db"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/Dockerfile b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/Dockerfileindex 405d95d710..33a084a3e1 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py rope-threading-hard-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/runtime_binding.jsonindex 8dbe08f03c..3907d30c29 100644--- a/tasks/robotangle-rope-threading-hard-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-hard-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "3a13c3fa98e240c962f7777aa244a22bf271ce871b9af7d645392802261f4a76","instance_assets/ipc_state/manifest.json": "ee59c0caded15cec0791fd89f52143cf1849e0a1b54ea9da1706a0d5c26d41db"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-hard-i00-standard/README.md b/tasks/robotangle-rope-threading-hard-i00-standard/README.mdindex cb04c96e8a..2b6b36d05a 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/README.md+++ b/tasks/robotangle-rope-threading-hard-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-rope-threading-hard-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -66,7 +66,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-hard-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-hard-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-hard-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-hard-i00-standard/environment/docker-compose.yamlindex 7056310cec..8a1eb35bd8 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-hard-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/runtime_binding.jsonindex 8dbe08f03c..3907d30c29 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-rope-threading-hard-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "3a13c3fa98e240c962f7777aa244a22bf271ce871b9af7d645392802261f4a76","instance_assets/ipc_state/manifest.json": "ee59c0caded15cec0791fd89f52143cf1849e0a1b54ea9da1706a0d5c26d41db"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-hard-i00-standard/tests/grade.py b/tasks/robotangle-rope-threading-hard-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/tests/grade.py+++ b/tasks/robotangle-rope-threading-hard-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-rope-threading-hard-i00-standard/tests/runtime_binding.json b/tasks/robotangle-rope-threading-hard-i00-standard/tests/runtime_binding.jsonindex 8dbe08f03c..3907d30c29 100644--- a/tasks/robotangle-rope-threading-hard-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-hard-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "3a13c3fa98e240c962f7777aa244a22bf271ce871b9af7d645392802261f4a76","instance_assets/ipc_state/manifest.json": "ee59c0caded15cec0791fd89f52143cf1849e0a1b54ea9da1706a0d5c26d41db"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/README.md b/tasks/robotangle-rope-threading-medium-i00-privileged/README.mdindex c21d294fdb..99db725c59 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/README.md+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskRoboTangle rope_threading (ALOHA 2, Genesis): produce one replayable trajectory. Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring (R3), in that order along the rope from material start to material end. Frozen scene instance (variation rope_threading_medium, seed 0).@@ -65,7 +65,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring- A failure is reported in `s.status()["episode_end"]` as "rope_volume_invalid: <what>" or "forced_breakdown: <what>" (<what>: the readable reason); `s.safety()` reports forcing, contact depths, volume ratios and table-guard stops against these limits.### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The graders are unchanged. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/Dockerfile b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/Dockerfileindex b74e1f9988..d195087617 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/Dockerfile+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/Dockerfile@@ -1,5 +1,5 @@# Base image = TopoGym's simulator (see images/topogym/). Everything task-specific is copied here.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /app/runtime_binding.jsonRUN python /opt/robotangle/stage_instance.py rope-threading-medium-i00 /app --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsonCOPY rcb_topogym.py /opt/tools/rcb_topogym.pydiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/docker-compose.yamlindex 0c0ea7650d..c0ea229907 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/docker-compose.yaml@@ -1,10 +1,11 @@# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx. Harbor's local docker sandbox rejects# [environment].gpus, but merging this onto the main service passes the device through.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/rcb_topogym.py b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/runtime_binding.json b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/runtime_binding.jsonindex b3aa9121e7..798bb158d1 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/environment/runtime_binding.json+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/environment/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "b2871a6229ae9bc809f0f3b72e36ea9bd92a44eb7d55bd5be29bed0de079e633","instance_assets/ipc_state/manifest.json": "cfebb2c9d7505477c915026b977e5920d45885819a6ea1de24c713dc9b6cbf20"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/Dockerfile b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/Dockerfileindex 86ada35824..a598368275 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/Dockerfile+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/Dockerfile@@ -2,7 +2,7 @@# tooling and the frozen instance baked in. Nothing the agent did in its container reaches this one — Harbor# uploads only the declared artifacts (/app/output/), so a patched success check or a swapped interpreter in# the agent container cannot influence the verdict.-FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+FROM ghcr.io/mll-lab-nu/eai-robotangle:0.2.21COPY runtime_binding.json /tests/runtime_binding.jsonCOPY grade.py rcb_topogym.py test.sh /tests/RUN python /opt/robotangle/stage_instance.py rope-threading-medium-i00 /tests --purge # the frozen instance, from the image (scripts/robotangle/assets.json), checked against runtime_binding.jsondiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/docker-compose.yaml b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/docker-compose.yamlindex 9f60f375d1..c69c42ba7a 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/docker-compose.yaml@@ -1,9 +1,10 @@# The verifier replays in the simulator, which needs the GPU (CUDA physics, Nyx camera images for the replay video).-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.services:main:- runtime: nvidiashm_size: "2gb"environment:NVIDIA_DRIVER_CAPABILITIES: alldiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/rcb_topogym.py b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/runtime_binding.json b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/runtime_binding.jsonindex b3aa9121e7..798bb158d1 100644--- a/tasks/robotangle-rope-threading-medium-i00-privileged/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-medium-i00-privileged/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "b2871a6229ae9bc809f0f3b72e36ea9bd92a44eb7d55bd5be29bed0de079e633","instance_assets/ipc_state/manifest.json": "cfebb2c9d7505477c915026b977e5920d45885819a6ea1de24c713dc9b6cbf20"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-medium-i00-standard/README.md b/tasks/robotangle-rope-threading-medium-i00-standard/README.mdindex 31f2cbf719..346734adfb 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/README.md+++ b/tasks/robotangle-rope-threading-medium-i00-standard/README.md@@ -9,7 +9,7 @@| Family / instance | `rope_threading` / seed 0 || Oracle | `full` || Agent time budget | 21600 s; tokens: protocol default (PROTOCOL §5) |-| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` |+| Base image | `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` |## TaskStandard-mode twin of `robotangle-rope-threading-medium-i00-privileged` (same frozen instance): the agent gets only the `eai-standard/2.4` client@@ -66,7 +66,10 @@ Thread the rope through the cyan ring (R1) then green ring (R2) then purple ring| crash recovery | `eai-standard/2.4` §13: journal + per-call checkpoints, `restart: on-failure:6`, resume class `approx` |### Provenance-- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `587043f1`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).-- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `7f7f95dd3719`, under `instances/rope-threading-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.-- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.19` (BUILD_ONLY, images/robotangle/).+- Frozen instance: built by TopoGym source `5b5677f0` (graded package `align_v18/cand_v18b/tasks/topogym-rope-threading-medium-i00-privileged` on the lab host); bound to this release's runtime (source `ecb43962`, tooling `075ec08a`). An exact-restore preflight on this build is pending (docs/benchmarks/robotangle.md, Pending).+- Frozen instance files (`instance.json`, `instance_assets/`): not in this directory. They are in the private HF dataset `eai-v2-internal/robotangle-assets` at `08eb48360ce6`, under `instances/rope-threading-medium-i00/` (scripts/robotangle/assets.json pins each file's sha256). The image carries them, and `/opt/robotangle/stage_instance.py` copies this task's instance next to its `runtime_binding.json`, which names the instance's canonical sha256 and every asset's sha256. The tooling checks them again at every session start.+- Release: dev/jianwen `2dafa5f2b` (task templates `2dafa5f2b`), image `ghcr.io/mll-lab-nu/eai-robotangle:0.2.21` (images/robotangle/).- Name: RoboTangle is the published name of TopoGym (2026-10-07). Code identifiers keep the old name: the simulator package `topogym`, the tooling `rcb_topogym.py`, `TOPOGYM_*` variables.++### Change Log+- 2026-10-08: base image 0.2.19 -> 0.2.21, now public. The simulator, the frozen instances and the audited libuipc wheel are unchanged: on compute capability 8.9 and 12.x (e.g. RTX 4090, L40S, RTX PRO 6000) the physics runs the same libuipc code as before. New: the NVIDIA Vulkan ICD and EGL vendor files, and a second libuipc build of the audited recipe for compute capability 8.6 (RTX A6000 class), which the tooling selects at Session start on every other GPU, so knot_untying and rope_threading run there too. The runtime binding names both builds, and the tooling hash changes with the selection. The compose files reserve one GPU without `runtime: nvidia`, which with the image's NVIDIA_VISIBLE_DEVICES=all could expose every GPU (Nyx needs exactly one). The standard grader counts a fresh replay that crashed without writing its verdict (e.g. CUDA out of memory) as a grader error; it counted as instance_mismatch. The scene, frozen instance and pass rule are unchanged, so the task keeps its name.diff --git a/tasks/robotangle-rope-threading-medium-i00-standard/environment/docker-compose.yaml b/tasks/robotangle-rope-threading-medium-i00-standard/environment/docker-compose.yamlindex 970250441f..73a63f9c65 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/environment/docker-compose.yaml+++ b/tasks/robotangle-rope-threading-medium-i00-standard/environment/docker-compose.yaml@@ -1,8 +1,10 @@# Standard mode: the simulator runs in the `sim` sidecar (agent cannot open it); the agent only reaches port 8000.# No `expose`/`ports` on sim: under Harbor's egress control it shares main's network namespace (localhost:8000).# TopoGym runs its physics on the GPU (CUDA) and renders camera images with Nyx: the GPU goes to the sidecar.-# Nyx renders through Vulkan, so the container needs the NVIDIA graphics libraries as well as compute: `runtime: nvidia`-# with NVIDIA_DRIVER_CAPABILITIES=all (`capabilities: [gpu]` alone injects compute only).+# Nyx renders through Vulkan: the device reservation below passes exactly one GPU (Nyx needs exactly one), and+# NVIDIA_DRIVER_CAPABILITIES=all makes the container toolkit mount the driver's graphics libraries, which the image's+# Vulkan ICD and EGL vendor files name (images/robotangle/Dockerfile). No `runtime: nvidia`: with the image's+# NVIDIA_VISIBLE_DEVICES=all it can expose every GPU of the host.# Crash recovery (docs/rcb/STANDARD_MODE_2_2.md §13): run.sh exits non-zero when the service crashes, compose restarts the# container (same container, same /data) and the service replays its journal into the same episode, never a reset.# Grading (environment/sim/finalize.sh): one fresh-process replay on this GPU after the service has exited.@@ -10,7 +12,7 @@ services:main:depends_on: [sim]sim:- image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.19+ image: ghcr.io/mll-lab-nu/eai-robotangle:0.2.21volumes:- ./sim:/srv:roworking_dir: /tmp@@ -28,7 +30,6 @@ services:PYTHONPATH: /srv:/opt/topogymRCB_SESSION_LOG: "" # the sidecar's own Session must not write the agent-side interaction logNVIDIA_DRIVER_CAPABILITIES: all- runtime: nvidiashm_size: "2gb"deploy:resources:diff --git a/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/rcb_topogym.py b/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/rcb_topogym.pyindex 54f62558e7..21ce20bfc9 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/rcb_topogym.py+++ b/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/rcb_topogym.py@@ -2734,6 +2734,140 @@ def strict_goal(statuses) -> tuple[int, int] | None:return None+# --------------------------------------------------------------------------- libuipc build per GPU+# The image holds two builds of one libuipc recipe (pyuipc 0.0.25+topogym.det1.cuda128: libuipc 292c98c3 plus the+# determinism patches, nvcc 12.8; images/robotangle/Dockerfile). Both have the same version and source commit, which the+# frozen IPC settled states hold, so either restores them. They differ only in their uipc-build.json, whose sha256 names+# the build (scripts/robotangle/release.json and every runtime binding: uipc_builds):+# audited the wheel of every evidence run, in site-packages (/opt/uipc-build.json): SASS sm_89 and sm_120, PTX compute_120;+# sm86 its own prefix /opt/uipc_sm86: SASS sm_86 (runs on 8.6 and 8.7), PTX compute_86 (JIT-compiled on 9.x and 10.x).+# The rule: compute capability 8.9 or 12.x loads the audited wheel, any other GPU the sm86 build, no visible GPU the audited+# wheel (no libuipc scene runs there). A Session applies it before anything imports uipc and refuses a choice that+# contradicts it; installed_runtime() and the session's runtime_binding name the build in use.+UIPC_BUILDS = {"audited": None, "sm86": "/opt/uipc_sm86"} # build -> its prefix (site-packages/, uipc-build.json); None: site-packages+DEFAULT_UIPC_BUILD = "/opt/uipc-build.json"+_GPU_CAPABILITIES: list | None = None+_UIPC_BUILD: dict | None = None+++def gpu_capabilities() -> list[tuple[int, int]]:+ """Compute capabilities of the CUDA devices this process sees (CUDA_VISIBLE_DEVICES applies), from the CUDA driver API+ through ctypes: no context, no torch. Empty without a driver or a visible device."""+ global _GPU_CAPABILITIES+ if _GPU_CAPABILITIES is None:+ import ctypes+ caps = []+ try:+ cuda = ctypes.CDLL("libcuda.so.1")+ except OSError:+ cuda = None+ count = ctypes.c_int(0)+ if cuda is not None and cuda.cuInit(0) == 0 and cuda.cuDeviceGetCount(ctypes.byref(count)) == 0:+ for index in range(count.value):+ device, major, minor = ctypes.c_int(), ctypes.c_int(), ctypes.c_int()+ if (cuda.cuDeviceGet(ctypes.byref(device), index) != 0+ or cuda.cuDeviceGetAttribute(ctypes.byref(major), 75, device) != 0 # ..._COMPUTE_CAPABILITY_MAJOR+ or cuda.cuDeviceGetAttribute(ctypes.byref(minor), 76, device) != 0): # ..._COMPUTE_CAPABILITY_MINOR+ raise RuntimeError(f"CUDA driver error while reading the compute capability of device {index}")+ caps.append((major.value, minor.value))+ _GPU_CAPABILITIES = caps+ return list(_GPU_CAPABILITIES)+++def uipc_build_for(capabilities) -> str:+ """The rule (above): the libuipc build for the visible GPUs. Mixed compute capabilities are refused: a process loads+ one build, and a RoboTangle container sees exactly one GPU (Nyx needs one)."""+ caps = sorted({tuple(c) for c in capabilities})+ if len(caps) > 1:+ raise RuntimeError("The visible GPUs have different compute capabilities ("+ + ", ".join(f"{a}.{b}" for a, b in caps) + "): a process loads one libuipc build. Give the "+ "container exactly one GPU, as RoboTangle needs, or GPUs of one model.")+ if not caps:+ return "audited"+ major, minor = caps[0]+ return "audited" if (major, minor) == (8, 9) or major == 12 else "sm86"+++def _sha256_file(path) -> str | None:+ path = Path(path)+ return hashlib.sha256(path.read_bytes()).hexdigest() if path.is_file() else None+++def select_uipc_build(capability: tuple[int, int] | None = None) -> dict:+ """Choose this process's libuipc build by the rule, once and before uipc is imported: the sm86 prefix goes first on+ sys.path when the rule picks it. `capability` stands in for the GPU's (tests); a Session refuses a choice that+ contradicts the visible GPU (uipc_build_in_use). Returns the build in use: its name, the compute capability it was+ chosen for, its uipc-build.json and that file's sha256, and the uipc package Python imports."""+ global _UIPC_BUILD+ if _UIPC_BUILD is not None:+ return _UIPC_BUILD+ import importlib+ import importlib.util+ caps = [tuple(capability)] if capability is not None else gpu_capabilities()+ name = uipc_build_for(caps)+ prefix = UIPC_BUILDS[name]+ record = Path(prefix, "uipc-build.json") if prefix else Path(DEFAULT_UIPC_BUILD)+ site = Path(prefix, "site-packages") if prefix else None+ if site is not None:+ loaded = sys.modules.get("uipc")+ if loaded is not None and not Path(loaded.__file__).resolve().is_relative_to(site):+ raise InstanceMismatch(f"uipc was imported from {loaded.__file__} before the Session chose the {name} build ({site})")+ if not record.is_file():+ raise InstanceMismatch(f"this image has no {name} libuipc build ({record})")+ if str(site) not in sys.path:+ sys.path.insert(0, str(site))+ importlib.invalidate_caches()+ spec = importlib.util.find_spec("uipc")+ module = Path(spec.origin).resolve() if spec is not None and spec.origin else None+ others = [Path(p, "site-packages") for n, p in UIPC_BUILDS.items() if p and n != name]+ if module is not None and ((site is not None and not module.is_relative_to(site))+ or any(module.is_relative_to(o) for o in others)):+ raise InstanceMismatch(f"uipc resolves to {module}, not to the {name} libuipc build")+ _UIPC_BUILD = dict(build=name, capability=list(caps[0]) if caps else None, uipc_build=str(record),+ uipc_build_sha256=_sha256_file(record), module=str(module) if module else None)+ return _UIPC_BUILD+++def uipc_build_in_use() -> dict:+ """select_uipc_build(), refused when it contradicts the rule for the visible GPU (a forced choice)."""+ chosen = select_uipc_build()+ rule = uipc_build_for(gpu_capabilities())+ if chosen["build"] != rule:+ raise InstanceMismatch(f"libuipc build {chosen['build']} (chosen for compute capability {chosen['capability']}) "+ f"contradicts the rule for the visible GPU ({gpu_capabilities() or 'none'}: {rule})")+ return chosen+++def installed_runtime(root=None) -> dict:+ """topogym.simulator.frozen_binding.installed_runtime() for an image with two libuipc builds: uipc_builds = the builds+ the rule chooses from (name -> its uipc-build.json sha256, None if absent), uipc_build_sha256 = the one this process+ uses (select_uipc_build)."""+ from topogym.simulator.frozen_binding import installed_runtime as image_runtime+ runtime = image_runtime(root)+ runtime["uipc_builds"] = {name: _sha256_file(Path(prefix, "uipc-build.json") if prefix else DEFAULT_UIPC_BUILD)+ for name, prefix in UIPC_BUILDS.items()}+ runtime["uipc_build_sha256"] = select_uipc_build()["uipc_build_sha256"]+ return runtime+++def check_runtime(lock: dict) -> dict:+ """frozen_binding.check_runtime() for an image with two libuipc builds. The binding's runtime names the default+ (audited) build and lock["uipc_builds"] both allowed ones: the image must hold exactly those, and this process must use+ the one the rule chooses for the visible GPU."""+ from topogym.simulator.frozen_binding import BindingMismatch, validate_lock+ validate_lock(lock)+ builds = lock.get("uipc_builds")+ if (not isinstance(builds, dict) or set(builds) != set(UIPC_BUILDS)+ or builds["audited"] != lock["runtime"].get("uipc_build_sha256")):+ raise BindingMismatch(f"Runtime binding lacks the libuipc builds {sorted(UIPC_BUILDS)} (uipc_builds; audited = runtime's)")+ chosen = uipc_build_in_use()+ expected = dict(lock["runtime"], uipc_builds=builds, uipc_build_sha256=builds[chosen["build"]])+ actual = installed_runtime()+ if actual != expected:+ raise BindingMismatch("Actual installed source/dependencies/libuipc builds differ from the bound runtime")+ return actual++class Session:def __init__(self, task: str, instance: str | Path | None = None, *, eval_index: int | None = None,variation_id: str | None = None, seed: int | None = None, task_parameters: dict | None = None,@@ -2745,6 +2879,7 @@ class Session:raise ValueError("TopoGym sessions follow the GPU-backend rule; the physics device comes from the instance")self.task, self.spec = task, dict(TASKS[task])self.runtime_binding = None+ self.uipc_build = uipc_build_in_use() # the libuipc build, by the rule, before anything imports uipcinst = Noneif instance is not None:if gripper_space is not None:@@ -2756,14 +2891,14 @@ class Session:raise ValueError(f"instance task {inst.get('task')} != session task {task}")lock_path = Path(instance).resolve().parent / "runtime_binding.json"if lock_path.is_file():- from topogym.simulator.frozen_binding import check_inputs, check_runtime, binding_id+ from topogym.simulator.frozen_binding import check_inputs, binding_idtry:lock = json.loads(lock_path.read_text())check_inputs(instance, __file__, lock)- runtime = check_runtime(lock)+ runtime = check_runtime(lock) # this tooling's: both libuipc builds and the one in useexcept (OSError, ValueError, KeyError) as exc:raise InstanceMismatch(f"Frozen runtime binding failed: {exc}") from exc- self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime,+ self.runtime_binding = dict(binding_id=binding_id(lock), runtime=runtime, uipc_build=self.uipc_build,creation_source=lock["creation_source"], image=lock["image"])eval_index = inst["eval_index"]cfg = dict(inst["simulator"]) # the frozen configuration: the task directory's own copy@@ -3845,8 +3980,7 @@ def cmd_describe(a) -> None:"""What the task generator writes into instruction.md / README.md: cameras, robot, kinematics, the success predicate'ssource, the table height; one JSON line."""import inspect- from topogym.simulator.frozen_binding import installed_runtime- runtime_identity = installed_runtime()+ runtime_identity = installed_runtime() # this tooling's: both libuipc builds and the one in uses = Session(a.task, instance=a.instance)t = s.env._taskfrom topogym.tasks.goal_description import TASK_IDS, describe_goaldiff --git a/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/runtime_binding.json b/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/runtime_binding.jsonindex b3aa9121e7..798bb158d1 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/runtime_binding.json+++ b/tasks/robotangle-rope-threading-medium-i00-standard/environment/sim/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "b2871a6229ae9bc809f0f3b72e36ea9bd92a44eb7d55bd5be29bed0de079e633","instance_assets/ipc_state/manifest.json": "cfebb2c9d7505477c915026b977e5920d45885819a6ea1de24c713dc9b6cbf20"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}diff --git a/tasks/robotangle-rope-threading-medium-i00-standard/tests/grade.py b/tasks/robotangle-rope-threading-medium-i00-standard/tests/grade.pyindex ab2047a498..c4e4e52aa1 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/tests/grade.py+++ b/tasks/robotangle-rope-threading-medium-i00-standard/tests/grade.py@@ -53,7 +53,10 @@ try:(row.get("runtime_binding") or {}).get("binding_id") == wanted for row in (startup, replay))except (OSError, ValueError, TypeError):pass-mismatch = mismatch or not binding_ok+# A real mismatch is recorded in replay.verdict.json (replay.py). A replay process that crashed (e.g. CUDA out of memory)+# writes none: that is a grader error (finalize.sh), not instance_mismatch.+verdict = os.path.isfile("/data/replay.verdict.json")+mismatch = mismatch or (verdict and not binding_ok)grader_error = not infra and not mismatch and not d.get("gave_up") and not replayed# the live (strict) success first: a tolerant replay success never stands in for a live failureok = bool(d.get("success")) and bool(d.get("replay_success")) and (bool(d.get("deterministic")) or gpu) and not infra and not grader_error and not mismatchdiff --git a/tasks/robotangle-rope-threading-medium-i00-standard/tests/runtime_binding.json b/tasks/robotangle-rope-threading-medium-i00-standard/tests/runtime_binding.jsonindex b3aa9121e7..798bb158d1 100644--- a/tasks/robotangle-rope-threading-medium-i00-standard/tests/runtime_binding.json+++ b/tasks/robotangle-rope-threading-medium-i00-standard/tests/runtime_binding.json@@ -27,7 +27,7 @@"instance_assets/ipc_state/dump/dump/cuda/global_geometry/global_vertex_manager.cu/prev_positions.0": "b2871a6229ae9bc809f0f3b72e36ea9bd92a44eb7d55bd5be29bed0de079e633","instance_assets/ipc_state/manifest.json": "cfebb2c9d7505477c915026b977e5920d45885819a6ea1de24c713dc9b6cbf20"},- "tooling_sha256": "587043f1c651281849b3d737fc4cb8fb90cda8c5f8e4b30f294440faa6bc0cb7",+ "tooling_sha256": "075ec08a0b0a39de216a681cc1cb17d91a3058a7ddefe8b105ce7d4988a1c073","creation_source": {"sha256": "5b5677f0c66edb787caf601342124018fa79a3b5d6f6520de039efb9e33d2b6d","files": 342@@ -51,5 +51,9 @@"reference": "labv18b/rcb-topogym:0.2.16-dev-cu128","id": "sha256:01c128542994e47afda1f27ca5b55543bad136e67cedf5886df367ca6563b062","repo_digests": []+ },+ "uipc_builds": {+ "audited": "39781d192a00d0cdc784f76e9ef2aa6fa404da510cf813ff06a04ea33b2597c1",+ "sm86": "712470d2166b40058a4b6f304fb4a041bffc45c71ab37c7dec2d33d1a0b34011"}}