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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@ keep both in sync.
2. Run the `get_started` tutorials on MuJoCo and at least one other backend (`--headless`) and the
parity scripts; record pass/skip/xfail counts and parity numbers in the release notes.
3. Open a `chore(release): vX.Y.Z` PR that
- bumps `[project] version` in `pyproject.toml`,
- renames `## [Unreleased]` in `CHANGELOG.md` to `## [X.Y.Z] - YYYY-MM-DD` and adds a fresh
empty `## [Unreleased]`,
- bumps `[project] version` in both `pyproject.toml` files (and the `roboverse-metasim` pin at the root),
- renames `## [Unreleased]` in `CHANGELOG.md` **and** `packages/metasim/CHANGELOG.md` to
`## [X.Y.Z] - YYYY-MM-DD` and adds a fresh empty `## [Unreleased]`
(`python tools/release/changelog_check.py --version X.Y.Z --require-empty-unreleased` is what the tag path runs),
- confirms the benchmark is what it was scored on: `tools/release/lock.sh --check`,
`python tools/assets/freeze_suite_manifest.py --suite tabletop-mujoco --check`, and no change to
`roboverse_pack/suites/instances/` unless the release deliberately re-freezes a set (every row then stops being
comparable with the new ones; say so in the changelog).
4. Merge it, then tag the squash commit: `git tag -a vX.Y.Z -m "RoboVerse vX.Y.Z" && git push origin vX.Y.Z`.
5. `release.yml` runs on the tag: it verifies the tag equals the `pyproject.toml` version, builds
the sdist and wheel, checks them with `twine`, creates the GitHub Release with the matching
`CHANGELOG.md` section as body, and (when the `pypi` environment is configured, §5) publishes
to PyPI through trusted publishing.
5. `release.yml` runs on the tag: it verifies the tag equals the `pyproject.toml` version and the changelog
guard, builds both sdists and wheels, checks them with `twine` and `tools/release/wheel_check.py` (the instance
sets, manifests and NOTICE files are inside), publishes the evaluation image, creates the GitHub Release with
the two changelog sections as body, and (when the `pypi` environment is configured and `PYPI_PUBLISH` is set,
§5) publishes to PyPI through trusted publishing.
6. Announce in Discussions / Discord with the changelog link and the MetaSim version it pairs with.

Patch releases: branch `release/vX.Y` from the tag, cherry-pick fixes, repeat steps 3-5 with
Expand Down
9 changes: 5 additions & 4 deletions docs/source/dataset_benchmark/benchmark/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ the sidecar `.json` next to each set names the source file and every skipped ins
revision (`tools/assets/freeze_suite_manifest.py --suite <name>`); `bench suite run` pins downloads to it and
refuses a run on other bytes unless `--allow-unpinned-assets`. Re-freezing an instance set changes the
instance-pool hash, so earlier rows stop being comparable with new ones.
In `tabletop-mujoco` the demo budget tightens push_cube (216 steps), pull_cube (237) and
lift_peg_upright (534). pick_cube and stack_cube keep their 250-step time-out, because their recorded
demos run that long even when the task is solved by about step 120. Every task in the suite has a
prompt bank with 8 training and 4 held-out paraphrases.
In `tabletop-mujoco` the demo budget (3x the 75th-percentile reference-demo length of the instance set, clipped
to the task's own time-out) tightens push_cube (216 steps), pull_cube (237) and lift_peg_upright (738; its set
is scripted demos, longer than the published ones). pick_cube and stack_cube keep their 250-step time-out,
because their reference demos run that long even when the task is solved by about step 120. Every task in the
suite has a prompt bank with 8 training and 4 held-out paraphrases.

## Information-access tiers

Expand Down
4 changes: 4 additions & 0 deletions packages/metasim/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- A relative path whose first segment is an installed package (`roboverse_pack/suites/instances/...`) resolves next to that package when the working directory lacks it (`metasim.utils.hf_util.shipped_path`, used by the asset, directory and demo-file resolvers), and is never fetched from the Hub: a wheel installed anywhere scores a suite on its shipped instance sets.
- The wheel ships a `NOTICE` (Apache-2.0 §4(d)) naming the Isaac Lab and HandsOn code it includes, next to `LICENSE.isaaclab` and `LICENSE.handson`; `tools/release/wheel_check.py` requires it.
- `submission_problems` also refuses a result whose `notes.instance_pool_hash` is not the hash recorded in the suite instance set's sidecar (`metasim.bench.instance_set_hash`; the episodes did not run on the set), a result with `num_envs != 1` (a suite's official protocol), and an access profile that borrows a preset's name but differs from it.
- `SuiteTask.demos`: the instance set a suite scores a task on, a repository-relative demo file that `bench suite run` applies in both execution modes and records as `notes.demos`; `submission_problems` refuses a result scored on anything else (or on a `--demos` override the suite does not define). `metasim.utils.demo_util` reads and writes `.json.gz` trajectory files (gzip JSON: readable, no pickle), the format the repository's instance sets use.

### Fixed
- Importing MetaSim no longer prints torch's `torch.jit.script` FutureWarning on every `python -m metasim` start (torch >= 2.15): the decorators in `metasim.utils.math` are gone and the functions run as plain Python with the same results.

## [1.0.0] - 2026-11-30

### Added
Expand Down
29 changes: 29 additions & 0 deletions packages/metasim/metasim/test/test_bench_suites_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,3 +1145,32 @@ def test_submission_gate_checks_the_set_hash_the_batch_size_and_preset_tiers(tmp
assert not any("differs from that preset" in p for p in submission_problems(result, pinned))
result.protocol["access"] = {**visual, "observation": "privileged"} # a "visual" tier that sees everything
assert any("named 'visual' but differs from that preset" in p for p in submission_problems(result, pinned))


def test_files_shipped_inside_an_installed_package_resolve_from_any_directory(tmp_path, monkeypatch):
"""A `roboverse_pack/...` path is found next to the installed package when the working directory lacks it."""

from metasim.utils import hf_util
from metasim.utils.demo_util.demo_util import _resolve_traj_file
from metasim.utils.trajectory import _resolve_dir, resolve_demo_file

site = tmp_path / "site"
pkg = site / "fake_content_pack" / "suites" / "instances" / "s" / "t"
pkg.mkdir(parents=True)
(site / "fake_content_pack" / "__init__.py").write_text("")
(pkg / "bot_v2.json.gz").write_bytes(b"\x1f\x8b")
monkeypatch.syspath_prepend(str(site))
(tmp_path / "elsewhere").mkdir()
monkeypatch.chdir(tmp_path / "elsewhere")
rel = "fake_content_pack/suites/instances/s/t/bot_v2.json.gz"
assert hf_util.shipped_path(rel) == str(pkg / "bot_v2.json.gz")
assert hf_util.shipped_path("fake_content_pack/suites/instances/s/t") == str(pkg)
assert hf_util.shipped_path("roboverse_data/robots/x.xml") is None, "the Hub store is not a package"
assert hf_util.shipped_path("no_such_package/x") is None and hf_util.shipped_path("/abs/path") is None
configured, found = resolve_demo_file(rel, [])
assert configured == rel and found == pkg / "bot_v2.json.gz", "the configured string stays repository-relative"
assert _resolve_dir("fake_content_pack/suites/instances/s/t") == pkg
assert _resolve_traj_file("fake_content_pack/suites/instances/s/t", "bot") == str(pkg / "bot_v2.json.gz")
# the Hub is never asked for a shipped file
monkeypatch.setattr(hf_util, "_find_data_repo", lambda *a, **k: pytest.fail("the Hub was asked for a shipped file"))
hf_util.check_and_download_single(rel)
22 changes: 22 additions & 0 deletions packages/metasim/metasim/test/test_cli_entry_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,3 +555,25 @@ def test_command_line_is_the_invocation_main_parsed(monkeypatch, capsys):
monkeypatch.setattr(registry, "list_tasks", lambda: [])
assert cli.main(["bench", "list", "--filter", "a b"]) == 0
assert cli._command_line() == "python -m metasim bench list --filter 'a b'"


def test_importing_the_bench_raises_no_deprecation_warning():
"""`python -m metasim ...` must not greet a newcomer with a FutureWarning (torch.jit.script did, on every start)."""
import subprocess
import sys

done = subprocess.run(
[
sys.executable,
"-W",
"error::FutureWarning",
"-W",
"error::DeprecationWarning:metasim",
"-c",
"import metasim.bench, metasim.__main__",
],
check=False,
capture_output=True,
text=True,
)
assert done.returncode == 0, done.stderr[-2000:]
6 changes: 6 additions & 0 deletions packages/metasim/metasim/utils/demo_util/demo_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def _resolve_traj_file(traj_filepath: str, robot_name: str | None) -> str:
extensions only, so a sidecar named after the robot (``franka.json`` config, ``franka.npz``
episode) cannot shadow the trajectory.
"""
if not os.path.exists(traj_filepath):
from metasim.utils.hf_util import shipped_path

shipped = shipped_path(traj_filepath) # a file inside an installed package (a suite's instance set)
if shipped:
traj_filepath = shipped
if not os.path.isdir(traj_filepath):
return traj_filepath
if robot_name is None:
Expand Down
36 changes: 35 additions & 1 deletion packages/metasim/metasim/utils/hf_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,41 @@ def _download_tree(relpath_posix: str) -> bool:
return False


def shipped_path(value: str) -> str | None:
"""Where a path that names a file inside an installed package lives on this machine, or None.

Content packs ship files with their code: the benchmark instance sets are
``roboverse_pack/suites/instances/<suite>/<task>/<robot>_v2.json.gz``, written relative to the repository
root. A checkout run from its root finds them in the working directory; a wheel installed elsewhere does
not, so a relative path whose first segment is an importable package (and is not ``roboverse_data``, the
Hub store) is also looked up next to that package's installed location (every location of a namespace
package). Such a path is never fetched from the Hub.
"""
if not value or os.path.isabs(value):
return None
parts = value.replace(os.sep, "/").split("/")
if len(parts) < 2 or parts[0] in ("roboverse_data", ".", "..") or not parts[0].isidentifier():
return None
try:
import importlib.util

spec = importlib.util.find_spec(parts[0])
except (ImportError, ValueError):
return None
if spec is None:
return None
for location in list(spec.submodule_search_locations or []):
candidate = os.path.join(os.path.dirname(location), *parts)
if os.path.exists(candidate):
return candidate
return None


def check_and_download_single(filepath: str):
"""Check if the file exists in the local directory, and download it from the huggingface dataset if it doesn't exist.

A path without a file suffix is taken to be a folder (a demo directory) and its files are fetched.
A path without a file suffix is taken to be a folder (a demo directory) and its files are fetched. A path that
names a file shipped inside an installed package (:func:`shipped_path`) is never fetched.

Args:
filepath: the filepath to check and download.
Expand All @@ -356,6 +387,9 @@ def check_and_download_single(filepath: str):
log.warning("Received None filepath, skipping download check.")
return
local_exists = os.path.exists(filepath)
if not local_exists and shipped_path(filepath):
log.debug(f"File {filepath} ships with the installed package ({shipped_path(filepath)}).")
return
if local_exists:
## In this case, the runner has the file in their local machine.
log.debug(f"File {filepath} found in local directory.")
Expand Down
Loading
Loading