Skip to content

Commit 6eed4db

Browse files
authored
fix(tasks): correct embodiedgen put_banana max_episode_steps (250000 -> 250) (#791)
put_banana declared max_episode_steps = 250000 — a typo (extra 000); both the EmbodiedGenBaseTask base and the put_mug sibling use 250. The inflated cap let an unsolved episode run 1000x too long before timing out. Adds a backend-free (general) regression test pinning every embodiedgen task's max_episode_steps to the base convention.
1 parent b0339e7 commit 6eed4db

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

roboverse_pack/tasks/embodiedgen/put_banana.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class PutBananaTask(EmbodiedGenBaseTask):
2121
The scene contains multiple objects on the table to make it more realistic and challenging.
2222
"""
2323

24-
max_episode_steps = 250000
24+
max_episode_steps = 250
2525

2626
scenario = ScenarioCfg(
2727
objects=[
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""Backend-free regression: embodiedgen tasks use a sane max_episode_steps.
2+
3+
``put_banana`` carried ``max_episode_steps = 250000`` (a typo — base and the
4+
``put_mug`` sibling both use 250), which would let an unsolved episode run for
5+
250k steps. This statically (no sim backend) pins every embodiedgen task's
6+
declared ``max_episode_steps`` to the base value.
7+
"""
8+
9+
from __future__ import annotations
10+
11+
import ast
12+
import pathlib
13+
14+
import pytest
15+
16+
_EMBODIEDGEN = pathlib.Path(__file__).resolve().parents[1] / "roboverse_pack" / "tasks" / "embodiedgen"
17+
_EXPECTED = 250 # base.py / put_mug.py convention
18+
19+
20+
def _max_episode_steps(path: pathlib.Path) -> int | None:
21+
tree = ast.parse(path.read_text(encoding="utf-8"))
22+
for node in ast.walk(tree):
23+
if isinstance(node, ast.Assign):
24+
for t in node.targets:
25+
if isinstance(t, ast.Name) and t.id == "max_episode_steps" and isinstance(node.value, ast.Constant):
26+
return node.value.value
27+
return None
28+
29+
30+
@pytest.mark.general
31+
def test_embodiedgen_max_episode_steps_are_sane():
32+
offenders = {}
33+
for path in sorted(_EMBODIEDGEN.glob("*.py")):
34+
val = _max_episode_steps(path)
35+
if val is not None and val != _EXPECTED:
36+
offenders[path.name] = val
37+
assert not offenders, f"embodiedgen tasks with off-convention max_episode_steps (expected {_EXPECTED}): {offenders}"

0 commit comments

Comments
 (0)