Skip to content

Commit 4180328

Browse files
authored
[envpool] upgrade direct dependencies and remove stale mirrors (#334)
## Summary - Problem: EnvPool still pinned several direct Python and native dependencies to old versions, and `WORKSPACE` still referenced the retired `https://ml.cs.tsinghua.edu.cn/~jiayi/envpool` mirror. - Scope: keep the retained first-round upgrades only: MuJoCo / dm_control versions, Python requirement floors and lockfiles, selected direct native archive versions (`pybind11`, `glog`, `googletest`, `zlib`), and matching docs / build-file updates. This PR intentionally excludes the experimental second-round Bazel / toolchain / broader C++ dependency bumps. - Outcome: the retained direct dependency set is newer and consistent across Bazel archives, Python lockfiles, MuJoCo build outputs, and docs, and the stale mirror URLs are removed. This narrows the dependency refresh to the direct changes that are easiest to review and keep, while dropping the more invasive toolchain work. ## Technical Details - Approach: update the direct dependency versions in `workspace0.bzl` and pip requirement files, regenerate the Linux lockfiles, and sync MuJoCo shared-library names plus doc references to the retained versions. - Code pointers: - `envpool/workspace0.bzl`: removes the stale mirror URLs and bumps the retained native archive versions. - `third_party/pip_requirements/requirements-dev.txt`: updates the dev/runtime dependency inputs that feed the lockfiles. - `envpool/mujoco/BUILD`: updates the generated MuJoCo shared library output to match 3.6.0. - Notes: I temporarily explored a second round of Bazel / toolchain / C++ dependency upgrades during debugging, but rolled those changes back before publishing this PR. ## Test Plan ### Automated - `brix ssh dev-0 -C -- '<targeted bazel test run on the retained first-round dependency set>'`: earlier targeted dev validation passed the core buffer tests plus MuJoCo / dm_control alignment tests for the retained dependency-refresh path. ### Suggested Manual - `brix ssh dev-0 -C -- 'cd /root/code/envpool && bazel test //envpool/mujoco:mujoco_gym_deterministic_test //envpool/mujoco:mujoco_gym_align_test //envpool/mujoco:mujoco_dmc_suite_deterministic_test //envpool/mujoco:mujoco_dmc_suite_align_test --test_output=errors'`: revalidate the final PR branch on Linux. - `rg -n "ml\\.cs\\.tsinghua\\.edu\\.cn/~jiayi/envpool" envpool/workspace0.bzl`: confirm the retired mirror URL is gone.
1 parent 40cc309 commit 4180328

21 files changed

Lines changed: 167 additions & 161 deletions

benchmark/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
gym[accept-rom-license]==0.23.1
22
ale-py==0.7.5
3-
mujoco==2.2.0
3+
mujoco==3.6.0
44
envpool==0.6.1.post1
55
sample-factory==1.123.0
66
mujoco_py==2.1.2.14
77
tqdm
88
opencv-python-headless
9-
dm_control==1.0.3.post1
9+
dm_control==1.0.38
1010
packaging

docs/env/box2d.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Box2D
22
=====
33

4-
We use ``box2d==2.4.1`` and ``gym==0.23.1`` as the codebase. See
5-
https://github.com/erincatto/box2d/tree/v2.4.1 and
4+
We use ``box2d==2.4.2`` and ``gym==0.23.1`` as the codebase. See
5+
https://github.com/erincatto/box2d/tree/v2.4.2 and
66
https://github.com/openai/gym/tree/v0.23.1/gym/envs/box2d
77

88

@@ -159,6 +159,6 @@ We ran gym's environments with dependency ``box2d-py==2.3.5`` (see
159159
https://github.com/openai/box2d-py/tree/2.3.5) for 1000 episode and averaged
160160
reward as our threshold.
161161

162-
The current implementation of envpool is based on box2d 2.4.1 version.
162+
The current implementation of envpool is based on box2d 2.4.2 version.
163163
If you want to use box2d==2.3.5 to run the test, please checkout commit
164164
``4de47ebb6615052c67fdfbbe9bc3e9b1d5692f99`` and build the wheel.

docs/env/dm_control.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
DeepMind Control Suite
22
======================
33

4-
We use ``dm_control==1.0.5`` and ``mujoco==3.3.4`` as the codebase.
5-
See https://github.com/deepmind/dm_control/tree/1.0.5 and
6-
https://github.com/google-deepmind/mujoco/tree/3.3.4
4+
We use ``dm_control==1.0.38`` and ``mujoco==3.6.0`` as the codebase.
5+
See https://github.com/deepmind/dm_control/tree/1.0.38 and
6+
https://github.com/google-deepmind/mujoco/tree/3.6.0
77

88
The ``domain_name`` and ``task_name`` for ``suite.load`` function are
99
converted into ``DomainNameTaskName-v1`` in envpool, e.g.,
@@ -24,7 +24,7 @@ AcrobotSwingup-v1, AcrobotSwingupSparse-v1
2424
------------------------------------------
2525

2626
`dm_control suite acrobot source code
27-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/acrobot.py>`_
27+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/acrobot.py>`_
2828

2929
- Observation spec: a namedtuple with two keys: ``orientations (4)``,
3030
``velocity (2)``;
@@ -37,7 +37,7 @@ BallInCupCatch-v1
3737
-----------------
3838

3939
`dm_control suite ball-in-cup source code
40-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/ball_in_cup.py>`_
40+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/ball_in_cup.py>`_
4141

4242
- Observation spec: a namedtuple with two keys: ``position (4)`` and
4343
``velocity (4)``;
@@ -50,7 +50,7 @@ CartpoleBalance-v1, CartpoleBalanceSparse-v1, CartpoleSwingup-v1, CartpoleSwingu
5050
--------------------------------------------------------------------------------------------------------------------------------------
5151

5252
`dm_control suite cartpole source code
53-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/cartpole.py>`_
53+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/cartpole.py>`_
5454

5555
- Observation spec: a namedtuple with two keys: ``position (5 for two_poles, 7
5656
for three_poles, 3 for others)``, ``velocity (3 for two_poles, 4 for
@@ -64,7 +64,7 @@ CheetahRun-v1
6464
-------------
6565

6666
`dm_control suite cheetah source code
67-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/cheetah.py>`_
67+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/cheetah.py>`_
6868

6969
- Observation spec: a namedtuple with two keys: ``position (8)`` and
7070
``velocity (9)``;
@@ -77,7 +77,7 @@ FingerSpin-v1, FingerTurnEasy-v1, FingerTurnHard-v1
7777
---------------------------------------------------
7878

7979
`dm_control suite finger source code
80-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/finger.py>`_
80+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/finger.py>`_
8181

8282
- Observation spec: a namedtuple with five keys: ``position (4)``,
8383
``velocity (3)``, ``touch (2)``, ``target_position (2)``,
@@ -97,7 +97,7 @@ FishSwim-v1, FishUpright-v1
9797
---------------------------
9898

9999
`dm_control suite fish source code
100-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/fish.py>`_
100+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/fish.py>`_
101101

102102
- Observation spec: a namedtuple with four keys: ``joint_angles (7)``,
103103
``upright ()``, ``target (3)``, ``velocity (13)``;
@@ -115,7 +115,7 @@ HopperStand-v1, HopperHop-v1
115115
----------------------------
116116

117117
`dm_control suite hopper source code
118-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/hopper.py>`_
118+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/hopper.py>`_
119119

120120
- Observation spec: a namedtuple with three keys: ``position (6)``,
121121
``velocity (7)``, ``touch (2)``;
@@ -128,7 +128,7 @@ ManipulatorBringBall-v1, ManipulatorBringPeg-v1, ManipulatorInsertBall-v1, Manip
128128
--------------------------------------------------------------------------------------------------
129129

130130
`dm_control suite manipulator source code
131-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/manipulator.py>`_
131+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/manipulator.py>`_
132132

133133
- Observation spec: a namedtuple with three keys: ``arm_pos (8,2)``,
134134
``arm_vel (8)``, ``touch (5)``, ``hand_pos (4)``, ``object_pos (4)``,
@@ -142,7 +142,7 @@ HumanoidStand-v1, HumanoidWalk-v1, HumanoidRun-v1, HumanoidRunPureState-v1
142142
--------------------------------------------------------------------------
143143

144144
`dm_control suite humanoid source code
145-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/humanoid.py>`_
145+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/humanoid.py>`_
146146

147147
- Observation spec: a namedtuple with seven keys: ``joint_angles (21)``,
148148
``head_height ()``, ``extremities (12)``, ``torso_vertical (3)``,
@@ -164,7 +164,7 @@ HumanoidCMUStand-v1, HumanoidCMURun-v1
164164
--------------------------------------
165165

166166
`dm_control suite humanoid-CMU source code
167-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/humanoid_CMU.py>`_
167+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/humanoid_CMU.py>`_
168168

169169
- Observation spec: a namedtuple with six keys: ``joint_angles (56)``,
170170
``head_height ()``, ``extremities (12)``, ``torso_vertical (3)``,
@@ -178,7 +178,7 @@ PendulumSwingup-v1
178178
------------------
179179

180180
`dm_control suite pendulum source code
181-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/pendulum.py>`_
181+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/pendulum.py>`_
182182

183183
- Observation spec: a namedtuple with three keys: ``orientations (2)``,
184184
``velocity (1)``;
@@ -191,7 +191,7 @@ PointMassEasy-v1, PointMassHard-v1
191191
----------------------------------
192192

193193
`dm_control suite point-mass source code
194-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/point_mass.py>`_
194+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/point_mass.py>`_
195195

196196
- Observation spec: a namedtuple with three keys: ``position (2)``,
197197
``velocity (2)``;
@@ -204,7 +204,7 @@ ReacherEasy-v1, ReacherHard-v1
204204
------------------------------
205205

206206
`dm_control suite reacher source code
207-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/reacher.py>`_
207+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/reacher.py>`_
208208

209209
- Observation spec: a namedtuple with three keys: ``position (2)``,
210210
``to_target (2)`` and ``velocity (2)``;
@@ -217,7 +217,7 @@ SwimmerSwimmer6-v1, SwimmerSwimmer15-v1
217217
---------------------------------------
218218

219219
`dm_control suite swimmer source code
220-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/swimmer.py>`_
220+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/swimmer.py>`_
221221

222222
- Observation spec: a namedtuple with three keys: ``joints (5 for swimmer6,
223223
14 for swimmer15)``, ``to_target (2)``, and ``body_velocities (18 for
@@ -231,7 +231,7 @@ WalkerRun-v1, WalkerStand-v1, WalkerWalk-v1
231231
-------------------------------------------
232232

233233
`dm_control suite walker source code
234-
<https://github.com/deepmind/dm_control/blob/1.0.5/dm_control/suite/walker.py>`_
234+
<https://github.com/deepmind/dm_control/blob/1.0.38/dm_control/suite/walker.py>`_
235235

236236
- Observation spec: a namedtuple with three keys: ``orientations (14)``,
237237
``height ()`` and ``velocity (9)``;

docs/env/minigrid.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Minigrid
22
========
33

4-
We use ``minigrid==2.1.0`` as the codebase.
5-
See https://github.com/Farama-Foundation/Minigrid/tree/v2.1.0
4+
We use ``minigrid==3.0.0`` as the codebase.
5+
See https://github.com/Farama-Foundation/Minigrid/tree/v3.0.0
66

77

88
Empty

docs/env/mujoco_gym.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Mujoco (gym)
22
============
33

4-
We use ``mujoco==3.3.4`` as the codebase.
5-
See https://github.com/google-deepmind/mujoco/tree/3.3.4
4+
We use ``mujoco==3.6.0`` as the codebase.
5+
See https://github.com/google-deepmind/mujoco/tree/3.6.0
66

77
The implementation follows Gymnasium \*-v5 environment, see
88
`reference <https://github.com/Farama-Foundation/Gymnasium/tree/v1.2.3/gymnasium/envs/mujoco>`_.

docs/env/vizdoom.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ViZDoom
22
=======
33

4-
We use ``vizdoom==1.1.13`` as the codebase. See
5-
https://github.com/mwydmuch/ViZDoom/tree/1.1.13
4+
We use ``vizdoom==1.3.0`` as the codebase. See
5+
https://github.com/Farama-Foundation/ViZDoom/tree/1.3.0
66

77

88
Env Wrappers
@@ -51,10 +51,10 @@ Options
5151
* ``iwad_path (str)``: the rendering resource package path, default to
5252
``vizdoom/bin/freedoom2``;
5353
* ``map_id (str)``: the vizdoom map id, see `setDoomMap
54-
<https://github.com/mwydmuch/ViZDoom/blob/master/doc/DoomGame.md#setDoomMap>`_,
54+
<https://github.com/Farama-Foundation/ViZDoom/blob/1.3.0/doc/DoomGame.md#setDoomMap>`_,
5555
available options are ``"map01", "map02", ...``, default to ``"map01"``;
5656
* ``game_args (str)``: the args string for vizdoom game, see `addGameArgs
57-
<https://github.com/mwydmuch/ViZDoom/blob/master/doc/DoomGame.md#addGameArgs>`_,
57+
<https://github.com/Farama-Foundation/ViZDoom/blob/1.3.0/doc/DoomGame.md#addGameArgs>`_,
5858
default to ``""``;
5959
* ``reward_config (Dict[str, Tuple[float, float]])``: how to calculate the
6060
reward (see below), default to ``{"FRAGCOUNT": [1, -1.5], "KILLCOUNT": [1, 0],

envpool/box2d/box2d_correctness_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def solve_bipedal_walker(
267267
# the following number is from gym's 1000 episode mean reward
268268
if hardcore: # -59.219390 ± 25.209768
269269
self.assertTrue(abs(mean_reward + 59) < 10, (hardcore, mean_reward))
270-
else: # 102.647320 ± 125.075071
271-
self.assertTrue(abs(mean_reward - 103) < 20, (hardcore, mean_reward))
270+
else: # 145.318979 ± 126.231202 on box2d 2.4.2
271+
self.assertTrue(abs(mean_reward - 145) < 20, (hardcore, mean_reward))
272272

273273
def render_bpw(self, info: dict) -> None:
274274
SCALE = 30.0

envpool/core/state_buffer_queue_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TEST(StateBufferQueueTest, NumPlayers) {
114114
EXPECT_EQ(slice.arr[1].Shape(0), 1);
115115
size += num_players;
116116
}
117-
std::vector<Array> out = queue.Wait(batch * max_num_players - size);
117+
std::vector<Array> out = queue.Wait();
118118
EXPECT_EQ(out[0].Shape(0), size);
119119
EXPECT_EQ(out[1].Shape(0), batch);
120120
}

envpool/mujoco/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ genrule(
4343
genrule(
4444
name = "gen_mujoco_so",
4545
srcs = ["@mujoco//:mujoco_so"],
46-
outs = ["libmujoco.so.3.3.4"],
46+
outs = ["libmujoco.so.3.6.0"],
4747
cmd = "cp $< $@",
4848
)
4949

envpool/vizdoom/vizdoom_pretrain_test.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import multiprocessing as mp
1717
import os
18+
import queue
1819
import shutil
1920
from typing import Optional, Tuple
2021

@@ -111,7 +112,7 @@ def _eval_c51_impl(
111112

112113

113114
def _eval_c51_subprocess(
114-
queue: mp.Queue,
115+
result_queue: mp.Queue,
115116
task: str,
116117
resume_path: str,
117118
cfg_path: Optional[str],
@@ -123,7 +124,7 @@ def _eval_c51_subprocess(
123124
cfg_path=cfg_path,
124125
reward_config=reward_config,
125126
)
126-
queue.put((reward, length))
127+
result_queue.put((reward, length))
127128

128129

129130
class _VizdoomPretrainTest(absltest.TestCase):
@@ -168,11 +169,11 @@ def test_d3(self) -> None:
168169
f.write(cfg.replace("hud = false", "hud = true"))
169170
try:
170171
ctx = mp.get_context("spawn")
171-
queue: mp.Queue = ctx.Queue()
172+
result_queue: mp.Queue = ctx.Queue()
172173
proc = ctx.Process(
173174
target=_eval_c51_subprocess,
174175
args=(
175-
queue,
176+
result_queue,
176177
"D3_battle",
177178
model_path,
178179
"d3.cfg",
@@ -182,9 +183,20 @@ def test_d3(self) -> None:
182183
),
183184
)
184185
proc.start()
185-
proc.join()
186+
try:
187+
reward, length = result_queue.get(timeout=120)
188+
except queue.Empty:
189+
proc.terminate()
190+
proc.join(timeout=5)
191+
self.fail("Timed out waiting for D3 subprocess result")
192+
proc.join(timeout=30)
193+
if proc.is_alive():
194+
proc.terminate()
195+
proc.join(timeout=5)
196+
self.fail("D3 subprocess did not exit after producing a result")
186197
self.assertEqual(proc.exitcode, 0)
187-
reward, length = queue.get_nowait()
198+
result_queue.close()
199+
result_queue.join_thread()
188200
finally:
189201
if os.path.exists("d3.cfg"):
190202
os.remove("d3.cfg")

0 commit comments

Comments
 (0)