Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _SETUP_DEPS = [

filegroup(
name = "clang_tidy_config",
data = [".clang-tidy"],
srcs = [".clang-tidy"],
)

py_binary(
Expand Down
2 changes: 1 addition & 1 deletion benchmark/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ gym>=0.26.2
ale-py==0.11.2
mujoco==3.6.0
tqdm
opencv-python-headless>=4.11.0.86,<4.13
opencv-python-headless>=4.13.0.92
dm_control==1.0.38
packaging
4 changes: 2 additions & 2 deletions demo/envpool_demo_ant.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"!pip install envpool\n",
"!pip install gym\n",
"\n",
"!pip install free-mujoco-py\n",
"!pip install mujoco\n",
"!sudo apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1\n",
"!pip install imageio==2.4.1\n",
"!pip install -U colabgymrender"
Expand Down Expand Up @@ -2781,4 +2781,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
4 changes: 2 additions & 2 deletions demo/envpool_demo_breakout.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"!pip install envpool\n",
"!pip install gym\n",
"\n",
"!pip install free-mujoco-py\n",
"!pip install mujoco\n",
"!apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1\n",
"!pip install imageio==2.4.1\n",
"!pip install -U colabgymrender"
Expand Down Expand Up @@ -1884,4 +1884,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions demo/envpool_demo_halfcheetah.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"!pip install envpool\n",
"!pip install gym\n",
"\n",
"!pip install free-mujoco-py\n",
"!pip install mujoco\n",
"!apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1\n",
"!pip install imageio==2.4.1\n",
"!pip install -U colabgymrender"
Expand Down Expand Up @@ -1372,4 +1372,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions demo/envpool_demo_pong.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"!pip install envpool\n",
"!pip install gym\n",
"\n",
"!pip install free-mujoco-py\n",
"!pip install mujoco\n",
"!apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1\n",
"!pip install imageio==2.4.1\n",
"!pip install -U colabgymrender"
Expand Down Expand Up @@ -892,4 +892,4 @@
]
}
]
}
}
5 changes: 2 additions & 3 deletions envpool/box2d/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ py_test(
":box2d",
":box2d_registration",
requirement("absl-py"),
requirement("gym"),
requirement("box2d-py"),
requirement("box2d"),
requirement("gymnasium"),
requirement("pygame"),
requirement("opencv-python-headless"),
requirement("numpy"),
],
)
9 changes: 4 additions & 5 deletions envpool/box2d/box2d_correctness_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

from typing import Any, Dict, List, Tuple, no_type_check

# import cv2
import gym
import gymnasium as gym
import numpy as np
import pygame
from absl import logging
Expand Down Expand Up @@ -46,16 +45,16 @@ def test_bipedal_walker_space(self) -> None:
self.run_space_check(env0, env1)

def test_lunar_lander_space(self) -> None:
env0 = gym.make("LunarLander-v2")
env0 = gym.make("LunarLander-v3")
env1 = make_gym("LunarLander-v2")
Comment thread
Trinkle23897 marked this conversation as resolved.
self.run_space_check(env0, env1)

env0 = gym.make("LunarLanderContinuous-v2")
env0 = gym.make("LunarLanderContinuous-v3")
env1 = make_gym("LunarLanderContinuous-v2")
self.run_space_check(env0, env1)

def test_car_racing_space(self) -> None:
env0 = gym.make("CarRacing-v2")
env0 = gym.make("CarRacing-v3")
env1 = make_gym("CarRacing-v2")
self.run_space_check(env0, env1)

Expand Down
11 changes: 11 additions & 0 deletions envpool/core/circular_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ class CircularBuffer {
sem_put_.signal();
return v;
}

bool TryGet(V* out) {
if (!sem_get_.tryWait()) {
return false;
}
uint64_t head = head_.fetch_add(1);
auto offset = head % size_;
*out = std::move(buffer_[offset]);
sem_put_.signal();
return true;
}
};

#endif // ENVPOOL_CORE_CIRCULAR_BUFFER_H_
4 changes: 2 additions & 2 deletions envpool/core/state_buffer_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ class StateBufferQueue {
* time of each state buffer is in the same order as the allocation time.
*/
std::vector<Array> Wait(std::size_t additional_done_count = 0) {
std::unique_ptr<StateBuffer> newbuf = stock_buffer_.Get();
if (newbuf == nullptr) {
std::unique_ptr<StateBuffer> newbuf;
if (!stock_buffer_.TryGet(&newbuf) || newbuf == nullptr) {
newbuf = std::make_unique<StateBuffer>(batch_, max_num_players_, specs_,
Comment thread
Trinkle23897 marked this conversation as resolved.
Outdated
is_player_state_);
}
Expand Down
6 changes: 3 additions & 3 deletions envpool/workspace0.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ def workspace():
maybe(
http_archive,
name = "com_justbuchanan_rules_qt",
sha256 = "6b42a58f062b3eea10ada5340cd8f63b47feb986d16794b0f8e0fde750838348",
strip_prefix = "bazel_rules_qt-3196fcf2e6ee81cf3a2e2b272af3d4259b84fcf9",
sha256 = "29c1bf65369195d038eb5d3c923499fd229fa7ba947524dbdd9c48c91e1ee740",
strip_prefix = "bazel_rules_qt-89290cc7962d697c31b361a0f62141ca13d062d2",
urls = [
"https://github.com/justbuchanan/bazel_rules_qt/archive/3196fcf2e6ee81cf3a2e2b272af3d4259b84fcf9.tar.gz",
"https://github.com/justbuchanan/bazel_rules_qt/archive/89290cc7962d697c31b361a0f62141ca13d062d2.tar.gz",
],
)

Expand Down
14 changes: 5 additions & 9 deletions third_party/pip_requirements/requirements-dev-lock.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
absl-py==2.4.0
attrs==26.1.0
box2d-py==2.3.8
box2d==2.3.10
certifi==2026.2.25
cffi==2.0.0
charset-normalizer==3.4.6
cloudpickle==3.1.2
cuda-bindings==12.9.4
cuda-pathfinder==1.4.3
cython==3.2.4
dm-control==1.0.38
dm-env==1.6
dm-tree==0.1.9
etils==1.14.0
farama-notifications==0.0.4
fasteners==0.20
filelock==3.25.2
fsspec==2026.2.0
glfw==2.10.0
Expand All @@ -36,10 +33,9 @@ minigrid==3.0.0
ml-dtypes==0.5.4
mpmath==1.3.0
mujoco==3.6.0
mujoco-py==2.1.2.14
networkx==3.6.1
numba==0.64.0
numpy==2.2.6
numpy==2.4.3
nvidia-cublas-cu12==12.8.4.1
nvidia-cuda-cupti-cu12==12.8.90
nvidia-cuda-nvrtc-cu12==12.8.93
Expand All @@ -55,19 +51,19 @@ nvidia-nccl-cu12==2.27.5
nvidia-nvjitlink-cu12==12.8.93
nvidia-nvshmem-cu12==3.4.5
nvidia-nvtx-cu12==12.8.90
opencv-python-headless==4.12.0.88
opencv-python-headless==4.13.0.92
opt-einsum==3.4.0
optree==0.19.0
packaging==26.0
pettingzoo==1.25.0
pillow==12.1.1
protobuf==3.20.3
pycparser==3.0
protobuf==7.34.1
pygame==2.6.1
pyopengl==3.1.10
pyparsing==3.3.2
requests==2.32.5
scipy==1.17.1
swig==4.4.1
sympy==1.14.0
tensorboard==2.20.0
tensorboard-data-server==0.7.2
Expand Down
8 changes: 3 additions & 5 deletions third_party/pip_requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ wheel
numpy>=2,<3
dm-env>=1.6
gym>=0.26.2
gymnasium>=1.2.3
gymnasium[box2d]>=1.2.3
optree>=0.19.0
jax[cpu]>=0.9.2,<0.10
absl-py
packaging>=26.0
tqdm
protobuf<=4.20.0
torch>=1.0,!=2.0.0,!=2.0.1
tianshou>=0.5.1,<1.0.0
opencv-python-headless>=4.11.0.86,<4.13
box2d-py
opencv-python-headless>=4.13.0.92
dm-control>=1.0.38
mujoco==3.6.0
mujoco_py>=2.1.2.14
imageio
pygame
minigrid>=3.0.0
Loading