[mujoco] Add native MetaWorld environments#396
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d6bd9987f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return task; | ||
| } | ||
| } | ||
| return kMetaWorldTasks[0]; |
There was a problem hiding this comment.
Reject unknown MetaWorld task names
GetTaskDef silently falls back to kMetaWorldTasks[0] when a task name is not found, which runs assembly-v3 instead of failing fast. A typo in task_name (or a future registration mismatch) will therefore execute the wrong environment while still reporting the requested ID, producing incorrect benchmark results that are hard to detect. This should raise an error/assert on unknown names instead of defaulting.
Useful? React with 👍 / 👎.
05350c5 to
1501bc4
Compare
1501bc4 to
d5bac0d
Compare
| import envpool.minigrid.registration # noqa: F401 | ||
| import envpool.mujoco.dmc.registration # noqa: F401 | ||
| import envpool.mujoco.gym.registration # noqa: F401 | ||
| import envpool.mujoco.metaworld.registration # noqa: F401 |
90fa332 to
a38d806
Compare
a38d806 to
78d2f19
Compare
Description
This adds a native C++ EnvPool implementation for the Farama MetaWorld v3 Sawyer manipulation benchmark, pinned to the official
Farama-Foundation/Metaworldv3.0.0source archive. The new family registers everyALL_V3_ENVIRONMENTStask under theMetaWorld/prefix, keepsMeta-World/aliases, wires the MetaWorld MuJoCo XML assets throughthird_party/metaworld_assets, and documents the supported task IDs and public space contract.Key review points:
envpool/mujoco/metaworld/metaworld_env.hcontains the native task/state/reward implementation and all per-task variants.envpool/mujoco/metaworld/tasks.hcentralizes the generated task metadata for all 50 v3 environments.envpool/mujoco/metaworld/metaworld_align_test.pyreset-syncs once against the official MetaWorld oracle, then compares step-level observations, rewards, terminal flags, truncation flags, and exposed info for every task.envpool/mujoco/metaworld/metaworld_render_test.pycovers reset and multi-step native rendering across the registered task set.docs/env/metaworld.rstadds the new family documentation and render sample.Validation run:
make ruff py-formatmake mypymake cpplintmake clang-formatmake buildifiergit diff --checkbazel test --config=debug --test_output=errors //envpool/mujoco:metaworld_test //envpool/mujoco:metaworld_align_test //envpool/mujoco:metaworld_render_testmake docstylemake bazel-test BAZEL_TEST_TARGETS=//envpool:make_testMotivation and Context
MetaWorld is a common MuJoCo manipulation benchmark, but EnvPool did not have a native runtime implementation for it. This ports the full v3 task family without a Python runtime bridge, so users can run the benchmark through EnvPool's standard C++ backend, vectorized API, registry, docs, and packaging flow.
Types of changes
What types of changes does your code introduce? Put an
xin all the boxes that apply:Implemented Tasks
Checklist
Go over all the following points, and put an
xin all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!
make format(required)make lint(required)make bazel-testpass. (required)