Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sail-sg/envpool
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: sail-sg/envpool
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.2
Choose a head ref
  • 5 commits
  • 85 files changed
  • 1 contributor

Commits on Apr 15, 2026

  1. Configuration menu
    Copy the full SHA
    d83aeb8 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2026

  1. [mujoco] Add native MyoSuite EnvPool integration (#400)

    ## Description
    
    Adds a native C++ EnvPool integration for the pinned MyoSuite v2.11.6
    surface under the MuJoCo family. The runtime loads generated upstream
    metadata and assets from `third_party/myosuite/` and registers the full
    official ID set plus EnvPool aliases without importing the official
    Python package at runtime.
    
    Key review points:
    - Native runtime entrypoint and task implementation live in
    `envpool/mujoco/myosuite/`.
    - Upstream source, SimHive asset wiring, generated registry metadata,
    pinned oracle requirements, and the MuJoCo 3.6 MjSpec compatibility
    patch live under `third_party/myosuite/`.
    - Official MyoSuite is used only by tests and doc-generation tooling as
    a pinned oracle.
    - Nine upstream IDs that fail official oracle instantiation in this
    pinned NumPy 2 test environment are excluded only from oracle tests;
    they remain registered and covered by EnvPool registry/determinism
    tests.
    - Documentation includes the MyoSuite environment page and the generated
    EnvPool-vs-official render comparison image.
    
    ## Motivation and Context
    
    MyoSuite exposes a large MuJoCo task surface that was not available
    through EnvPool. This adds a packaged native implementation so users can
    create MyoBase/Reorient, Walk/Terrain, MyoChallenge, and MyoDM-style
    registered IDs through EnvPool without a Python runtime bridge.
    
    - [ ] I have raised an issue to propose this change
    ([required](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    for new features and bug fixes)
    
    ## Types of changes
    
    What types of changes does your code introduce? Put an `x` in all the
    boxes that apply:
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [x] New feature (non-breaking change which adds core functionality)
    - [x] New environment (non-breaking change which adds 3rd-party
    environment)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [x] Documentation (update in the documentation)
    - [ ] Example (update in the folder of example)
    
    ## Implemented Tasks
    
    - [x] Register the full pinned MyoSuite ID surface and EnvPool aliases.
    - [x] Add native MuJoCo-backed MyoSuite runtime, metadata/assets, tests,
    and docs.
    - [x] Add oracle, determinism, registry, render, docs, and release-wheel
    validation coverage.
    
    ## Checklist
    
    Go over all the following points, and put an `x` in all the boxes that
    apply.
    If you are unsure about any of these, don't hesitate to ask. We are here
    to help!
    
    - [x] I have read the
    [CONTRIBUTION](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    guide (**required**)
    - [x] My change requires a change to the documentation.
    - [x] I have updated the tests accordingly (*required for a bug fix or a
    new feature*).
    - [x] I have updated the documentation accordingly.
    - [x] I have reformatted the code using `make format` (**required**)
    - [x] I have checked the code using `make lint` (**required**)
    - [x] I have ensured `make bazel-test` pass. (**required**)
    
    Validation run:
    - `make ruff py-format cpplint clang-format buildifier`
    - `make mypy`
    - `bazel test --config=test --cache_test_results=no --test_output=errors
    //envpool/mujoco:myosuite_test
    //envpool/mujoco:myosuite_oracle_align_test
    //envpool/mujoco:myosuite_render_test`
    - `make BAZEL_TEST_TARGETS='//envpool/mujoco:mujoco_render_test
    //envpool/mujoco:mujoco_dmc_render_test //envpool/mujoco:robotics_test'
    bazel-test`
    - `make BAZEL_TEST_TARGETS='//envpool:make_test' bazel-test`
    - `make bazel-test` (62/62 tests passed locally)
    - `make -C docs html` (succeeds; 4 existing `cpp_interface.rst` Breathe
    warnings remain)
    - `make bazel-release`
    - `make pypi-wheel`
    - installed the generated wheel in a fresh venv and ran `make
    release-test`
    - `git diff --cached --check`
    Trinkle23897 authored May 6, 2026
    Configuration menu
    Copy the full SHA
    1c7d8c3 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2026

  1. [mujoco] Fix EGL pixel env teardown crash (#402)

    ## Description
    
    This fixes the EGL teardown crash reported in issue #401 for native
    MuJoCo pixel environments. EGL contexts now share a ref-counted display
    handle so one thread-local renderer cannot terminate the process EGL
    display while another renderer still needs it during teardown. The
    offscreen renderer destructor is also no-throw: if the GL context is
    already unavailable during Python/interpreter shutdown, it frees
    CPU-side MuJoCo scene state and avoids aborting the process.
    
    The regression coverage now exercises all native MuJoCo GL-backed
    families in one EGL subprocess: DMC, Gym MuJoCo, Robotics, MetaWorld,
    and MyoSuite. The test intentionally leaves env objects alive until
    interpreter shutdown, matching the failure mode where the rollout
    succeeds and the process aborts while exiting.
    
    ## Motivation and Context
    
    close #401
    
    The reported script successfully resets a `WalkerWalk-v1` pixel env and
    then aborts at process exit with `failed to make EGL context current`. I
    reproduced the same exit-134 crash on the dev GPU devbox, including when
    calling `pixels.close()`, which points at renderer/context teardown
    rather than user API misuse.
    
    - [x] I have raised an issue to propose this change
    ([required](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    for new features and bug fixes)
    
    ## Types of changes
    
    What types of changes does your code introduce? Put an `x` in all the
    boxes that apply:
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds core functionality)
    - [ ] New environment (non-breaking change which adds 3rd-party
    environment)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Documentation (update in the documentation)
    - [ ] Example (update in the folder of example)
    
    ## Implemented Tasks
    
    - [x] Share EGL display lifetime across native MuJoCo EGL contexts.
    - [x] Make native offscreen renderer teardown safe during interpreter
    shutdown.
    - [x] Add all-family EGL pixel-env teardown regression coverage.
    
    ## Checklist
    
    Go over all the following points, and put an `x` in all the boxes that
    apply.
    If you are unsure about any of these, don't hesitate to ask. We are here
    to help!
    
    - [x] I have read the
    [CONTRIBUTION](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    guide (**required**)
    - [ ] My change requires a change to the documentation.
    - [x] I have updated the tests accordingly (*required for a bug fix or a
    new feature*).
    - [ ] I have updated the documentation accordingly.
    - [ ] I have reformatted the code using `make format` (**required**)
    - [ ] I have checked the code using `make lint` (**required**)
    - [ ] I have ensured `make bazel-test` pass. (**required**)
    
    Validation run:
    
    - devbox `dev-0`: reproduced issue #401 with exit status 134 before the
    fix.
    - devbox `dev-0`: `make bazel-test
    BAZEL_TEST_TARGETS=//envpool/mujoco:mujoco_egl_teardown_test`
    - devbox `dev-0`: `make bazel-test
    BAZEL_TEST_TARGETS=//envpool/mujoco:mujoco_pixel_observation_test`
    - devbox `dev-0`: rebuilt and reinstalled the local wheel, then reran
    the original `envpool.make("WalkerWalk-v1", from_pixels=True,
    num_envs=2, frame_stack=3, ...)` script successfully with exit status 0.
    - local: `ruff check envpool/mujoco/mujoco_egl_teardown_test.py
    envpool/mujoco/pixel_observation_test_utils.py
    envpool/mujoco/dmc/mujoco_dmc_pixel_observation_test.py`
    - local: `git diff --check`
    - local: `clang-format --style=file -i
    envpool/mujoco/offscreen_renderer.cc -n --Werror`
    Trinkle23897 authored May 7, 2026
    Configuration menu
    Copy the full SHA
    f8b482e View commit details
    Browse the repository at this point in the history
  2. [envpool] Support Gymnasium vector wrappers (#403)

    ## Description
    
    Adds Gymnasium vector compatibility metadata to EnvPool's Gymnasium
    wrapper so vector-aware wrappers, including
    `gymnasium.wrappers.vector.NormalizeObservation`, can recognize EnvPool
    as a vector environment.
    
    The change keeps EnvPool's existing backward-compatible space contract:
    `observation_space` and `action_space` still describe one
    sub-environment, and the Gymnasium wrapper now also exposes `num_envs`,
    `is_vector_env`, `single_observation_space`, and `single_action_space`.
    
    This also bumps EnvPool from `1.2.1` to `1.2.2`.
    
    ## Motivation and Context
    
    Fixes #258.
    
    The original blocker was Gym/Gymnasium vector API incompatibility.
    Gymnasium now supports the vector wrapper shape EnvPool needs, so
    EnvPool can provide the expected vector attributes without changing the
    dm_env wrapper or the underlying runtime.
    
    - [x] I have raised an issue to propose this change
    ([required](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    for new features and bug fixes)
    
    ## Types of changes
    
    What types of changes does your code introduce? Put an `x` in all the
    boxes that apply:
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds core functionality)
    - [ ] New environment (non-breaking change which adds 3rd-party
    environment)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [x] Documentation (update in the documentation)
    - [ ] Example (update in the folder of example)
    
    ## Implemented Tasks
    
    - [x] Add Gymnasium vector metadata and `VectorEnv` compatibility on the
    Gymnasium wrapper only
    - [x] Add a CartPole regression test covering Gymnasium vector
    `NormalizeObservation`
    - [x] Bump package version to `1.2.2`
    
    ## Checklist
    
    Go over all the following points, and put an `x` in all the boxes that
    apply.
    If you are unsure about any of these, don't hesitate to ask. We are here
    to help!
    
    - [x] I have read the
    [CONTRIBUTION](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    guide (**required**)
    - [x] My change requires a change to the documentation.
    - [x] I have updated the tests accordingly (*required for a bug fix or a
    new feature*).
    - [x] I have updated the documentation accordingly.
    - [ ] I have reformatted the code using `make format` (**required**)
    - [x] I have checked the code using `ruff check
    envpool/python/gymnasium_envpool.py envpool/python/protocol.py
    envpool/classic_control/classic_control_test.py envpool/__init__.py`
    - [ ] I have ensured `make bazel-test` pass. (**required**)
    
    Validation run:
    - `ruff check envpool/python/gymnasium_envpool.py
    envpool/python/protocol.py
    envpool/classic_control/classic_control_test.py envpool/__init__.py`
    - `mypy envpool/python/gymnasium_envpool.py envpool/python/protocol.py
    envpool/classic_control/classic_control_test.py envpool/__init__.py`
    - `bazel test --test_output=errors
    --test_filter=_ClassicControlEnvPoolTest.test_cartpole_gymnasium_vector_wrapper
    --action_env=PATH=/Users/jiayi/.virtualenvs/openai/bin:/bin:/usr/bin:/usr/local/bin
    //envpool/classic_control:classic_control_test`
    - `bazel test --test_output=errors
    --test_filter=_DummyEnvPoolTest.test_config
    //envpool/dummy:dummy_py_envpool_test`
    Trinkle23897 authored May 7, 2026
    Configuration menu
    Copy the full SHA
    e5851b2 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2026

  1. [mujoco] Avoid EGL pbuffer warnings (#404)

    ## Description
    
    Use an EGL surfaceless context for MuJoCo offscreen rendering when
    `EGL_KHR_surfaceless_context` is available, matching the context shape
    used by upstream `mujoco.egl.GLContext`. Keep the existing 1x1 pbuffer
    fallback for drivers that do not advertise surfaceless contexts.
    
    This prevents MuJoCo from treating the EGL pbuffer as an available
    default window framebuffer, which can leave `GL_INVALID_OPERATION`
    queued and produce:
    
    `OpenGL error 0x502 in or before mjr_makeContext`
    
    The existing EGL teardown subprocess test now also fails if that warning
    appears on stderr.
    
    ## Motivation and Context
    
    Follow-up to #401 and the latest issue comment: the crash was fixed, but
    source builds could still run successfully while printing the MuJoCo
    OpenGL warning above. This change keeps the renderer headless from
    MuJoCo's point of view so native pixel observation envs do not emit the
    warning.
    
    - [x] I have raised an issue to propose this change
    ([required](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    for new features and bug fixes)
    
    ## Types of changes
    
    What types of changes does your code introduce? Put an `x` in all the
    boxes that apply:
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds core functionality)
    - [ ] New environment (non-breaking change which adds 3rd-party
    environment)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Documentation (update in the documentation)
    - [ ] Example (update in the folder of example)
    
    ## Implemented Tasks
    
    - [x] Prefer EGL surfaceless contexts for native MuJoCo offscreen
    rendering.
    - [x] Preserve pbuffer fallback when surfaceless contexts are
    unavailable.
    - [x] Add regression coverage for the MuJoCo `mjr_makeContext` OpenGL
    warning.
    
    ## Checklist
    
    Go over all the following points, and put an `x` in all the boxes that
    apply.
    If you are unsure about any of these, don't hesitate to ask. We are here
    to help!
    
    - [x] I have read the
    [CONTRIBUTION](https://envpool.readthedocs.io/en/latest/pages/contributing.html)
    guide (**required**)
    - [ ] My change requires a change to the documentation.
    - [x] I have updated the tests accordingly (*required for a bug fix or a
    new feature*).
    - [ ] I have updated the documentation accordingly.
    - [ ] I have reformatted the code using `make format` (**required**)
    - [ ] I have checked the code using `make lint` (**required**)
    - [ ] I have ensured `make bazel-test` pass. (**required**)
    
    Validation run:
    
    - `clang-format --style=file -i envpool/mujoco/offscreen_renderer.cc -n
    --Werror`
    - `ruff check envpool/mujoco/pixel_observation_test_utils.py`
    - `ruff format --check envpool/mujoco/pixel_observation_test_utils.py`
    - `git diff --check -- envpool/mujoco/offscreen_renderer.cc
    envpool/mujoco/pixel_observation_test_utils.py`
    - `bazel test --test_output=errors
    //envpool/mujoco:mujoco_egl_teardown_test`
    
    Devbox Linux validation was attempted, but the Brix API endpoint is
    currently failing DNS resolution from this client. The PR CI should run
    the Linux/EGL path directly.
    Trinkle23897 authored May 8, 2026
    Configuration menu
    Copy the full SHA
    dcc6cca View commit details
    Browse the repository at this point in the history
Loading