From a6c0870caf22a7af46b3857be9d4bfd9ec897915 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 18:50:44 +0800 Subject: [PATCH 1/9] fix: cache reset columns by layout --- docs/sphinx/source/changelog.md | 16 +++++ src/unilab/base/reset_state.py | 62 ++++++++++++------- tests/base/test_reset_state.py | 102 ++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+), 22 deletions(-) diff --git a/docs/sphinx/source/changelog.md b/docs/sphinx/source/changelog.md index b63bfedbb..7e5e9a1c6 100644 --- a/docs/sphinx/source/changelog.md +++ b/docs/sphinx/source/changelog.md @@ -13,6 +13,22 @@ UniLab 遵循[语义化版本](https://semver.org/)。本共享页面以中英 PyPI 版本变更与未发布变更;发布日期采用 PyPI 上传日期。完整提交历史请参阅 [UniLab 仓库](https://github.com/unilabsim/UniLab)。 +## Unreleased + +### Fixed / 修复 + +- Reset-state tensor writes now cache root and joint column indices per layout + instead of retaining only the most recent layout. Alternating any number of + layouts no longer repeatedly uploads index tensors, and an uncached layout + encountered during CUDA graph capture raises a `RuntimeError` identifying its + qpos/qvel indices instead of attempting an invalid host-to-device copy + ([#2681](https://github.com/Motphys/UniLab/issues/2681)). + reset-state tensor 写入现在按 layout 分别缓存 root 与 joint 列索引,不再只保留 + 最近使用的 layout。任意多个 layout 交替写入时无需重复上传索引 tensor;CUDA graph + 捕获期间遇到未缓存 layout 时,会抛出包含其 qpos/qvel 索引的 `RuntimeError`,不再 + 尝试非法的 host-to-device 拷贝 + ([#2681](https://github.com/Motphys/UniLab/issues/2681))。 + ## 1.6.5 (2026-12-03) ### Fixed / 修复 diff --git a/src/unilab/base/reset_state.py b/src/unilab/base/reset_state.py index b8bdd7842..dcbbaba01 100644 --- a/src/unilab/base/reset_state.py +++ b/src/unilab/base/reset_state.py @@ -176,13 +176,13 @@ def __init__( self._owner_tensor_write_mask: torch.Tensor | None = None self._requested_rows_mask: torch.Tensor | None = None self._tensor_write_mask: torch.Tensor | None = None - self._tensor_root_columns: ( - tuple[tuple[int, ...], tuple[int, ...], torch.Tensor, torch.Tensor] | None - ) = None + self._tensor_root_columns: dict[ + tuple[tuple[int, ...], tuple[int, ...]], tuple[torch.Tensor, torch.Tensor] + ] = {} self._tensor_root_velocity: torch.Tensor | None = None - self._tensor_joint_columns: ( - tuple[tuple[int, ...], tuple[int, ...], torch.Tensor, torch.Tensor] | None - ) = None + self._tensor_joint_columns: dict[ + tuple[tuple[int, ...], tuple[int, ...]], tuple[torch.Tensor, torch.Tensor] + ] = {} @property def active(self) -> bool: @@ -293,9 +293,11 @@ def declare_packed_reset_device(self, device: torch.device) -> None: "PackedResetTransaction", bind_packed_reset(device=resolved) ) self._packed_reset_transaction.validation = self._packed_validation_mode - # The packed composer and its device tables are rebuilt: per-field - # tensor defaults cached for the previous declaration are stale. + # The packed composer and its device tables are rebuilt: tensor defaults + # and column indices cached for the previous declaration are stale. self._tensor_randomization_defaults.clear() + self._tensor_root_columns.clear() + self._tensor_joint_columns.clear() self._packed_state_default_installed = False @contextmanager @@ -2359,15 +2361,23 @@ def _tensor_root_columns_for_layout( ) -> tuple[torch.Tensor, torch.Tensor]: qpos_columns, qvel_columns = self._validate_root_layout(layout, term_name=term_name) key = (tuple(int(i) for i in qpos_columns), tuple(int(i) for i in qvel_columns)) - cached = self._tensor_root_columns + cached = self._tensor_root_columns.get(key) + if cached is not None: + return cached device = self._packed_reset_device assert device is not None - if cached is not None and (cached[0], cached[1]) == key: - return cached[2], cached[3] - qpos_tensor = torch.as_tensor(qpos_columns, dtype=torch.int64, device=device) - qvel_tensor = torch.as_tensor(qvel_columns, dtype=torch.int64, device=device) - self._tensor_root_columns = (*key, qpos_tensor, qvel_tensor) - return qpos_tensor, qvel_tensor + if torch.cuda.is_current_stream_capturing(): + raise RuntimeError( + f"EventManager term '{term_name}' cannot materialize root-state column tensors " + "during CUDA graph capture: layout " + f"qpos_indices={key[0]}, qvel_indices={key[1]} was not cached before capture" + ) + columns = ( + torch.as_tensor(qpos_columns, dtype=torch.int64, device=device), + torch.as_tensor(qvel_columns, dtype=torch.int64, device=device), + ) + self._tensor_root_columns[key] = columns + return columns def _tensor_joint_columns_for_indices( self, @@ -2393,15 +2403,23 @@ def _tensor_joint_columns_for_indices( tuple(int(index) for index in qpos_columns), tuple(int(index) for index in qvel_columns), ) - cached = self._tensor_joint_columns + cached = self._tensor_joint_columns.get(key) + if cached is not None: + return cached device = self._packed_reset_device assert device is not None - if cached is not None and (cached[0], cached[1]) == key: - return cached[2], cached[3] - qpos_tensor = torch.as_tensor(qpos_columns, dtype=torch.int64, device=device) - qvel_tensor = torch.as_tensor(qvel_columns, dtype=torch.int64, device=device) - self._tensor_joint_columns = (*key, qpos_tensor, qvel_tensor) - return qpos_tensor, qvel_tensor + if torch.cuda.is_current_stream_capturing(): + raise RuntimeError( + f"EventManager term '{term_name}' cannot materialize joint-state column tensors " + "during CUDA graph capture: layout " + f"qpos_indices={key[0]}, qvel_indices={key[1]} was not cached before capture" + ) + columns = ( + torch.as_tensor(qpos_columns, dtype=torch.int64, device=device), + torch.as_tensor(qvel_columns, dtype=torch.int64, device=device), + ) + self._tensor_joint_columns[key] = columns + return columns def _validate_quaternions(self, values: np.ndarray | torch.Tensor, *, term_name: str) -> None: if isinstance(values, torch.Tensor): diff --git a/tests/base/test_reset_state.py b/tests/base/test_reset_state.py index a7f4ec538..b7254eeab 100644 --- a/tests/base/test_reset_state.py +++ b/tests/base/test_reset_state.py @@ -471,6 +471,108 @@ def test_packed_reset_commits_selected_rows_with_default_fill() -> None: np.testing.assert_allclose(qpos[:, 0], [0.1, 0.3], rtol=0, atol=1e-7) +def test_packed_root_column_cache_reuses_three_layouts_during_capture( + monkeypatch: pytest.MonkeyPatch, +) -> None: + transaction = _transaction(_TensorResetBackend()) + transaction.declare_packed_reset_device(torch.device("cpu")) + transaction._ensure_packed_state_default("root_cache") + layouts = tuple( + RootStateLayout(tuple(range(offset, offset + 7)), tuple(range(offset, offset + 6))) + for offset in range(3) + ) + cached = [ + transaction._tensor_root_columns_for_layout(layout, term_name="root_cache") + for layout in layouts + ] + + def fail_as_tensor(*_args, **_kwargs): + raise AssertionError("cached root columns must not be materialized again") + + with monkeypatch.context() as patches: + patches.setattr(torch.cuda, "is_current_stream_capturing", lambda: True) + patches.setattr(torch, "as_tensor", fail_as_tensor) + for index in (2, 0, 1, 2, 0): + columns = transaction._tensor_root_columns_for_layout( + layouts[index], term_name="root_cache" + ) + assert columns[0] is cached[index][0] + assert columns[1] is cached[index][1] + + assert len(transaction._tensor_root_columns) == 3 + + +def test_packed_joint_column_cache_reuses_three_layouts_during_capture( + monkeypatch: pytest.MonkeyPatch, +) -> None: + transaction = _transaction(_TensorResetBackend()) + transaction.declare_packed_reset_device(torch.device("cpu")) + transaction._ensure_packed_state_default("joint_cache") + layouts = ( + (np.array([7]), np.array([6])), + (np.array([8]), np.array([7])), + (np.array([7, 8]), np.array([6, 7])), + ) + cached = [ + transaction._tensor_joint_columns_for_indices( + qpos_indices, qvel_indices, term_name="joint_cache" + ) + for qpos_indices, qvel_indices in layouts + ] + + def fail_as_tensor(*_args, **_kwargs): + raise AssertionError("cached joint columns must not be materialized again") + + with monkeypatch.context() as patches: + patches.setattr(torch.cuda, "is_current_stream_capturing", lambda: True) + patches.setattr(torch, "as_tensor", fail_as_tensor) + for index in (2, 0, 1, 2, 0): + qpos_indices, qvel_indices = layouts[index] + columns = transaction._tensor_joint_columns_for_indices( + qpos_indices, qvel_indices, term_name="joint_cache" + ) + assert columns[0] is cached[index][0] + assert columns[1] is cached[index][1] + + assert len(transaction._tensor_joint_columns) == 3 + + +@pytest.mark.parametrize("state_kind", ["root", "joint"]) +def test_packed_column_cache_capture_miss_fails_closed( + monkeypatch: pytest.MonkeyPatch, state_kind: str +) -> None: + transaction = _transaction(_TensorResetBackend()) + transaction.declare_packed_reset_device(torch.device("cpu")) + transaction._ensure_packed_state_default("capture_miss") + monkeypatch.setattr(torch.cuda, "is_current_stream_capturing", lambda: True) + + def fail_as_tensor(*_args, **_kwargs): + raise AssertionError("capture miss must fail before materializing columns") + + monkeypatch.setattr(torch, "as_tensor", fail_as_tensor) + with pytest.raises(RuntimeError) as exc_info: + if state_kind == "root": + transaction._tensor_root_columns_for_layout( + RootStateLayout(tuple(range(1, 8)), tuple(range(1, 7))), + term_name="capture_miss", + ) + else: + transaction._tensor_joint_columns_for_indices( + np.array([7, 8]), np.array([6, 7]), term_name="capture_miss" + ) + + message = str(exc_info.value) + assert f"{state_kind}-state column tensors" in message + assert "during CUDA graph capture" in message + assert "was not cached before capture" in message + if state_kind == "root": + assert "qpos_indices=(1, 2, 3, 4, 5, 6, 7)" in message + assert "qvel_indices=(1, 2, 3, 4, 5, 6)" in message + else: + assert "qpos_indices=(7, 8)" in message + assert "qvel_indices=(6, 7)" in message + + def test_packed_reset_randomization_fails_closed_without_field_support() -> None: class _MissingFieldBackend(_TensorResetBackend): def get_tensor_capabilities(self): From 08140ad4b430220cdd01451f7c63efcfdfd797e5 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 18:56:25 +0800 Subject: [PATCH 2/9] test: verify reset column cache with CUDA graphs --- tests/base/test_reset_state.py | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/base/test_reset_state.py b/tests/base/test_reset_state.py index b7254eeab..8a8904300 100644 --- a/tests/base/test_reset_state.py +++ b/tests/base/test_reset_state.py @@ -573,6 +573,91 @@ def fail_as_tensor(*_args, **_kwargs): assert "qvel_indices=(6, 7)" in message +@pytest.mark.slow +@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA graph capture requires CUDA") +@pytest.mark.parametrize("state_kind", ["root", "joint"]) +def test_packed_column_cache_real_cuda_capture_replay(state_kind: str) -> None: + device = torch.device("cuda") + transaction = _transaction(_TensorResetBackend()) + transaction.declare_packed_reset_device(device) + transaction._ensure_packed_state_default("cuda_capture") + if state_kind == "root": + layouts = tuple( + (tuple(range(offset, offset + 7)), tuple(range(offset, offset + 6))) + for offset in range(3) + ) + else: + layouts = ( + ((7,), (6,)), + ((8,), (7,)), + ((7, 8), (6, 7)), + ) + + def resolve_columns( + layout: tuple[tuple[int, ...], tuple[int, ...]], + ) -> tuple[torch.Tensor, torch.Tensor]: + qpos_indices, qvel_indices = layout + if state_kind == "root": + return transaction._tensor_root_columns_for_layout( + RootStateLayout(qpos_indices, qvel_indices), term_name="cuda_capture" + ) + return transaction._tensor_joint_columns_for_indices( + np.asarray(qpos_indices), + np.asarray(qvel_indices), + term_name="cuda_capture", + ) + + cached = [resolve_columns(layout) for layout in layouts] + cached_addresses = [tuple(column.data_ptr() for column in columns) for columns in cached] + outputs = [ + ( + torch.empty(len(layout[0]), dtype=torch.int64, device=device), + torch.empty(len(layout[1]), dtype=torch.int64, device=device), + ) + for layout in layouts + ] + replay_count = torch.zeros((), dtype=torch.int64, device=device) + + def record_columns() -> None: + replay_count.add_(1) + for index in (2, 0, 1): + qpos_columns, qvel_columns = resolve_columns(layouts[index]) + outputs[index][0].copy_(qpos_columns) + outputs[index][1].copy_(qvel_columns) + + stream = torch.cuda.Stream(device) + stream.wait_stream(torch.cuda.current_stream(device)) + with torch.cuda.stream(stream): + record_columns() + torch.cuda.current_stream(device).wait_stream(stream) + torch.cuda.synchronize(device) + replay_count.zero_() + for qpos_output, qvel_output in outputs: + qpos_output.zero_() + qvel_output.zero_() + + graph = torch.cuda.CUDAGraph() + with torch.cuda.graph(graph): + assert torch.cuda.is_current_stream_capturing() + record_columns() + + for expected_replays in (1, 2): + graph.replay() + torch.cuda.synchronize(device) + assert replay_count.item() == expected_replays + for (qpos_output, qvel_output), layout in zip(outputs, layouts, strict=True): + torch.testing.assert_close(qpos_output, torch.tensor(layout[0], device=device)) + torch.testing.assert_close(qvel_output, torch.tensor(layout[1], device=device)) + assert [tuple(column.data_ptr() for column in columns) for columns in cached] == ( + cached_addresses + ) + + for layout, cached_columns in zip(layouts, cached, strict=True): + columns = resolve_columns(layout) + assert columns[0] is cached_columns[0] + assert columns[1] is cached_columns[1] + + def test_packed_reset_randomization_fails_closed_without_field_support() -> None: class _MissingFieldBackend(_TensorResetBackend): def get_tensor_capabilities(self): From 1f51bf7607f01d800a675fd2069ef566e6e14353 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 19:10:29 +0800 Subject: [PATCH 3/9] fix(env): guard captured read tensor addresses --- docs/sphinx/source/changelog.md | 17 +++ .../1-training/8-sync_free_autoreset.md | 16 +++ src/unilab/base/autoreset_graph.py | 14 +- src/unilab/base/entity.py | 133 +++++++++++++++++- src/unilab/envs/manager_based_rl_env.py | 9 +- tests/base/test_entity_tensor_read_plan.py | 76 ++++++++++ tests/envs/test_fixed_shape_autoreset.py | 127 +++++++++++++++++ 7 files changed, 384 insertions(+), 8 deletions(-) diff --git a/docs/sphinx/source/changelog.md b/docs/sphinx/source/changelog.md index b63bfedbb..636e6ff0d 100644 --- a/docs/sphinx/source/changelog.md +++ b/docs/sphinx/source/changelog.md @@ -13,6 +13,23 @@ UniLab 遵循[语义化版本](https://semver.org/)。本共享页面以中英 PyPI 版本变更与未发布变更;发布日期采用 PyPI 上传日期。完整提交历史请参阅 [UniLab 仓库](https://github.com/unilabsim/UniLab)。 +## Unreleased + +### Fixed / 修复 + +- Autoreset CUDA graphs now fail closed when a tensor read by the captured + segment changes storage address. The scene read plan records actual body, + sensor, site and custom packet reads through the existing replay-guard + lifecycle, checks them during early replays and on the first replay after + every refresh, and probes device-resident sensor addresses twice at + graph-enabled environment construction + ([#2686](https://github.com/Motphys/UniLab/issues/2686)). + autoreset CUDA 图捕获段读取的张量存储地址发生变化时现在会 fail closed。场景 + read plan 通过现有 replay guard 生命周期记录实际发生的 body、sensor、site + 与自定义 packet 读取,在早期 replay 及每次 refresh 后的首次 replay 前检查地址, + 并在启用图的环境构造期对 device-resident sensor 进行两次地址探测 + ([#2686](https://github.com/Motphys/UniLab/issues/2686))。 + ## 1.6.5 (2026-12-03) ### Fixed / 修复 diff --git a/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md b/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md index f8ae396fd..d4824d971 100644 --- a/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md +++ b/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md @@ -119,6 +119,22 @@ lower bound, must be declared with re-applies these transitions after every replay. Undeclared host state keeps the value it had at capture time. +**Tensor addresses under graph replay.** A CUDA graph records the storage +address of every tensor read by the captured segment. Read-plan packet tensors, +including named sensors, body blocks, site carriers, joint state and custom term +packet reads, must keep the same address across refreshes and replays; refresh +their values in place rather than rebinding the packet to a new tensor. A tensor +created afresh on every step is capture-safe only when it is both created and +consumed inside the captured segment. + +When `autoreset_cuda_graph` is enabled, the read plan probes each device-resident +sensor across two construction-time refreshes and rejects unstable storage. +During capture it records the packet and site-carrier addresses actually read. +The existing replay-guard lifecycle compares them during early replays and on +the first replay after every refresh, and raises `GraphCaptureError` before +replay if an address changes. The guard checks addresses only; it does not synchronize or read tensor +values from the device. + ## Step-output ownership On both the eager and fixed-shape paths, `state.obs`, `state.reward`, diff --git a/src/unilab/base/autoreset_graph.py b/src/unilab/base/autoreset_graph.py index 5a749a0d4..488223cd0 100644 --- a/src/unilab/base/autoreset_graph.py +++ b/src/unilab/base/autoreset_graph.py @@ -15,10 +15,11 @@ capture stream and returns an ``ExternalGraphCapture`` handle, which the env binds so that env/manager host transitions record on the same handle as the backend's own. -3. Capture records device work without executing it, so the graph is replayed - once immediately; the host transitions already ran during capture. -4. Every later call checks the backend's replay guards, replays the graph and - re-applies the recorded host transitions in recording order. +3. Capture records device work without executing it, so replay guards are + checked and the graph is replayed once immediately; the host transitions + already ran during capture. +4. Every later call checks the replay guards, replays the graph and re-applies + the recorded host transitions in recording order. 5. No finalizer runs inside the capture. The body allocates enough to trigger the cyclic collector there, and finalizing a previously closed owner is a capture-unsafe runtime call, so pending cyclic garbage is collected first @@ -148,10 +149,11 @@ def _capture_and_run(self) -> None: raise GraphCaptureError(f"autoreset graph capture failed: {exc}") from exc current.wait_stream(stream) assert capture is not None - self._graph = graph - self._capture = capture # Capture recorded the device work without executing it; the host # transitions already ran once during capture. + capture.check_replay_guards() + self._graph = graph + self._capture = capture graph.replay() self.replays += 1 diff --git a/src/unilab/base/entity.py b/src/unilab/base/entity.py index 0027cee4f..f876546b8 100644 --- a/src/unilab/base/entity.py +++ b/src/unilab/base/entity.py @@ -31,6 +31,7 @@ TensorProcessTopology, torch_device_matches, ) +from unisim.backend.graph_capture import ExternalGraphCapture, GraphCaptureError from unisim.dr.interval import ( INTERVAL_TERM_BODY_ANGULAR_VELOCITY_DELTA, INTERVAL_TERM_BODY_FORCE, @@ -439,6 +440,30 @@ def _site_state_from_parent_bodies( } +class _ObservedPacket(Mapping[str, torch.Tensor]): + def __init__( + self, + values: Mapping[str, torch.Tensor], + on_read: Callable[[str, torch.Tensor], None], + ) -> None: + self._values = values + self._on_read = on_read + + def __getitem__(self, name: str) -> torch.Tensor: + value = self._values[name] + self._on_read(name, value) + return value + + def __iter__(self) -> Iterator[str]: + return iter(self._values) + + def __len__(self) -> int: + return len(self._values) + + +_CAPTURE_ADDRESS_REPLAY_CHECKS = 8 + + class SceneTensorReadPlan: """Phase-scoped packed tensor reads for one ``EntityScene``. @@ -514,6 +539,45 @@ def __init__( self._contact_reads_ready = False self._refreshed = False self._closed = False + self._active_graph_capture: ExternalGraphCapture | None = None + self._capture_read_addresses: dict[str, tuple[int, Callable[[], torch.Tensor | None]]] = {} + self._capture_address_checks = 0 + self._capture_address_check_pending = False + + def bind_graph_capture(self, capture: ExternalGraphCapture | None) -> None: + """Bind an autoreset capture and record its packet and site-carrier reads.""" + if capture is None: + self._active_graph_capture = None + self._packet = MappingProxyType(dict(self._packet)) + return + self._require_not_closed() + self._active_graph_capture = capture + self._aggregate_body_views.clear() + self._capture_read_addresses.clear() + self._capture_address_checks = 0 + self._capture_address_check_pending = False + self._packet = _ObservedPacket(self._packet, self._record_capture_packet_read) + + def validate_capture_sensor_addresses(self) -> None: + """Fail during construction if a device-resident sensor changes storage on refresh.""" + self._require_not_closed() + if self._host_plan_value is not None or not self._packet_sensor_owners: + return + try: + self.refresh() + addresses = {name: self._packet[name].data_ptr() for name in self._packet_sensor_owners} + self.refresh() + for name, captured in addresses.items(): + current = self._packet[name].data_ptr() + if current != captured: + raise GraphCaptureError( + f"backend '{self._scene._backend.backend_type}' sensor '{name}' " + "does not have stable tensor storage across read-plan refreshes " + f"(0x{captured:x} != 0x{current:x}); it cannot participate in " + "autoreset graph capture" + ) + finally: + self.invalidate() @property def scene(self) -> "EntityScene": @@ -619,6 +683,61 @@ def _compile_site_layout( static=frames.static.unsqueeze(1) if any(static) else None, ) + def _current_packet_value(self, name: str) -> torch.Tensor | None: + return self._packet.get(name) + + def _current_site_value(self, owner: "Entity", field: str) -> torch.Tensor: + return getattr(owner.data._site_carrier_view(), field) + + def _record_capture_packet_read(self, name: str, value: torch.Tensor) -> None: + self._record_capture_read( + f"packet:{name}", value, partial(self._current_packet_value, name) + ) + + def _record_capture_read( + self, + name: str, + value: torch.Tensor, + current: Callable[[], torch.Tensor | None], + ) -> None: + capture = self._active_graph_capture + if capture is None: + return + address = value.data_ptr() + previous = self._capture_read_addresses.get(name) + if previous is not None: + if previous[0] != address: + raise GraphCaptureError( + f"autoreset graph capture read '{name}' changed tensor storage " + f"from 0x{previous[0]:x} to 0x{address:x} during capture" + ) + return + self._capture_read_addresses[name] = (address, current) + if len(self._capture_read_addresses) == 1: + capture.record_replay_guard("scene.tensor_read_addresses", self._capture_address_guard) + + def _capture_address_guard(self) -> str | None: + check = ( + self._capture_address_check_pending + or self._capture_address_checks < _CAPTURE_ADDRESS_REPLAY_CHECKS + ) + self._capture_address_check_pending = False + if not check: + return None + self._capture_address_checks += 1 + for name, (captured, current) in self._capture_read_addresses.items(): + value = current() + if value is None: + return f"captured read '{name}' has no published tensor" + address = value.data_ptr() + if address != captured: + return ( + f"captured read '{name}' changed tensor storage from 0x{captured:x} " + f"to 0x{address:x}; backend '{self._scene._backend.backend_type}' " + "must keep captured read addresses stable" + ) + return None + def site_tensor_view( self, entity: "str | Entity", site_names: Sequence[str] | None = None ) -> EntityTensorSiteStateView: @@ -665,6 +784,12 @@ def site_tensor_view( } return EntityTensorSiteStateView(site_names=(), **empty) published = owner.data._site_carrier_view() + for field in _TENSOR_SITE_FIELD_WIDTHS: + self._record_capture_read( + f"site:{owner.name}.{field}", + getattr(published, field), + partial(self._current_site_value, owner, field), + ) if requested == published.site_names: return published columns = torch.tensor( @@ -1514,10 +1639,16 @@ def _publish_packet(self, packet: dict[str, torch.Tensor]) -> None: self._body_packet_buffers[name] = carrier carrier.copy_(value) packet[name] = carrier - self._packet = MappingProxyType(packet) + self._packet = ( + MappingProxyType(packet) + if self._active_graph_capture is None + else _ObservedPacket(packet, self._record_capture_packet_read) + ) self._aggregate_body_views.clear() self._refreshed = True self._publish_site_states() + if self._capture_read_addresses: + self._capture_address_check_pending = True def _require_open(self) -> None: if self._closed: diff --git a/src/unilab/envs/manager_based_rl_env.py b/src/unilab/envs/manager_based_rl_env.py index a32ef4af0..084948a81 100644 --- a/src/unilab/envs/manager_based_rl_env.py +++ b/src/unilab/envs/manager_based_rl_env.py @@ -25,7 +25,7 @@ TensorLifecycleCapabilities, TensorProcessTopology, ) -from unisim.backend.graph_capture import GraphCaptureError +from unisim.backend.graph_capture import ExternalGraphCapture, GraphCaptureError from unilab.base.backend_factory import ( SELECTIVE_TRACKED_BODY_BACKENDS, @@ -568,6 +568,13 @@ def _compile_tensor_read_plan(self) -> None: if specs or body_pair_specs else None ) + if self._autoreset_cuda_graph and self.scene.read_plan is not None: + self.scene.read_plan.validate_capture_sensor_addresses() + + def _bind_graph_capture(self, capture: ExternalGraphCapture | None) -> None: + super()._bind_graph_capture(capture) + if self.scene.read_plan is not None: + self.scene.read_plan.bind_graph_capture(capture) def _site_tensor_read_specs(self) -> list[SceneTensorReadSpec]: """Publish every declared entity site in the packed phase. diff --git a/tests/base/test_entity_tensor_read_plan.py b/tests/base/test_entity_tensor_read_plan.py index ff91ab6ca..245aa0a42 100644 --- a/tests/base/test_entity_tensor_read_plan.py +++ b/tests/base/test_entity_tensor_read_plan.py @@ -20,6 +20,7 @@ TensorProcessTopology, TrackedBodyStateViews, ) +from unisim.backend.graph_capture import ExternalGraphCapture, GraphCaptureError from unilab.base.entity import ( EntityCfg, @@ -575,6 +576,81 @@ def test_device_resident_body_packets_keep_fixed_addresses_across_refreshes() -> plan.close() +def test_capture_sensor_probe_rejects_storage_that_changes_on_refresh() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + get_sensor_view = backend.get_sensor_view + + def unstable_sensor_view(name: str, device="cpu") -> torch.Tensor: + return get_sensor_view(name, device).clone() + + backend.get_sensor_view = unstable_sensor_view # type: ignore[method-assign] + with pytest.raises(GraphCaptureError, match=r"sensor 'imu_gyro'.*stable tensor storage"): + plan.validate_capture_sensor_addresses() + assert not plan.ready + + +def test_capture_guard_covers_body_sensor_and_direct_packet_reads() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + capture = ExternalGraphCapture(torch_stream=None) + plan.bind_graph_capture(capture) + try: + plan.refresh() + plan.body_tensor_view("robot") + plan.sensor_tensor_views("robot", ("imu_gyro",)) + custom = plan._packet["qpos"] + assert custom.data_ptr() == backend.qpos.data_ptr() + assert { + "packet:body_pos_w", + "packet:imu_gyro", + "packet:qpos", + } <= set(plan._capture_read_addresses) + capture.check_replay_guards() + + backend.qpos = backend.qpos.clone() + plan.refresh() + with pytest.raises(GraphCaptureError, match=r"packet:qpos.*changed tensor storage"): + capture.check_replay_guards() + finally: + plan.bind_graph_capture(None) + + +def test_capture_guard_rechecks_sensor_addresses_after_every_refresh() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + capture = ExternalGraphCapture(torch_stream=None) + plan.bind_graph_capture(capture) + try: + plan.refresh() + plan.sensor_tensor_views("robot", ("imu_gyro",)) + for _ in range(16): + capture.check_replay_guards() + + backend.sensors["imu_gyro"] = backend.sensors["imu_gyro"].clone() + plan.refresh() + with pytest.raises(GraphCaptureError, match=r"packet:imu_gyro.*changed tensor storage"): + capture.check_replay_guards() + finally: + plan.bind_graph_capture(None) + + +def test_capture_rejects_a_sensor_rebound_between_captured_reads() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + capture = ExternalGraphCapture(torch_stream=None) + plan.bind_graph_capture(capture) + try: + plan.refresh() + plan.sensor_tensor_views("robot", ("imu_gyro",)) + backend.sensors["imu_gyro"] = backend.sensors["imu_gyro"].clone() + plan.refresh() + with pytest.raises(GraphCaptureError, match=r"packet:imu_gyro.*during capture"): + plan.sensor_tensor_views("robot", ("imu_gyro",)) + finally: + plan.bind_graph_capture(None) + + def test_device_resident_scene_plan_reuses_aggregate_body_views() -> None: backend = _SceneTensorBackend(device_resident=True) scene = _scene(backend) diff --git a/tests/envs/test_fixed_shape_autoreset.py b/tests/envs/test_fixed_shape_autoreset.py index 3048d90f6..671384c25 100644 --- a/tests/envs/test_fixed_shape_autoreset.py +++ b/tests/envs/test_fixed_shape_autoreset.py @@ -15,6 +15,7 @@ from dataclasses import dataclass from typing import Any, cast +import numpy as np import pytest import torch from unisim.backend.base import ( @@ -26,6 +27,7 @@ TensorProcessTopology, ) from unisim.backend.graph_capture import ExternalGraphCapture, GraphCaptureError, closing_capture +from unisim.ray_query import RaySiteFrameDescription from tests.envs.test_manager_based_rl_env import _ResetBackend from unilab.base.autoreset_graph import AutoresetGraph @@ -87,6 +89,8 @@ def get_tensor_capabilities(self) -> TensorLifecycleCapabilities: execution=TensorExecution.DEVICE_RESIDENT, state_views=True, state_fields=frozenset({"qpos", "qvel"}), + sensor_views=True, + tracked_body_views=True, stepping=True, selected_reset=True, mask_selected_reset=True, @@ -138,6 +142,38 @@ def torch_graph_capture_scope( yield capture +class _ReadPlanTensorBackend(_TensorBackend): + def __init__(self, num_envs: int, device: str, *, unstable_sensor: bool = False) -> None: + super().__init__(num_envs, device) + self.imu = torch.zeros((num_envs, 3), dtype=torch.float32, device=self.device) + self.unstable_sensor = unstable_sensor + + def get_sensor_names(self) -> tuple[str, ...]: + return ("imu",) + + def get_sensor_view(self, name: str, device=None) -> torch.Tensor: + if name == "imu": + return self.imu.clone() if self.unstable_sensor else self.imu + return super().get_sensor_view(name, device) + + def get_site_ids(self, names) -> np.ndarray: + if tuple(names) != ("tip",): + raise KeyError(names) + return np.asarray([0], dtype=np.int32) + + def get_ray_site_frames(self, site_names) -> tuple[RaySiteFrameDescription, ...]: + if tuple(site_names) != ("tip",): + raise KeyError(site_names) + return ( + RaySiteFrameDescription( + site_name="tip", + body_name="base", + pos=(0.0, 0.0, 0.0), + quat=(1.0, 0.0, 0.0, 0.0), + ), + ) + + # --------------------------------------------------------------------------- # Selection-capable manager terms # --------------------------------------------------------------------------- @@ -237,6 +273,23 @@ def _policy_obs(env: ManagerBasedRlEnv) -> torch.Tensor: ) +def _packet_obs(env: ManagerBasedRlEnv) -> torch.Tensor: + plan = env.scene.read_plan + if plan is None: + return torch.zeros((env.num_envs, 10), dtype=torch.float32, device=env.device) + body = plan.body_tensor_view("robot") + sensor = plan.sensor_tensor_views("robot", ("imu",)).values["imu"] + site = plan.site_tensor_view("robot") + custom = plan._packet["qpos"][:, :1] + assert body.pos_w is not None + return torch.cat((body.pos_w.flatten(1), sensor, site.pos_w.flatten(1), custom), dim=1) + + +_packet_obs.tensor_sensor_names = ("imu",) # type: ignore[attr-defined] +_packet_obs.tensor_body_names = ("base",) # type: ignore[attr-defined] +_packet_obs.entity_name = "robot" # type: ignore[attr-defined] + + def _critic_obs(env: ManagerBasedRlEnv) -> torch.Tensor: return env.episode_length_buf[:, None].to(torch.float32) @@ -318,6 +371,25 @@ def _make_env(device: str, **overrides: Any) -> tuple[ManagerBasedRlEnv, _Tensor return env, backend +def _make_read_plan_env( + *, unstable_sensor: bool = False +) -> tuple[ManagerBasedRlEnv, _ReadPlanTensorBackend]: + backend = _ReadPlanTensorBackend(NUM_ENVS, "cuda", unstable_sensor=unstable_sensor) + cfg = _make_cfg("cuda", autoreset_cuda_graph=True, autoreset_graph_warmup=1) + assert cfg.scene is not None + cfg.scene.entities["robot"] = EntityCfg( + joint_names=("joint",), + body_names=("base",), + site_names=("tip",), + actuator_names=("motor",), + ) + cfg.observations["actor"] = ObservationGroupCfg( + terms={"packets": ObservationTermCfg(func=_packet_obs)} + ) + env = ManagerBasedRlEnv(cfg, cast(SimBackend, backend), NUM_ENVS) + return env, backend + + def _actions(device: str, steps: int) -> list[torch.Tensor]: """Random actions; row 0 fails on every step. @@ -704,6 +776,61 @@ def test_autoreset_graph_replay_matches_eager_masked_autoreset() -> None: assert any(bool((snap["terminated"] | snap["truncated"]).any()) for snap in graphed[3:]) +@cuda_only +def test_captured_read_plan_addresses_cover_body_sensor_site_and_custom_reads() -> None: + env, backend = _make_read_plan_env() + try: + env.reset() + for index, action in enumerate(_actions("cuda", 12)): + allocator_phase = [ + torch.empty((257 * (index + 1), 3 + offset), device="cuda") for offset in range(3) + ] + state = env.step(action) + assert all(torch.isfinite(value).all() for value in state.obs.values()) + del allocator_phase + + graph = env.autoreset_graph + plan = env.scene.read_plan + assert graph is not None and graph.captured + assert plan is not None + assert backend.capture_scopes == 1 + assert { + "packet:body_pos_w", + "packet:imu", + "packet:qpos", + "site:robot.pos_w", + } <= set(plan._capture_read_addresses) + finally: + env.close() + + +@cuda_only +def test_rebound_sensor_fails_before_captured_autoreset_replay() -> None: + env, backend = _make_read_plan_env() + try: + env.reset() + for action in _actions("cuda", 3): + env.step(action) + graph = env.autoreset_graph + assert graph is not None and graph.captured + replays = graph.replays + + backend.unstable_sensor = True + allocator_phase = [torch.empty((4096, 7), device="cuda") for _ in range(4)] + with pytest.raises(GraphCaptureError, match=r"packet:imu.*changed tensor storage"): + env.step(_actions("cuda", 4)[-1]) + assert graph.replays == replays + del allocator_phase + finally: + env.close() + + +@cuda_only +def test_unstable_sensor_fails_during_graph_enabled_env_construction() -> None: + with pytest.raises(GraphCaptureError, match=r"sensor 'imu'.*stable tensor storage"): + _make_read_plan_env(unstable_sensor=True) + + @cuda_only def test_graphed_masked_step_never_synchronizes_inside_the_autoreset() -> None: env, _ = _make_env( From 51d2bb75a982c64b396231a67ce9fc63be6b7cd9 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 19:16:01 +0800 Subject: [PATCH 4/9] fix(env): publish masked autoreset reset diagnostics (#2688) --- docs/sphinx/source/changelog.md | 17 ++ .../1-training/8-sync_free_autoreset.md | 40 ++-- src/unilab/base/backend_timing.py | 7 + src/unilab/base/reset_diagnostics.py | 151 +++++++++++++++ src/unilab/base/reset_state.py | 13 +- src/unilab/base/torch_env.py | 95 +++++++--- src/unilab/envs/manager_based_rl_env.py | 113 ++++++----- src/unilab/managers/command_manager.py | 143 +++++++------- .../motion_tracking/common/manager_terms.py | 175 ++++++++++-------- tests/base/test_reset_diagnostics.py | 61 ++++++ tests/envs/test_fixed_shape_autoreset.py | 76 ++++++++ 11 files changed, 650 insertions(+), 241 deletions(-) create mode 100644 src/unilab/base/reset_diagnostics.py create mode 100644 tests/base/test_reset_diagnostics.py diff --git a/docs/sphinx/source/changelog.md b/docs/sphinx/source/changelog.md index b63bfedbb..e3b0ec744 100644 --- a/docs/sphinx/source/changelog.md +++ b/docs/sphinx/source/changelog.md @@ -13,6 +13,23 @@ UniLab 遵循[语义化版本](https://semver.org/)。本共享页面以中英 PyPI 版本变更与未发布变更;发布日期采用 PyPI 上传日期。完整提交历史请参阅 [UniLab 仓库](https://github.com/unilabsim/UniLab)。 +## Unreleased / 未发布 + +### Fixed / 修复 + +- Fixed-shape masked autoreset now accumulates reset row counts and reset-done + phase timings in persistent device buffers and drains them with episode logs + at each finite-validation poll. Non-poll steps use explicit zero placeholders; + CUDA graph replays contribute device-clock phase timings without adding a + hot-path host/device synchronization, while the selected-row path keeps its + per-reset semantics + ([#2688](https://github.com/Motphys/UniLab/issues/2688)). + fixed-shape masked autoreset 现在通过 device 侧持久缓冲累加 reset 行数和各阶段 + 耗时,并在 finite-validation poll 边界与 episode 日志一起发布。非 poll 步使用 + 明确的零占位;CUDA graph 重放会累计 device-clock 分段耗时,热路径无需新增 + host/device 同步;selected-row 路径仍保持逐次 reset 的发布语义 + ([#2688](https://github.com/Motphys/UniLab/issues/2688))。 + ## 1.6.5 (2026-12-03) ### Fixed / 修复 diff --git a/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md b/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md index f8ae396fd..0186403e5 100644 --- a/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md +++ b/docs/sphinx/source/en/2-user_guide/1-training/8-sync_free_autoreset.md @@ -98,19 +98,33 @@ the faulty step. Packed-reset failures name the poll step (`first detected at poll boundary, step N`). To localize a fault, rerun with `env.finite_validation_interval=1` so every step is a poll boundary. -**Stale diagnostic counters.** On the fixed-shape path the env has no -host-side reset row count or per-phase split. Consequences: - -- The per-reset detail keys in `info["timing"]` - (`RESET_DONE_DETAIL_TIMING_KEYS` in `src/unilab/base/backend_timing.py`, for - example `reset_done_count`) are written as `0` on every step. Only - `reset_done_reset_call_ms` is filled. A `0` there does not mean that no row - reset. -- Episode logs (`Episode_Termination/*`, `Episode_Metrics/*` and command reset - metrics) accumulate on the device. They are published into `info["log"]` - only at the deferred-validation poll, and each value covers every episode - that completed since the previous poll. Read them as interval aggregates, - not per-step values. +**Reset diagnostics and episode logs use poll intervals.** Fixed-shape reset +counters and phase timings accumulate in persistent device buffers without a +host read in the step hot path. At each deferred-validation poll, +`RESET_DONE_DETAIL_TIMING_KEYS` in `src/unilab/base/backend_timing.py` are +drained into `info["timing"]` and the accumulators restart from zero: + +- `reset_done_count` is the total number of reset rows in the interval. The + other `*_count` keys sum their per-reset invocation counts (for example, + active event terms or sampler dispatches); they are not row counts. +- `*_ms` keys sum phase elapsed time over every fixed-shape reset in the + interval. CPU uses wall-clock spans; eager CUDA combines existing host owner + timings with device spans; captured CUDA uses device-clock spans for every + published env-owned phase, including graph replays. The outer + `reset_done_reset_call_ms` overlaps its nested phases by design. +- Steps between polls publish `0` for every detail key as a no-publication + placeholder. Do not interpret those zeros as an empty interval. At a poll, + zero instead means no accumulated work or that the key has no producer on + the current path (the same N/A convention as the selected-row schema). + Backend-returned host-only nested `set_state_*` sub-timings cannot be + replayed by a CUDA graph and stay N/A there; use the device-timed + `dr_reset_set_state_ms` and higher-level reset phases for graph attribution. + +Episode logs (`Episode_Termination/*`, `Episode_Metrics/*` and command reset +metrics) drain at the same poll into `info["log"]`. Each value covers every +episode that completed since the previous poll, not just the current step. +With `autoreset_cuda_graph=false`, the selected-row lifecycle and its per-reset +publication semantics are unchanged. **Host state under graph replay.** A CUDA graph replays device work only. Python state that the reset segment changes, such as a pending-metrics flag or a host diff --git a/src/unilab/base/backend_timing.py b/src/unilab/base/backend_timing.py index c821412cb..245e47717 100644 --- a/src/unilab/base/backend_timing.py +++ b/src/unilab/base/backend_timing.py @@ -3,6 +3,13 @@ These keys are consumed by environment runtimes and benchmark tooling. They are owned here rather than by a particular NumPy or Torch environment base so the runtime migration cannot change the metric schema accidentally. + +Selected-row resets publish one invocation. Fixed-shape masked resets drain +interval sums at the finite-validation poll: ``reset_done_count`` sums reset +rows, other ``*_count`` keys sum their per-invocation counts, and ``*_ms`` keys +sum phase elapsed time. Non-poll steps carry zero placeholders. At a poll, zero +means no accumulated work or no producer on that path; it is not a fabricated +measurement for an unsupported phase. """ from __future__ import annotations diff --git a/src/unilab/base/reset_diagnostics.py b/src/unilab/base/reset_diagnostics.py new file mode 100644 index 000000000..fb3ddc78d --- /dev/null +++ b/src/unilab/base/reset_diagnostics.py @@ -0,0 +1,151 @@ +"""Device-resident interval diagnostics for fixed-shape autoreset.""" + +from __future__ import annotations + +import time +from collections.abc import Callable, Iterator, Mapping +from contextlib import AbstractContextManager, contextmanager, nullcontext +from functools import lru_cache +from typing import Any, cast + +import torch + +from unilab.base.backend_timing import RESET_DONE_DETAIL_TIMING_KEYS + +_TOTAL_KEY = "reset_done_total_ms" +_CLOCK_SOURCE = r""" +extern "C" __global__ void record_clock(unsigned long long* output) { + unsigned long long now; + asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(now)); + output[0] = now; +} +extern "C" __global__ void accumulate_clock( + const unsigned long long* start, + double* total, + double* latest +) { + unsigned long long now; + asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(now)); + double elapsed = (double)(now - start[0]) * 1.0e-6; + total[0] += elapsed; + latest[0] = elapsed; +} +""" + + +@lru_cache(maxsize=None) +def _clock_kernels(device_index: int) -> tuple[Any, Any]: + compile_kernel = getattr(torch.cuda, "_compile_kernel", None) + if not callable(compile_kernel): + raise RuntimeError( + "fixed-shape CUDA reset timing requires torch.cuda._compile_kernel; " + "CUDA events cannot accumulate elapsed time on the device" + ) + with torch.cuda.device(device_index): + return ( + compile_kernel(_CLOCK_SOURCE, "record_clock"), + compile_kernel(_CLOCK_SOURCE, "accumulate_clock"), + ) + + +class ResetDoneDiagnostics: + """Accumulate reset counters and phase timings without hot-path host reads.""" + + def __init__(self, device: torch.device) -> None: + self._device = device + self._keys = (*RESET_DONE_DETAIL_TIMING_KEYS, _TOTAL_KEY) + self._indices = {key: index for index, key in enumerate(self._keys)} + self._totals = torch.zeros(len(self._keys), dtype=torch.float64, device=device) + self._latest = torch.zeros_like(self._totals) + self._starts = torch.zeros(len(self._keys), dtype=torch.int64, device=device) + self._cpu_starts = [0] * len(self._keys) + self._instrumented: set[str] = set() + + def begin(self) -> None: + """Start one reset invocation without clearing the interval totals.""" + self._instrumented.clear() + + @contextmanager + def measure(self, *keys: str) -> Iterator[None]: + """Accumulate one wall/device span into each named timing key.""" + if not keys: + raise ValueError("reset timing measurement requires at least one key") + primary = keys[0] + start_index = self._indices[primary] + self._instrumented.update(keys) + if self._device.type == "cuda": + record, accumulate = _clock_kernels(self._device.index or 0) + start = self._starts[start_index] + record(grid=(1, 1, 1), block=(1, 1, 1), args=[start]) + try: + yield + finally: + for key in keys: + index = self._indices[key] + accumulate( + grid=(1, 1, 1), + block=(1, 1, 1), + args=[start, self._totals[index], self._latest[index]], + ) + return + self._cpu_starts[start_index] = time.perf_counter_ns() + try: + yield + finally: + elapsed = (time.perf_counter_ns() - self._cpu_starts[start_index]) / 1.0e6 + for key in keys: + index = self._indices[key] + self._totals[index].add_(elapsed) + self._latest[index].fill_(elapsed) + + def add_count(self, key: str, value: int | float | torch.Tensor) -> None: + """Add a count whose value is already known without a device read.""" + if not key.endswith("_count"): + raise ValueError(f"reset diagnostic {key!r} is not a count") + self._instrumented.add(key) + self._totals[self._indices[key]].add_(value) + + def add_host_timings(self, timing: Mapping[str, float]) -> None: + """Add current eager host timings, excluding explicitly measured phases.""" + for key, value in timing.items(): + if key in self._instrumented or key not in self._indices: + continue + self._totals[self._indices[key]].add_(float(value)) + + def record_internal_gap(self, attributed: tuple[str, ...]) -> None: + """Record the total-span residual after the attributed reset phases.""" + index = self._indices["reset_done_internal_gap_ms"] + elapsed = self._latest[index] + elapsed.copy_(self._latest[self._indices[_TOTAL_KEY]]) + for key in attributed: + elapsed.sub_(self._latest[self._indices[key]]) + self._totals[index].add_(elapsed) + self._instrumented.add("reset_done_internal_gap_ms") + + def publish(self) -> dict[str, float]: + """Drain the completed interval at the environment's host poll boundary.""" + values = self._totals.detach().cpu().tolist() + self._totals.zero_() + return { + key: float(value) + for key, value in zip(self._keys, values, strict=True) + if key != _TOTAL_KEY + } + + +def measure_reset_done(env: Any, *keys: str) -> AbstractContextManager[None]: + """Use the env's optional reset timing protocol or a no-op context.""" + measure = getattr(env, "measure_reset_done", None) + if measure is None: + return nullcontext() + return cast("Callable[..., AbstractContextManager[None]]", measure)(*keys) + + +def record_reset_done_count(env: Any, key: str, value: int | float | torch.Tensor) -> None: + """Use the env's optional reset count protocol when it is available.""" + record = getattr(env, "record_reset_done_count", None) + if record is not None: + record(key, value) + + +__all__ = ["ResetDoneDiagnostics", "measure_reset_done", "record_reset_done_count"] diff --git a/src/unilab/base/reset_state.py b/src/unilab/base/reset_state.py index b8bdd7842..f75f3e498 100644 --- a/src/unilab/base/reset_state.py +++ b/src/unilab/base/reset_state.py @@ -11,7 +11,7 @@ import time from collections.abc import Callable, Iterator -from contextlib import contextmanager +from contextlib import AbstractContextManager, contextmanager, nullcontext from typing import TYPE_CHECKING, Any, cast import numpy as np @@ -300,9 +300,12 @@ def declare_packed_reset_device(self, device: torch.device) -> None: @contextmanager def scoped_device_event_tensor( - self, reset_mask: torch.Tensor + self, + reset_mask: torch.Tensor, + *, + measure: Callable[[str], AbstractContextManager[None]] | None = None, ) -> Iterator[ResetStateTransaction]: - """Begin a fixed-width owner reset and commit it.""" + """Begin a fixed-width owner reset and optionally time its commit.""" self.begin_tensor(reset_mask) try: yield self @@ -310,7 +313,9 @@ def scoped_device_event_tensor( self.abort() raise else: - self.commit_tensor() + timer = nullcontext() if measure is None else measure("dr_reset_set_state_ms") + with timer: + self.commit_tensor() @contextmanager def scoped_device_owner_tensor( diff --git a/src/unilab/base/torch_env.py b/src/unilab/base/torch_env.py index 44ebb10f3..24fa5f904 100644 --- a/src/unilab/base/torch_env.py +++ b/src/unilab/base/torch_env.py @@ -11,6 +11,7 @@ import dataclasses import sys from collections.abc import Callable, Mapping +from contextlib import AbstractContextManager, nullcontext from dataclasses import dataclass from os import PathLike from typing import TYPE_CHECKING, Any, Optional, cast @@ -37,6 +38,7 @@ from unilab.base.base import ABEnv, EnvCfg, EnvPlayCapabilities from unilab.base.cpu_runtime import apply_cpu_confinement from unilab.base.phase_timer import PhaseTimer +from unilab.base.reset_diagnostics import ResetDoneDiagnostics from unilab.base.reset_selection import ResetSelection from unilab.base.scene import SceneCfg from unilab.dtype_config import get_global_dtype @@ -94,6 +96,7 @@ class TorchEnv(ABEnv): _masked_autoreset: bool = False _persistent_step_buffers: bool = False _autoreset_reset_active: bool = False + _reset_done_diagnostics_active: bool = False _reset_selection: ResetSelection | None = None _active_graph_capture: ExternalGraphCapture | None = None _autoreset_graph: AutoresetGraph | None = None @@ -139,11 +142,14 @@ def __init__( self._pending_control_finite_check: torch.Tensor | bool | None = None self._reset_obs_finite_valid = torch.ones((), dtype=torch.bool, device=self._device) self._reset_done_count = torch.zeros((), dtype=torch.int64, device=self._device) + self._reset_done_diagnostics = ResetDoneDiagnostics(self._device) + self._reset_done_interval_published_step = -1 self._tensor_runtime_bound = False self._last_initial_episode_steps: torch.Tensor | None = None self.step_counter = 0 self._autoreset = True self._autoreset_reset_active = False + self._reset_done_diagnostics_active = False self._autoreset_scattered_reset_obs = False self._rgb_array_renderer_ready = False self._nan_guard: "NanGuard | None" = None @@ -341,6 +347,17 @@ def record_host_transition(self, name: str, transition: Callable[[], None]) -> N return capture.record_host_transition(f"env.{name}", transition) + def measure_reset_done(self, *keys: str) -> AbstractContextManager[None]: + """Measure reset phases only inside the active fixed-shape autoreset.""" + if self._reset_done_diagnostics_active: + return self._reset_done_diagnostics.measure(*keys) + return nullcontext() + + def record_reset_done_count(self, key: str, value: int | float | torch.Tensor) -> None: + """Accumulate a known count inside the active fixed-shape autoreset.""" + if self._reset_done_diagnostics_active: + self._reset_done_diagnostics.add_count(key, value) + def reset_selection_blockers(self) -> list[str]: """Reset participants that cannot take a ``ResetSelection``.""" return [f"{type(self).__qualname__} does not implement a ResetSelection reset"] @@ -544,11 +561,10 @@ def _step(self, actions: torch.Tensor) -> TorchEnvState: self.poll_finite_validation() timing = self._state.info.setdefault("timing", {}) - if not did_reset or self._masked_autoreset: - # The fixed-shape path has no host row count or per-phase split. + if not did_reset or ( + self._masked_autoreset and self._reset_done_interval_published_step != self.step_counter + ): self._clear_reset_done_detail_timing(timing) - if did_reset: - timing["reset_done_reset_call_ms"] = timer.wall_ms("reset_done") timing["env_step_total_ms"] = timer.total_wall_ms() timer.publish(timing) timing["env_step_other_cpu_ms"] = timer.residual_cpu_ms() @@ -951,26 +967,44 @@ def _masked_autoreset_body(self) -> None: selection = self._reset_selection assert selection is not None state = self._state + diagnostics = self._reset_done_diagnostics + diagnostics.begin() done = selection.mask - torch.logical_or(state.terminated, state.truncated, out=done) - self._reset_done_count.copy_(done.sum()) - state.info["steps"].masked_fill_(done, 0) - final_observation = self._ensure_final_observation_scratch() - for name, values in state.obs.items(): - final_observation[name].copy_(values) - # step() clears final_observation before update_state on every step. - self.record_host_transition("final_observation", self._publish_final_observation) - self._autoreset_reset_active = True - self._autoreset_scattered_reset_obs = False - try: - new_obs, reset_info = self.reset(selection) # type: ignore[arg-type] - finally: - self._autoreset_reset_active = False - if not self._autoreset_scattered_reset_obs: - self._validate_reset_observation_mask(new_obs) - for name, values in new_obs.items(): - state.obs[name].copy_(torch.where(done[:, None], values, state.obs[name])) - self._scatter_reset_info_mask(reset_info, done) + with diagnostics.measure("reset_done_total_ms"): + torch.logical_or(state.terminated, state.truncated, out=done) + self._reset_done_count.copy_(done.sum()) + diagnostics.add_count("reset_done_count", done.sum()) + with diagnostics.measure("reset_done_terminal_obs_ms"): + state.info["steps"].masked_fill_(done, 0) + final_observation = self._ensure_final_observation_scratch() + for name, values in state.obs.items(): + final_observation[name].copy_(values) + # step() clears final_observation before update_state on every step. + self.record_host_transition("final_observation", self._publish_final_observation) + self._autoreset_reset_active = True + self._reset_done_diagnostics_active = True + self._autoreset_scattered_reset_obs = False + try: + with diagnostics.measure("reset_done_reset_call_ms"): + new_obs, reset_info = self.reset(selection) # type: ignore[arg-type] + finally: + self._autoreset_reset_active = False + self._reset_done_diagnostics_active = False + if not self._autoreset_cuda_graph: + diagnostics.add_host_timings(self._collect_reset_backend_timing_ms()) + with diagnostics.measure("reset_done_obs_scatter_ms"): + if not self._autoreset_scattered_reset_obs: + self._validate_reset_observation_mask(new_obs) + for name, values in new_obs.items(): + state.obs[name].copy_(torch.where(done[:, None], values, state.obs[name])) + self._scatter_reset_info_mask(reset_info, done) + diagnostics.record_internal_gap( + ( + "reset_done_terminal_obs_ms", + "reset_done_reset_call_ms", + "reset_done_obs_scatter_ms", + ) + ) def _publish_final_observation(self) -> None: assert self._state is not None @@ -1317,8 +1351,20 @@ def record_finite_validation(self, value: torch.Tensor) -> None: """Allow a manager to add a finite verdict to the shared boundary.""" self._record_finite_validation(value) + def _publish_reset_done_interval(self) -> None: + if ( + not self._masked_autoreset + or self._state is None + or self.step_counter == 0 + or self._reset_done_interval_published_step == self.step_counter + ): + return + timing = self._state.info.setdefault("timing", {}) + timing.update(self._reset_done_diagnostics.publish()) + self._reset_done_interval_published_step = self.step_counter + def poll_finite_validation(self, *, force: bool = False) -> bool: - """Publish all deferred verdicts at one fixed host boundary.""" + """Publish deferred verdicts and reset diagnostics at one host boundary.""" if not self._defer_finite_validation: return True if not force and self.step_counter % self._finite_validation_interval != 0: @@ -1354,6 +1400,7 @@ def poll_finite_validation(self, *, force: bool = False) -> bool: valid = bool(torch.stack(verdicts).all().detach().cpu().item()) if valid: + self._publish_reset_done_interval() self._finite_verdict.fill_(True) for named in named_sets: named.clear() diff --git a/src/unilab/envs/manager_based_rl_env.py b/src/unilab/envs/manager_based_rl_env.py index a32ef4af0..755478986 100644 --- a/src/unilab/envs/manager_based_rl_env.py +++ b/src/unilab/envs/manager_based_rl_env.py @@ -1888,24 +1888,26 @@ def _reset( ) reset_context = self._reset_state.scoped_device_event_tensor( reset_mask, + measure=self.measure_reset_done, ) log: dict[str, Any] = {} - with reset_context: - if "reset" in self.event_manager.available_modes: - self.event_manager.apply( - mode="reset", env_ids=env_ids, global_env_step_count=self.step_counter + with self.measure_reset_done("reset_done_command_event_ms"): + with reset_context: + if "reset" in self.event_manager.available_modes: + self.event_manager.apply( + mode="reset", env_ids=env_ids, global_env_step_count=self.step_counter + ) + reset_owner = self.reset_owner_manager.owner + owns_command_reset = bool( + reset_owner is not None and reset_owner.cfg.owns_command_reset ) - reset_owner = self.reset_owner_manager.owner - owns_command_reset = bool( - reset_owner is not None and reset_owner.cfg.owns_command_reset - ) - if owns_command_reset: - assert reset_owner is not None - log.update(reset_owner.reset_transaction(env_ids)) - else: - log.update(self.command_manager.reset(env_ids)) - reset_timing.update(getattr(self.command_manager, "last_reset_timing_ms", {})) - reset_timing.update(self.command_manager.reset_diagnostics()) + if owns_command_reset: + assert reset_owner is not None + log.update(reset_owner.reset_transaction(env_ids)) + else: + log.update(self.command_manager.reset(env_ids)) + reset_timing.update(getattr(self.command_manager, "last_reset_timing_ms", {})) + reset_timing.update(self.command_manager.reset_diagnostics()) self.episode_length_buf.masked_fill_(reset_mask, 0) self._control.copy_( @@ -1946,40 +1948,50 @@ def _reset( self.event_manager, self.termination_manager, ) - for manager in reset_managers: - reset_impl = getattr(manager, "reset", None) - if not callable(reset_impl): - raise NotImplementedError( - f"{type(manager).__name__} does not define the reset boundary" - ) - log.update(reset_impl(env_ids)) - reset_timing.update( - { - "reset_done_event_term_count": float( - len(self.event_manager.active_terms.get("reset", ())) - ), - "reset_done_command_term_count": float(len(self.command_manager.active_terms)), - "reset_done_manager_reset_count": float(len(reset_managers)), - "reset_done_observation_term_count": float( - sum(len(terms) for terms in self.observation_manager.active_terms.values()) - ), - } - ) + with self.measure_reset_done("reset_done_manager_state_ms"): + for manager in reset_managers: + reset_impl = getattr(manager, "reset", None) + if not callable(reset_impl): + raise NotImplementedError( + f"{type(manager).__name__} does not define the reset boundary" + ) + log.update(reset_impl(env_ids)) + reset_counts = { + "reset_done_event_term_count": float( + len(self.event_manager.active_terms.get("reset", ())) + ), + "reset_done_command_term_count": float(len(self.command_manager.active_terms)), + "reset_done_manager_reset_count": float(len(reset_managers)), + "reset_done_observation_term_count": float( + sum(len(terms) for terms in self.observation_manager.active_terms.values()) + ), + } + reset_timing.update(reset_counts) + for key, value in reset_counts.items(): + self.record_reset_done_count(key, value) if reset_owner is not None: log.update(reset_owner.reset_committed(env_ids)) - with self.scene._scoped_state_reads(): - read_plan = self.scene.read_plan - if read_plan is not None: - read_plan.refresh() - self.command_manager.refresh_reset(reset_mask) - self.command_manager.post_compute_reset() - reset_timing.update(getattr(self.command_manager, "last_post_compute_timing_ms", {})) - # env_ids scopes the temporal reset boundary: delay/history terms - # backfill the reset rows and peek, so non-reset rows keep their - # history, lag schedule, and lag RNG untouched. The publication - # stays full-width and merges through the reset mask below. - manager_obs = self.observation_manager.compute(update_history=True, env_ids=env_ids) + with self.measure_reset_done("reset_done_state_publish_ms"): + with self.scene._scoped_state_reads(): + read_plan = self.scene.read_plan + if read_plan is not None: + read_plan.refresh() + with self.measure_reset_done("reset_done_command_refresh_ms"): + self.command_manager.refresh_reset(reset_mask) + with self.measure_reset_done("reset_done_command_post_compute_ms"): + self.command_manager.post_compute_reset() + reset_timing.update( + getattr(self.command_manager, "last_post_compute_timing_ms", {}) + ) + # env_ids scopes the temporal reset boundary: delay/history terms + # backfill the reset rows and peek, so non-reset rows keep their + # history, lag schedule, and lag RNG untouched. The publication + # stays full-width and merges through the reset mask below. + with self.measure_reset_done("reset_done_observation_ms"): + manager_obs = self.observation_manager.compute( + update_history=True, env_ids=env_ids + ) mapped_obs = self._map_observations(manager_obs) reset_obs = { @@ -1987,10 +1999,11 @@ def _reset( for name, values in mapped_obs.items() } self._last_reset_manager_timing_ms = reset_timing - for name in mapped_obs: - self._state.obs[name].copy_( - torch.where(reset_mask[:, None], reset_obs[name], self._state.obs[name]) - ) + with self.measure_reset_done("reset_done_observation_scatter_ms"): + for name in mapped_obs: + self._state.obs[name].copy_( + torch.where(reset_mask[:, None], reset_obs[name], self._state.obs[name]) + ) self._autoreset_scattered_reset_obs = True if selection is not None and log and self._active_graph_capture is not None: raise GraphCaptureError( diff --git a/src/unilab/managers/command_manager.py b/src/unilab/managers/command_manager.py index 05317153e..0484bf179 100644 --- a/src/unilab/managers/command_manager.py +++ b/src/unilab/managers/command_manager.py @@ -15,6 +15,7 @@ from prettytable import PrettyTable from unilab.base.host_transitions import record_host_transition +from unilab.base.reset_diagnostics import measure_reset_done from unilab.base.reset_selection import ResetSelection, selection_blockers from unilab.base.reset_selectors import ResetMaskBuffer, resolve_reset_env_ids from unilab.managers.manager_base import ManagerBase, ManagerTermBase @@ -114,78 +115,84 @@ def reset( owner=f"CommandTerm '{self.name}' reset", ) extras: dict[str, float] = {} - metrics_started = time.perf_counter() - metric_values = list(self.metrics.items()) - if publish_metrics: - tensor_metrics = [ - (name, value) - for name, value in metric_values - if not isinstance(value, torch.Tensor) - ] - if tensor_metrics: - metric_name, _ = tensor_metrics[0] - raise TypeError( - f"CommandTerm '{self.name}' metric '{metric_name}' must be a torch.Tensor" - ) - if metric_values: - # Publish reset means and the finite check through one - # fixed-width device boundary instead of materializing rows. - values = torch.stack([value for _, value in metric_values], dim=0) - selected_values = torch.where(reset_mask[None, :], values, 0.0) - if self._deferred_validation_enabled(): - self._record_metric_finite(metric_values, reset_mask) - runtime_reset = int(getattr(self._env, "step_counter", 0)) > 0 or bool( - getattr(self._env, "_has_transition", False) + with measure_reset_done(self._env, "reset_done_command_metrics_ms"): + metrics_started = time.perf_counter() + metric_values = list(self.metrics.items()) + if publish_metrics: + tensor_metrics = [ + (name, value) + for name, value in metric_values + if not isinstance(value, torch.Tensor) + ] + if tensor_metrics: + metric_name, _ = tensor_metrics[0] + raise TypeError( + f"CommandTerm '{self.name}' metric '{metric_name}' must be a torch.Tensor" ) - selected_rows = not (isinstance(env_ids, torch.Tensor) and env_ids.numel() == 0) - if runtime_reset and selected_rows: - self._pending_metric_count += reset_mask.sum() - for (metric_name, _), selected in zip( - metric_values, selected_values, strict=True - ): - pending = self._pending_metric_sums.get(metric_name) - if pending is None: - pending = torch.zeros((), dtype=torch.float32, device=self._device) - self._pending_metric_sums[metric_name] = pending - pending.add_(selected.sum()) - record_host_transition( - self._env, - f"command.{self.name}.pending_metrics_dirty", - self._mark_metrics_dirty, + if metric_values: + # Publish reset means and the finite check through one + # fixed-width device boundary instead of materializing rows. + values = torch.stack([value for _, value in metric_values], dim=0) + selected_values = torch.where(reset_mask[None, :], values, 0.0) + if self._deferred_validation_enabled(): + self._record_metric_finite(metric_values, reset_mask) + runtime_reset = int(getattr(self._env, "step_counter", 0)) > 0 or bool( + getattr(self._env, "_has_transition", False) ) - else: - reduced = torch.stack( - ( - selected_values.sum(dim=1) / reset_mask.sum().clamp_min(1), - (torch.isfinite(values) | ~reset_mask[None, :]) - .all(dim=1) - .to(torch.float32), - ), - dim=0, - ).detach() - host_reduced = reduced.cpu() - means = host_reduced[0].tolist() - finite = bool(host_reduced[1].min().item() == 1.0) - if not finite: - for metric_name, metric_value in metric_values: - if not bool((torch.isfinite(metric_value) | ~reset_mask).all()): - raise ValueError( - f"CommandTerm '{self.name}' metric '{metric_name}' contains " - "NaN or Inf." - ) - for (metric_name, _), mean in zip(metric_values, means, strict=True): - extras[metric_name] = float(mean) - for _, metric_value in metric_values: - metric_value.masked_fill_(reset_mask, 0.0) - else: - if self._deferred_validation_enabled(): - self._record_metric_finite(metric_values, reset_mask) - self.clear_episode_metrics(reset_mask) - metrics_ms = (time.perf_counter() - metrics_started) * 1000.0 + selected_rows = not ( + isinstance(env_ids, torch.Tensor) and env_ids.numel() == 0 + ) + if runtime_reset and selected_rows: + self._pending_metric_count += reset_mask.sum() + for (metric_name, _), selected in zip( + metric_values, selected_values, strict=True + ): + pending = self._pending_metric_sums.get(metric_name) + if pending is None: + pending = torch.zeros( + (), dtype=torch.float32, device=self._device + ) + self._pending_metric_sums[metric_name] = pending + pending.add_(selected.sum()) + record_host_transition( + self._env, + f"command.{self.name}.pending_metrics_dirty", + self._mark_metrics_dirty, + ) + else: + reduced = torch.stack( + ( + selected_values.sum(dim=1) / reset_mask.sum().clamp_min(1), + (torch.isfinite(values) | ~reset_mask[None, :]) + .all(dim=1) + .to(torch.float32), + ), + dim=0, + ).detach() + host_reduced = reduced.cpu() + means = host_reduced[0].tolist() + finite = bool(host_reduced[1].min().item() == 1.0) + if not finite: + for metric_name, metric_value in metric_values: + if not bool((torch.isfinite(metric_value) | ~reset_mask).all()): + raise ValueError( + f"CommandTerm '{self.name}' metric '{metric_name}' contains " + "NaN or Inf." + ) + for (metric_name, _), mean in zip(metric_values, means, strict=True): + extras[metric_name] = float(mean) + for _, metric_value in metric_values: + metric_value.masked_fill_(reset_mask, 0.0) + else: + if self._deferred_validation_enabled(): + self._record_metric_finite(metric_values, reset_mask) + self.clear_episode_metrics(reset_mask) + metrics_ms = (time.perf_counter() - metrics_started) * 1000.0 self.command_counter.masked_fill_(reset_mask, 0) self.last_reset_timing_ms.clear() - resample_started = time.perf_counter() - self._resample(reset_mask) + with measure_reset_done(self._env, "reset_done_command_resample_ms"): + resample_started = time.perf_counter() + self._resample(reset_mask) self.last_reset_timing_ms["reset_done_command_metrics_ms"] = metrics_ms self.last_reset_timing_ms["reset_done_command_resample_ms"] = ( time.perf_counter() - resample_started diff --git a/src/unilab/tasks/motion_tracking/common/manager_terms.py b/src/unilab/tasks/motion_tracking/common/manager_terms.py index 09a7ed26b..79a705ea6 100644 --- a/src/unilab/tasks/motion_tracking/common/manager_terms.py +++ b/src/unilab/tasks/motion_tracking/common/manager_terms.py @@ -11,6 +11,7 @@ import torch from unilab.base.host_transitions import record_host_transition +from unilab.base.reset_diagnostics import measure_reset_done, record_reset_done_count from unilab.base.reset_selection import ResetSelection, fill_rows_, is_reset_selection from unilab.envs.mdp.actions import JointPositionAction, JointPositionActionCfg from unilab.managers import ( @@ -1022,63 +1023,66 @@ def _resample_command(self, reset_mask: torch.Tensor, *, fixed_shape: bool = Fal # not consume sampler or task RNG merely to preserve a fixed-width # device dispatch (v1.3.5 contract). return - sampler_started = time.perf_counter() - frames = self.tensor_sampler.sample_frames(reset_mask, self._env.rng.generator) - packet = self._motion_packet(frames) - tails, offsets = self._cached_motion_feature_shapes() - pose = self._env.rng.uniform( - self._pose_range_torch[:, 0], - self._pose_range_torch[:, 1], - (self.num_envs, 6), - dtype=torch.float32, - ) - velocity = self._env.rng.uniform( - self._velocity_range_torch[:, 0], - self._velocity_range_torch[:, 1], - (self.num_envs, 6), - dtype=torch.float32, - ) - joint_noise = self._env.rng.uniform( - self._joint_position_range_torch[0], - self._joint_position_range_torch[1], - self._reset_joint_values.shape, - dtype=torch.float32, - ) - joint_start, joint_end = offsets["joint_pos"] - vel_start, vel_end = offsets["joint_vel"] - self._reset_packet_velocity.copy_(packet[:, vel_start:vel_end]) - joint_pos = self._reset_joint_values_scratch - root_state = self._reset_root_state_scratch - _bind_compiled_motion_reset_values()( - packet[:, joint_start:joint_end], - self._reset_packet_velocity, - packet[:, offsets["body_pos_w"][0] : offsets["body_pos_w"][1]].view( - self.num_envs, *tails["body_pos_w"] - ), - packet[:, offsets["body_quat_w"][0] : offsets["body_quat_w"][1]].view( - self.num_envs, *tails["body_quat_w"] - ), - packet[:, offsets["body_lin_vel_w"][0] : offsets["body_lin_vel_w"][1]].view( - self.num_envs, *tails["body_lin_vel_w"] - ), - packet[:, offsets["body_ang_vel_w"][0] : offsets["body_ang_vel_w"][1]].view( - self.num_envs, *tails["body_ang_vel_w"] - ), - self._env_origins, - pose, - velocity, - joint_noise, - self._soft_joint_limits, - joint_pos, - root_state, - ) - self.robot.write_motion_state_tensor_to_sim( - root_state=root_state, - position=joint_pos, - velocity=self._reset_packet_velocity, - reset_mask=reset_mask, - ) - self._ingest_motion_packet_mask(reset_mask, packet) + with measure_reset_done(self._env, "reset_done_motion_reset_values_ms"): + sampler_started = time.perf_counter() + record_reset_done_count(self._env, "reset_done_sampler_dispatch_count", 1) + record_reset_done_count(self._env, "reset_done_sampler_host_transfer_count", 0) + frames = self.tensor_sampler.sample_frames(reset_mask, self._env.rng.generator) + packet = self._motion_packet(frames) + tails, offsets = self._cached_motion_feature_shapes() + pose = self._env.rng.uniform( + self._pose_range_torch[:, 0], + self._pose_range_torch[:, 1], + (self.num_envs, 6), + dtype=torch.float32, + ) + velocity = self._env.rng.uniform( + self._velocity_range_torch[:, 0], + self._velocity_range_torch[:, 1], + (self.num_envs, 6), + dtype=torch.float32, + ) + joint_noise = self._env.rng.uniform( + self._joint_position_range_torch[0], + self._joint_position_range_torch[1], + self._reset_joint_values.shape, + dtype=torch.float32, + ) + joint_start, joint_end = offsets["joint_pos"] + vel_start, vel_end = offsets["joint_vel"] + self._reset_packet_velocity.copy_(packet[:, vel_start:vel_end]) + joint_pos = self._reset_joint_values_scratch + root_state = self._reset_root_state_scratch + _bind_compiled_motion_reset_values()( + packet[:, joint_start:joint_end], + self._reset_packet_velocity, + packet[:, offsets["body_pos_w"][0] : offsets["body_pos_w"][1]].view( + self.num_envs, *tails["body_pos_w"] + ), + packet[:, offsets["body_quat_w"][0] : offsets["body_quat_w"][1]].view( + self.num_envs, *tails["body_quat_w"] + ), + packet[:, offsets["body_lin_vel_w"][0] : offsets["body_lin_vel_w"][1]].view( + self.num_envs, *tails["body_lin_vel_w"] + ), + packet[:, offsets["body_ang_vel_w"][0] : offsets["body_ang_vel_w"][1]].view( + self.num_envs, *tails["body_ang_vel_w"] + ), + self._env_origins, + pose, + velocity, + joint_noise, + self._soft_joint_limits, + joint_pos, + root_state, + ) + self.robot.write_motion_state_tensor_to_sim( + root_state=root_state, + position=joint_pos, + velocity=self._reset_packet_velocity, + reset_mask=reset_mask, + ) + self._ingest_motion_packet_mask(reset_mask, packet) self.last_reset_timing_ms["reset_done_motion_reset_values_ms"] = ( time.perf_counter() - sampler_started ) * 1000.0 @@ -1139,35 +1143,42 @@ def post_compute(self) -> None: if not self._bind_read_phase: return raise RuntimeError("MotionCommand requires a refreshed scene tensor read phase") - view = read_plan.body_tensor_view(self.robot, self.cfg.body_names) + with measure_reset_done(self._env, "reset_done_motion_post_compute_view_ms"): + view = read_plan.body_tensor_view(self.robot, self.cfg.body_names) view_ms = (time.perf_counter() - view_started) * 1000.0 robot_started = time.perf_counter() - _bind_compiled_motion_post_compute()( - self._tensor_all_rows, - self.anchor_body_idx, - view.pos_w, - view.quat_w, - view.lin_vel_w, - view.ang_vel_w, - self._robot_body_pos_w, - self._robot_body_quat_w, - self._robot_body_lin_vel_w, - self._robot_body_ang_vel_w, - cast("torch.Tensor", self._motion_data.body_pos_w), - self._body_pos_w, - cast("torch.Tensor", self._motion_data.body_quat_w), - self.body_pos_relative_w, - self.body_quat_relative_w, - self.motion_anchor_pos_b, - self.motion_anchor_ori_b, - self.robot_body_pos_b, - self.robot_body_ori_b, - ) + with measure_reset_done( + self._env, + "reset_done_motion_robot_refresh_ms", + "reset_done_motion_post_compute_kernel_ms", + ): + _bind_compiled_motion_post_compute()( + self._tensor_all_rows, + self.anchor_body_idx, + view.pos_w, + view.quat_w, + view.lin_vel_w, + view.ang_vel_w, + self._robot_body_pos_w, + self._robot_body_quat_w, + self._robot_body_lin_vel_w, + self._robot_body_ang_vel_w, + cast("torch.Tensor", self._motion_data.body_pos_w), + self._body_pos_w, + cast("torch.Tensor", self._motion_data.body_quat_w), + self.body_pos_relative_w, + self.body_quat_relative_w, + self.motion_anchor_pos_b, + self.motion_anchor_ori_b, + self.robot_body_pos_b, + self.robot_body_ori_b, + ) kernel_ms = (time.perf_counter() - robot_started) * 1000.0 rebind_started = time.perf_counter() - joint_view = read_plan.joint_tensor_view(self.robot) - self._robot_joint_pos = joint_view.joint_pos - self._robot_joint_vel = joint_view.joint_vel + with measure_reset_done(self._env, "reset_done_motion_post_compute_rebind_ms"): + joint_view = read_plan.joint_tensor_view(self.robot) + self._robot_joint_pos = joint_view.joint_pos + self._robot_joint_vel = joint_view.joint_vel # The robot cache is fresh for the current step; a graph replay of the # reset segment must re-stamp it with the replaying step. record_host_transition( diff --git a/tests/base/test_reset_diagnostics.py b/tests/base/test_reset_diagnostics.py new file mode 100644 index 000000000..e04cd0dc0 --- /dev/null +++ b/tests/base/test_reset_diagnostics.py @@ -0,0 +1,61 @@ +"""Unit tests for fixed-shape reset interval accumulators.""" + +from __future__ import annotations + +import pytest +import torch + +from unilab.base.reset_diagnostics import ResetDoneDiagnostics + + +def test_cpu_accumulates_and_drains_one_interval() -> None: + diagnostics = ResetDoneDiagnostics(torch.device("cpu")) + diagnostics.begin() + diagnostics.add_count("reset_done_count", 3) + with diagnostics.measure("reset_done_terminal_obs_ms"): + pass + diagnostics.add_host_timings( + { + "reset_done_terminal_obs_ms": 100.0, + "reset_done_command_event_ms": 2.5, + "not_a_reset_key": 9.0, + } + ) + + published = diagnostics.publish() + assert published["reset_done_count"] == 3.0 + assert 0.0 <= published["reset_done_terminal_obs_ms"] < 100.0 + assert published["reset_done_command_event_ms"] == 2.5 + assert "not_a_reset_key" not in published + assert set(diagnostics.publish().values()) == {0.0} + + +def test_count_api_rejects_timing_keys() -> None: + diagnostics = ResetDoneDiagnostics(torch.device("cpu")) + with pytest.raises(ValueError, match="is not a count"): + diagnostics.add_count("reset_done_reset_call_ms", 1.0) + + +@pytest.mark.skipif(not torch.cuda.is_available(), reason="requires CUDA") +def test_cuda_graph_replays_accumulate_device_timings() -> None: + diagnostics = ResetDoneDiagnostics(torch.device("cuda")) + + def body() -> None: + diagnostics.add_count("reset_done_count", 2) + with diagnostics.measure("reset_done_terminal_obs_ms"): + torch.cuda._sleep(10000) + + body() + diagnostics.publish() + torch.cuda.synchronize() + graph = torch.cuda.CUDAGraph() + diagnostics.begin() + with torch.cuda.graph(graph): + body() + graph.replay() + graph.replay() + + published = diagnostics.publish() + assert published["reset_done_count"] == 4.0 + assert published["reset_done_terminal_obs_ms"] > 0.0 + assert set(diagnostics.publish().values()) == {0.0} diff --git a/tests/envs/test_fixed_shape_autoreset.py b/tests/envs/test_fixed_shape_autoreset.py index 3048d90f6..50def5fb3 100644 --- a/tests/envs/test_fixed_shape_autoreset.py +++ b/tests/envs/test_fixed_shape_autoreset.py @@ -29,6 +29,7 @@ from tests.envs.test_manager_based_rl_env import _ResetBackend from unilab.base.autoreset_graph import AutoresetGraph +from unilab.base.backend_timing import RESET_DONE_DETAIL_TIMING_KEYS from unilab.base.entity import EntityCfg from unilab.base.registry import apply_cfg_overrides from unilab.base.reset_selection import ( @@ -598,6 +599,49 @@ def counting_reset(env_ids=None, **kwargs): assert state.info["timing"]["reset_done_reset_call_ms"] >= 0.0 +@pytest.mark.parametrize("device", DEVICES) +def test_masked_reset_diagnostics_publish_complete_intervals(device: str) -> None: + env, _ = _make_env( + device, + masked_autoreset=True, + persistent_step_buffers=True, + finite_validation_interval=3, + ) + env.reset() + env.set_episode_length_buf(torch.zeros(NUM_ENVS, dtype=torch.int64, device=device)) + action = torch.zeros((NUM_ENVS, 1), device=device) + action[0] = 0.9 + + for step in range(1, 4): + state = env.step(action) + timing = state.info["timing"] + if step < 3: + assert all(timing[key] == 0.0 for key in RESET_DONE_DETAIL_TIMING_KEYS) + continue + assert timing["reset_done_count"] == 3.0 + assert timing["reset_done_event_term_count"] == 3.0 + assert timing["reset_done_command_term_count"] == 3.0 + assert timing["reset_done_manager_reset_count"] == 21.0 + assert timing["reset_done_observation_term_count"] == 6.0 + for key in ( + "reset_done_terminal_obs_ms", + "reset_done_reset_call_ms", + "reset_done_command_event_ms", + "reset_done_manager_state_ms", + "reset_done_state_publish_ms", + "reset_done_command_metrics_ms", + "reset_done_command_resample_ms", + "reset_done_observation_ms", + "reset_done_observation_scatter_ms", + "reset_done_internal_gap_ms", + ): + assert timing[key] > 0.0, key + assert state.info["log"]["Episode_Metrics/length"] == pytest.approx(1.0) + + non_poll = env.step(action) + assert all(non_poll.info["timing"][key] == 0.0 for key in RESET_DONE_DETAIL_TIMING_KEYS) + + def test_deferred_named_checks_fail_closed_at_the_poll_boundary() -> None: env, _ = _make_env("cpu", masked_autoreset=True, persistent_step_buffers=True) env.reset() @@ -704,6 +748,38 @@ def test_autoreset_graph_replay_matches_eager_masked_autoreset() -> None: assert any(bool((snap["terminated"] | snap["truncated"]).any()) for snap in graphed[3:]) +@cuda_only +def test_autoreset_graph_publishes_reset_diagnostics_across_replays() -> None: + env, _ = _make_env( + "cuda", + autoreset_cuda_graph=True, + autoreset_graph_warmup=1, + finite_validation_interval=3, + ) + env.reset() + env.set_episode_length_buf(torch.zeros(NUM_ENVS, dtype=torch.int64, device="cuda")) + action = torch.zeros((NUM_ENVS, 1), device="cuda") + action[0] = 0.9 + + for step in range(1, 7): + state = env.step(action) + timing = state.info["timing"] + if step % 3: + assert timing["reset_done_count"] == 0.0 + continue + assert timing["reset_done_count"] == (3.0 if step == 3 else 10.0) + assert timing["reset_done_event_term_count"] == 3.0 + assert timing["reset_done_terminal_obs_ms"] > 0.0 + assert timing["reset_done_reset_call_ms"] > 0.0 + assert timing["reset_done_command_event_ms"] > 0.0 + assert timing["reset_done_observation_ms"] > 0.0 + assert timing["dr_reset_set_state_ms"] > 0.0 + + graph = env.autoreset_graph + assert graph is not None and graph.captured + assert graph.replays == 5 + + @cuda_only def test_graphed_masked_step_never_synchronizes_inside_the_autoreset() -> None: env, _ = _make_env( From f875e12dea413305e88906ea2b6c2852ed8c0815 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 19:26:02 +0800 Subject: [PATCH 5/9] feat: add MJWarp overflow validation --- docs/sphinx/source/changelog.md | 19 +++ pyproject.rocm.toml | 10 +- pyproject.toml | 20 +-- src/unilab/base/backend_factory.py | 1 + src/unilab/base/base.py | 13 ++ src/unilab/base/torch_env.py | 4 + src/unilab/conf/appo/config.yaml | 1 + src/unilab/conf/flashsac/config.yaml | 1 + src/unilab/conf/ppo/config.yaml | 1 + src/unilab/conf/sac/config.yaml | 1 + .../backend/test_mjwarp_backend_options.py | 16 +++ tests/base/test_mjwarp_backend.py | 45 ++++++ tests/base/test_mjwarp_identity.py | 2 +- tests/base/test_torch_env.py | 46 ++++++ uv.lock | 132 +++++++++--------- uv.rocm.lock | 116 +++++++-------- 16 files changed, 288 insertions(+), 140 deletions(-) diff --git a/docs/sphinx/source/changelog.md b/docs/sphinx/source/changelog.md index 7e5e9a1c6..d95176931 100644 --- a/docs/sphinx/source/changelog.md +++ b/docs/sphinx/source/changelog.md @@ -15,6 +15,25 @@ PyPI 版本变更与未发布变更;发布日期采用 PyPI 上传日期。完 ## Unreleased +### Added / 新增 + +- Added `env.mjwarp_overflow_check_interval` (default `0`) using the public + `unisim-core` 2.9.3 capacity diagnostics. When enabled, Manager control steps + flush tensor validation after physics and outside autoreset graph capture, so + contact/constraint capacity errors include the affected environment and + occupancy instead of silently truncating contacts; zero preserves the previous + hot path. Updated both dependency tracks to `unisim-core` 2.9.3 and aligned + MuJoCo/MJWarp 4.1.0 with `mjbatch-uni` 0.3.5; this release also keeps solver + iteration-limit flags distinct from capacity failures + ([#2682](https://github.com/Motphys/UniLab/issues/2682)). + 新增 `env.mjwarp_overflow_check_interval`(默认 `0`),使用 `unisim-core` + 2.9.3 的公共容量诊断接口。启用后,Manager 在物理控制步结束、autoreset graph + 捕获段之外 flush tensor validation,使接触/约束容量错误报告受影响的环境和占用量, + 不再静默丢弃接触;`0` 保持原有热路径。双依赖轨道同步升级至 `unisim-core` + 2.9.3,并对齐 MuJoCo/MJWarp 4.1.0 与 `mjbatch-uni` 0.3.5;该版本还将求解器 + 迭代上限标志与容量错误区分开 + ([#2682](https://github.com/Motphys/UniLab/issues/2682))。 + ### Fixed / 修复 - Reset-state tensor writes now cache root and joint column indices per layout diff --git a/pyproject.rocm.toml b/pyproject.rocm.toml index 797345c0d..26a870c0f 100644 --- a/pyproject.rocm.toml +++ b/pyproject.rocm.toml @@ -23,7 +23,7 @@ classifiers = [ requires-python = ">=3.10,<3.14" dependencies = [ "numpy", - "unisim-core==2.9.2", + "unisim-core==2.9.3", "prettytable>=3.10", "torch==2.14.0", "triton-rocm==3.8.0 ; sys_platform == 'linux' and platform_machine == 'x86_64'", @@ -62,12 +62,12 @@ uni-cumps = "unilab.training.cuda_mps_cli:main" drake = [ "drake-uni==0.2.0", ] -# MuJoCo 4.0 requires Python >=3.11; mjbatch 0.3.4 is built against it. +# MuJoCo 4.1 requires Python >=3.11; mjbatch 0.3.5 is built against it. mujoco = [ - "mujoco~=4.0.1 ; python_version >= '3.11'", - "mjbatch-uni==0.3.4 ; python_version >= '3.11'", + "mujoco~=4.1.0 ; python_version >= '3.11'", + "mjbatch-uni==0.3.5 ; python_version >= '3.11'", ] -motrix = ["unisim-core[motrix]==2.9.2"] +motrix = ["unisim-core[motrix]==2.9.3"] genesis = ["genesis-world==1.3.3"] # Keep the training-stack extra aligned with pyproject.toml. unirl = [ diff --git a/pyproject.toml b/pyproject.toml index c56d24742..362a26ee8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ requires-python = ">=3.10,<3.14" dependencies = [ "numpy", - "unisim-core==2.9.2", + "unisim-core==2.9.3", "prettytable>=3.10", # A range (not an exact pin) lets ROCm users substitute a ROCm torch # build; uv.lock pins the tested CUDA builds via tool.uv.sources. @@ -82,17 +82,17 @@ drake = [ "drake-uni==0.2.0", "mujoco>=3.5", ] -# MuJoCo 4.0 requires Python >=3.11; mjbatch 0.3.4 is built against it. +# MuJoCo 4.1 requires Python >=3.11; mjbatch 0.3.5 is built against it. mujoco = [ - "mujoco~=4.0.1 ; python_version >= '3.11'", - "mjbatch-uni==0.3.4 ; python_version >= '3.11'", + "mujoco~=4.1.0 ; python_version >= '3.11'", + "mjbatch-uni==0.3.5 ; python_version >= '3.11'", ] -# Shares the MuJoCo 4.0 / warp-lang >=1.15 line with the mujoco extra; the -# floor (mujoco-warp 4.0.1's own upstream requirement) also keeps this extra +# Shares the MuJoCo 4.1 / warp-lang >=1.15 line with the mujoco extra; the +# floor (mujoco-warp 4.1.0's own upstream requirement) also keeps this extra # jointly installable with mtxwarp, whose CUDA runtime resolves warp-lang # 1.17.0. mjwarp = [ - "mujoco-warp~=4.0.1 ; python_version >= '3.11'", + "mujoco-warp~=4.1.0 ; python_version >= '3.11'", "warp-lang>=1.15", ] newton = [ @@ -107,18 +107,18 @@ newton = [ "pyglet>=2.1.6,<3", "imgui-bundle>=1.92.0", ] -motrix = ["unisim-core[motrix]==2.9.2"] +motrix = ["unisim-core[motrix]==2.9.3"] # CUDA-resident MotrixSim for Linux x86-64 with NVIDIA CUDA, delegating to # UniSim's CUDA MotrixSim extra (its CUDA runtime resolves warp-lang 1.17.0; # the `mtxwarp` name mirrors that Warp-based runtime). The upstream extra # still carries its pre-alignment name; the rename is tracked at # unilabsim/unisim#578. -mtxwarp = ["unisim-core[motrix-gpu]==2.9.2"] +mtxwarp = ["unisim-core[motrix-gpu]==2.9.3"] genesis = ["genesis-world==1.3.3"] # Wheels are CPython 3.12/3.13 Linux x86_64 only; the marker keeps uv lock # resolvable for the other required-environments. superdex = [ - "unisim-core[superdex]==2.9.2 ; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'", + "unisim-core[superdex]==2.9.3 ; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'", ] # Tensor ray perception is optional and is discovered through UniSim's public # caster factory. The PyPI distribution is `uniray`; the import namespace is diff --git a/src/unilab/base/backend_factory.py b/src/unilab/base/backend_factory.py index d995e21b4..04ca1787f 100644 --- a/src/unilab/base/backend_factory.py +++ b/src/unilab/base/backend_factory.py @@ -240,6 +240,7 @@ def env_backend_kwargs(cfg: "EnvCfg") -> dict[str, Any]: "cpu_ids": cfg.cpu_ids, "mjwarp_nconmax": cfg.mjwarp_nconmax, "mjwarp_njmax": cfg.mjwarp_njmax, + "mjwarp_overflow_check_interval": cfg.mjwarp_overflow_check_interval, "newton_device": cfg.newton_device, "newton_nconmax": cfg.newton_nconmax, "newton_njmax": cfg.newton_njmax, diff --git a/src/unilab/base/base.py b/src/unilab/base/base.py index 0534e327c..94fed0529 100644 --- a/src/unilab/base/base.py +++ b/src/unilab/base/base.py @@ -78,6 +78,10 @@ class EnvCfg: # device profile never relies on an implicit backend-wide allocation size. mjwarp_nconmax: Optional[int] = None mjwarp_njmax: Optional[int] = None + # Check MJWarp contact/constraint capacity every N physics steps. When + # nonzero, the env publishes pending checks after every control step. + # Zero disables the monitor and preserves the default hot path. + mjwarp_overflow_check_interval: int = 0 # ``mtxwarp`` uses the rank-local CUDA device and owns its per-world # contact and constraint-row storage. mtxwarp_device: Optional[str] = None @@ -218,6 +222,15 @@ def validate(self): "newton_capacity_check_steps must be a positive integer, " f"got {self.newton_capacity_check_steps!r}" ) + if ( + isinstance(self.mjwarp_overflow_check_interval, bool) + or not isinstance(self.mjwarp_overflow_check_interval, int) + or self.mjwarp_overflow_check_interval < 0 + ): + raise ValueError( + "mjwarp_overflow_check_interval must be a non-negative integer, " + f"got {self.mjwarp_overflow_check_interval!r}" + ) if not isinstance(self.newton_use_cuda_graph, bool): raise ValueError( f"newton_use_cuda_graph must be bool, got {self.newton_use_cuda_graph!r}" diff --git a/src/unilab/base/torch_env.py b/src/unilab/base/torch_env.py index 44ebb10f3..65aed83c0 100644 --- a/src/unilab/base/torch_env.py +++ b/src/unilab/base/torch_env.py @@ -486,6 +486,10 @@ def _step(self, actions: torch.Tensor) -> TorchEnvState: try: self._gate_backend_step_completion(pending_completion) + if self._cfg.mjwarp_overflow_check_interval > 0: + # This host read belongs after the complete control interval, + # before Manager reads and outside the autoreset capture segment. + self._backend.flush_tensor_validation() self._state.truncated.fill_(False) self._clear_step_final_observation() diff --git a/src/unilab/conf/appo/config.yaml b/src/unilab/conf/appo/config.yaml index 64f9f6a29..93a7e6e57 100644 --- a/src/unilab/conf/appo/config.yaml +++ b/src/unilab/conf/appo/config.yaml @@ -107,6 +107,7 @@ training: # including the MJWarp backend operand checks. env: finite_validation_interval: 32 + mjwarp_overflow_check_interval: 0 interactive: action_mode: zero diff --git a/src/unilab/conf/flashsac/config.yaml b/src/unilab/conf/flashsac/config.yaml index aa4adc43b..9d94792fc 100644 --- a/src/unilab/conf/flashsac/config.yaml +++ b/src/unilab/conf/flashsac/config.yaml @@ -157,6 +157,7 @@ training: # including the MJWarp backend operand checks. env: finite_validation_interval: 32 + mjwarp_overflow_check_interval: 0 interactive: action_mode: zero diff --git a/src/unilab/conf/ppo/config.yaml b/src/unilab/conf/ppo/config.yaml index 90d57b441..d992ae27e 100644 --- a/src/unilab/conf/ppo/config.yaml +++ b/src/unilab/conf/ppo/config.yaml @@ -106,6 +106,7 @@ training: # including the MJWarp backend operand checks. env: finite_validation_interval: 32 + mjwarp_overflow_check_interval: 0 interactive: action_mode: zero diff --git a/src/unilab/conf/sac/config.yaml b/src/unilab/conf/sac/config.yaml index f87c24301..b7a2e72f1 100644 --- a/src/unilab/conf/sac/config.yaml +++ b/src/unilab/conf/sac/config.yaml @@ -130,6 +130,7 @@ training: # including the MJWarp backend operand checks. env: finite_validation_interval: 32 + mjwarp_overflow_check_interval: 0 interactive: action_mode: zero diff --git a/tests/base/backend/test_mjwarp_backend_options.py b/tests/base/backend/test_mjwarp_backend_options.py index 8f5bf5c49..269bfa42f 100644 --- a/tests/base/backend/test_mjwarp_backend_options.py +++ b/tests/base/backend/test_mjwarp_backend_options.py @@ -60,6 +60,22 @@ def test_mjwarp_derived_options_reject_unknown_mode() -> None: env_backend_kwargs(cfg) +def test_mjwarp_overflow_check_interval_defaults_off_and_routes_to_factory() -> None: + assert env_backend_kwargs(EnvCfg())["mjwarp_overflow_check_interval"] == 0 + + cfg = EnvCfg(mjwarp_overflow_check_interval=1) + apply_cfg_overrides(cfg, {"mjwarp_overflow_check_interval": 3}) + cfg.validate() + assert env_backend_kwargs(cfg)["mjwarp_overflow_check_interval"] == 3 + + +@pytest.mark.parametrize("value", [True, -1, 1.5, "1"]) +def test_mjwarp_overflow_check_interval_rejects_invalid_values(value: object) -> None: + cfg = EnvCfg(mjwarp_overflow_check_interval=value) # type: ignore[arg-type] + with pytest.raises(ValueError, match="mjwarp_overflow_check_interval must be"): + cfg.validate() + + @pytest.mark.parametrize( "removed", ["mjwarp_validate_tensor_finite", "mjwarp_defer_tensor_validation"] ) diff --git a/tests/base/test_mjwarp_backend.py b/tests/base/test_mjwarp_backend.py index dc08a6808..107bf5060 100644 --- a/tests/base/test_mjwarp_backend.py +++ b/tests/base/test_mjwarp_backend.py @@ -19,6 +19,7 @@ from hydra import compose, initialize_config_dir from hydra.core.global_hydra import GlobalHydra from unisim.backend.mjwarp.dependencies import load_mjwarp_dependencies +from unisim.backend.mjwarp.solver_capacity import MjwarpCapacityError from unilab.base import registry from unilab.base.backend_factory import create_backend @@ -245,6 +246,50 @@ def test_g1_walk_flat_owner_one_step( assert torch.isfinite(state.reward).all() +@pytest.mark.parametrize("interval", [0, 1]) +def test_g1_manager_publishes_capacity_overflow_on_first_control_step(interval: int) -> None: + _require_cuda_mjwarp() + GlobalHydra.instance().clear() + with initialize_config_dir( + config_dir=str(REPO_ROOT / "src" / "unilab" / "conf" / "ppo"), + version_base="1.3", + ): + cfg = compose( + "config", + overrides=[ + "task=g1_walk_flat/mjwarp", + "env.mjwarp_nconmax=1", + f"env.mjwarp_overflow_check_interval={interval}", + ], + ) + env_cfg_override = EnvConfigAdapter(cfg, root_dir=REPO_ROOT).build_task_env_cfg_override() + registry.ensure_registries() + env = registry.make( + str(cfg.training.task_name), + sim_backend=str(cfg.training.sim_backend), + env_cfg_override=env_cfg_override, + num_envs=2, + ) + try: + action = torch.zeros((2, env.action_space.shape[-1]), device=env.device) + if interval == 0: + state = env.step(action) + assert env.step_counter == 1 + assert torch.isfinite(state.reward).all() + return + + with pytest.raises(MjwarpCapacityError) as exc_info: + env.step(action) + message = str(exc_info.value) + assert "env=" in message + assert "overflow=" in message + assert "nacon=" in message + assert "nefc=" in message + assert env.step_counter == 0 + finally: + env.close() + + def test_g1_walk_flat_owner_eager_capture_warmup_and_replay_share_semantics() -> None: """The full Manager trajectory is invariant across MJWarp execution modes.""" _require_cuda_mjwarp() diff --git a/tests/base/test_mjwarp_identity.py b/tests/base/test_mjwarp_identity.py index 3aba713c4..2c766f7b5 100644 --- a/tests/base/test_mjwarp_identity.py +++ b/tests/base/test_mjwarp_identity.py @@ -71,7 +71,7 @@ def test_mjwarp_dependency_version_mismatch_fails_before_import( with pytest.raises( dependencies.MjwarpDependencyError, - match=r"requires the mujoco-warp 4\.0 line, found 3\.10\.0\.4", + match=r"requires the mujoco-warp 4\.1 line, found 3\.10\.0\.4", ): dependencies.load_mjwarp_dependencies() diff --git a/tests/base/test_torch_env.py b/tests/base/test_torch_env.py index 7cb8199e8..5475dac0d 100644 --- a/tests/base/test_torch_env.py +++ b/tests/base/test_torch_env.py @@ -343,6 +343,52 @@ def step_tensor(ctrl: torch.Tensor, nsteps: int) -> dict[str, Any]: assert env._pending_backend_step_completion is None +@pytest.mark.parametrize( + ("interval", "expected_calls"), + [(0, 0), (1, 2), (3, 2)], +) +def test_overflow_check_flushes_every_control_step_only_when_enabled( + interval: int, expected_calls: int +) -> None: + backend = _backend() + env = _StubTorchEnv( + cfg=_StubCfg(mjwarp_overflow_check_interval=interval), + backend=backend, + terminate=False, + ) + env.init_state() + + env.step(_actions(env)) + env.step(_actions(env)) + + assert backend.flush_tensor_validation.call_count == expected_calls + + +def test_overflow_check_flush_follows_physics_outside_graph_capture() -> None: + lifecycle: list[tuple[str, int]] = [] + backend = _backend() + completion = _GateCompletion(0, [], lifecycle) + backend.step_tensor.side_effect = lambda *_args: ( + lifecycle.append(("physics", 0)) or {"completion": completion} + ) + env = _StubTorchEnv( + cfg=_StubCfg(mjwarp_overflow_check_interval=1), + backend=backend, + terminate=False, + ) + + def flush() -> None: + assert env._active_graph_capture is None + lifecycle.append(("flush", 0)) + + backend.flush_tensor_validation.side_effect = flush + env.update_state = lambda state: lifecycle.append(("update", 0)) or state # type: ignore[method-assign] + env.init_state() + env.step(_actions(env)) + + assert lifecycle == [("physics", 0), ("gate", 0), ("flush", 0), ("update", 0)] + + def test_state_feedback_without_completion_receipts_keeps_sync_path() -> None: class _FeedbackEnv(_StubTorchEnv): @property diff --git a/uv.lock b/uv.lock index 28b1ae3a1..815f1b977 100644 --- a/uv.lock +++ b/uv.lock @@ -1294,7 +1294,7 @@ dependencies = [ { name = "libigl" }, { name = "moviepy" }, { name = "mujoco", version = "3.11.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-mjwarp' and extra != 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-newton') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-newton') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "numba" }, { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11' or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, @@ -2466,26 +2466,26 @@ wheels = [ [[package]] name = "mjbatch-uni" -version = "0.3.4" +version = "0.3.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/99/6e/6e634ac5a900c1f7efe7dd781ebd4e4ea55bf7623edcc50fdf4291929757/mjbatch_uni-0.3.4.tar.gz", hash = "sha256:9cbdbca47db59d03e00b71c3995ba9286a3cc42da2ceafd211a61a1fe12e4956", size = 55350, upload-time = "2026-12-03T06:34:49.061Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4c/db/9aae7cca5a3854f1ffa5159b3e9a7c91157e8eb23370d67db7ea8de4cee5/mjbatch_uni-0.3.5.tar.gz", hash = "sha256:7ed093473e59bd2495d6fbd1216aa5a001ee535f0ef36b2d6cd7cbf0ee8f821c", size = 55352, upload-time = "2026-12-03T10:19:28.375Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/47/65/3daa0f8d8ff9c77e75c080568ba22e15755547322d0bb919d93fe15e2bdf/mjbatch_uni-0.3.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:757152f22fbea3fad4ed2622e5c6afc23ad2391d29b4a880a74936f78f617644", size = 186273, upload-time = "2026-12-03T06:34:31.13Z" }, - { url = "https://files.pythonhosted.org/packages/33/b3/341520f620d8cca66ee8b320d0fa40cae480ddd5e0d7e1f5feb51e37e2dd/mjbatch_uni-0.3.4-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5ae17d2197018fe81d7331652b032722d23c1212ecd7febe6b926ab92abc97da", size = 232298, upload-time = "2026-12-03T06:34:32.189Z" }, - { url = "https://files.pythonhosted.org/packages/8b/c1/ef1817c46f9e882ab29015000e4e058955a59393ec90590446e88a2078c9/mjbatch_uni-0.3.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5b00c0f59dfbc1afef168c704f4e3ad326c73cdab066236b6bb05c2d60c01181", size = 246642, upload-time = "2026-12-03T06:34:33.323Z" }, - { url = "https://files.pythonhosted.org/packages/0a/b9/7c57004dc4f8247fb910fb2a4a1929002e664c20fa09c2b3c074d21786ad/mjbatch_uni-0.3.4-cp311-cp311-win_amd64.whl", hash = "sha256:b6c8537d0d225458cfdfa26b8db2aef823eba49ad3ca72ae1d677eeb5ca5cc38", size = 283847, upload-time = "2026-12-03T06:34:34.389Z" }, - { url = "https://files.pythonhosted.org/packages/eb/6a/2672bf57ecfd93b949b7fa12ebb6ba8c1f689193b35b865a50a5799d3c17/mjbatch_uni-0.3.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7e6d8892cc7dafcb9860da0eaa0120609b45beeaeeb7278471f267bad4376c41", size = 185513, upload-time = "2026-12-03T06:34:35.536Z" }, - { url = "https://files.pythonhosted.org/packages/e0/c3/ae2b7875d4a9067aed9e54a6c1ff29c7e8614ad7d9ca15ae8a3d0cb2e8e6/mjbatch_uni-0.3.4-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:20716b0805ab2214e156a850fb9e5232dbfdcc693eb37b577fb3d78a71faaafc", size = 231173, upload-time = "2026-12-03T06:34:36.608Z" }, - { url = "https://files.pythonhosted.org/packages/d1/ea/fe45d1801d73fd2e0324b190e38e99132757b05cfa01ac61489f322835fd/mjbatch_uni-0.3.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d40c84eb3a8b61e9507bb76b9ffac9216d23c7f7cba31354719959a4abea5f1b", size = 246455, upload-time = "2026-12-03T06:34:37.745Z" }, - { url = "https://files.pythonhosted.org/packages/27/20/0d7f92b8431656e4712a7f598125342102617aa52221caadaab9d403ca1e/mjbatch_uni-0.3.4-cp312-cp312-win_amd64.whl", hash = "sha256:bbe717bdcc712c679660484354e18f9639f5fcdf8d15c452be880a2765bdb505", size = 283000, upload-time = "2026-12-03T06:34:38.814Z" }, - { url = "https://files.pythonhosted.org/packages/e4/ea/db8d316ebca975f699bc07f8ec41adf1655ff57fa388ef080dd3cd50d6eb/mjbatch_uni-0.3.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e15802a3bde630c76a955d881a40717c194642a9d9fa0e0fccdcea0d31deccbe", size = 185552, upload-time = "2026-12-03T06:34:39.947Z" }, - { url = "https://files.pythonhosted.org/packages/40/38/49af69c2bc4df42456de78ca4536ba8c72ee5f0a32e870ddee7d0b976ad7/mjbatch_uni-0.3.4-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65925b6f0ee5864b7eb308c93f240c42f196ab34d9720fb7357b6c019dcf598e", size = 231175, upload-time = "2026-12-03T06:34:41.067Z" }, - { url = "https://files.pythonhosted.org/packages/3f/50/ebb6af290ae36f76b52016167531adaeabbbae1a849daebf794b0fa01eca/mjbatch_uni-0.3.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:290446a74c14b6c5721f367e08ae7d327ce2d029a7054c0c50c1316eecf0d220", size = 246461, upload-time = "2026-12-03T06:34:42.145Z" }, - { url = "https://files.pythonhosted.org/packages/ae/81/5897aa1e610bd1b5e746063ba8a2fe3fe5343c527b5c62351d4a213fc85f/mjbatch_uni-0.3.4-cp313-cp313-win_amd64.whl", hash = "sha256:fdec52bf72f9fabe07234634738b054ae0c548945a833ba5f051c1414bfe3184", size = 283025, upload-time = "2026-12-03T06:34:43.609Z" }, + { url = "https://files.pythonhosted.org/packages/07/ee/67b398215ae062d6eb7a08dfea5395a2a9b6675e920aa8b4fe033ae744b5/mjbatch_uni-0.3.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4e6a08a0d3a6a992bd30b5cc9a29826cf00002c61b9346692ee18e104ad271a1", size = 186530, upload-time = "2026-12-03T10:19:08.355Z" }, + { url = "https://files.pythonhosted.org/packages/b2/6f/bccb8c0be010ab517f8a531a780f66ab79a05e1a8da9542ea83640b583ed/mjbatch_uni-0.3.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de9db65a77ed239e3078de73ad9fb7842f28d9dc06ae70c50fe08645990295e3", size = 232456, upload-time = "2026-12-03T10:19:09.708Z" }, + { url = "https://files.pythonhosted.org/packages/da/f1/77c051c527708c4928bc1c0464a80b76af3d47400b386c7ab6f0465a64c6/mjbatch_uni-0.3.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f4a415aea61cd2bf43c6884671090edcb88aaf9b9fcba95d7e42d902754e8f6b", size = 246598, upload-time = "2026-12-03T10:19:11.188Z" }, + { url = "https://files.pythonhosted.org/packages/32/4e/ea025c28e3b59143615269dc978df1bb9455d2693f60a16faefde423e8c1/mjbatch_uni-0.3.5-cp311-cp311-win_amd64.whl", hash = "sha256:d4ad8305dbbcc8b727c6f1bf1acefc2b0b94a662395affa899d3d6c7909f54ab", size = 284337, upload-time = "2026-12-03T10:19:12.752Z" }, + { url = "https://files.pythonhosted.org/packages/47/22/4ddaa7eba3a7ccacd9b76709117df7fd849392c191d73fe67fd611d00c97/mjbatch_uni-0.3.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4c22b8b18fab9da3f28e23df0eae8a9af3ac4ae68276b9cd8cbe9c28d8d1dd67", size = 185768, upload-time = "2026-12-03T10:19:13.985Z" }, + { url = "https://files.pythonhosted.org/packages/bf/8a/53b45b90fe7afa6e4d3372e36a28d21378bbc1220a7ef22f50745163c48f/mjbatch_uni-0.3.5-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5616ea11a90e21477375dc7fb9fa451e887460c27121da942fbd9703823753a4", size = 231394, upload-time = "2026-12-03T10:19:15.406Z" }, + { url = "https://files.pythonhosted.org/packages/f5/f2/804ba7239daff5476733569b2caa17f19799267b6eb4d143f41f4935eed2/mjbatch_uni-0.3.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10cc959eac94f3d2ea5d6fdeb0168256bb94644820329779bca9dbd0836729e1", size = 246345, upload-time = "2026-12-03T10:19:16.684Z" }, + { url = "https://files.pythonhosted.org/packages/f4/0e/5599b2507c392de812551d845c873db8b87c8074b2581c77baa01c7fd08f/mjbatch_uni-0.3.5-cp312-cp312-win_amd64.whl", hash = "sha256:db0601ded4c67d782ae8776b4716cb29a0b0d791204122ee7724e70896116bd3", size = 283391, upload-time = "2026-12-03T10:19:17.957Z" }, + { url = "https://files.pythonhosted.org/packages/e5/bb/d4ce411b625d33216ee56e925f2e32f6a7fdd0834ee58294491250601c4d/mjbatch_uni-0.3.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8f784f9607b236c9e27431c034f7542a341e401ecf488e5fe06a7e576c61dce6", size = 185796, upload-time = "2026-12-03T10:19:19.02Z" }, + { url = "https://files.pythonhosted.org/packages/52/c7/16c96937eaf81453583251f90bbf81c312425cbda1a645a6aed5979aebae/mjbatch_uni-0.3.5-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f549747343e04f6115a48af1470c58e2e13a7be223efebfd7cdd7e469b7c84ea", size = 231410, upload-time = "2026-12-03T10:19:20.174Z" }, + { url = "https://files.pythonhosted.org/packages/f3/6e/0dfbcdbc0a9102c1a6df54f276d3d289f11210ba5163c762c6b91c74b853/mjbatch_uni-0.3.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7a4a4daa2a126c78388000ffe01e7434144e31a591a5ec3708d9de2213cc142d", size = 246354, upload-time = "2026-12-03T10:19:21.295Z" }, + { url = "https://files.pythonhosted.org/packages/a8/90/bf4e71abd938ee0f957af0647d45ba366a9968cdfef5b2ead530fe60785f/mjbatch_uni-0.3.5-cp313-cp313-win_amd64.whl", hash = "sha256:1fee4841b31e857835939139f95c3e38128f98744a25c2320cd96a3e4bf8aa82", size = 283334, upload-time = "2026-12-03T10:19:22.418Z" }, ] [[package]] @@ -2698,7 +2698,7 @@ wheels = [ [[package]] name = "mujoco" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "(python_full_version >= '3.13' and platform_machine != 's390x' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra != 'extra-6-unilab-newton' and extra != 'extra-6-unilab-superdex') or (python_full_version >= '3.13' and platform_machine != 's390x' and sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra != 'extra-6-unilab-newton' and extra != 'extra-6-unilab-superdex')", @@ -2757,37 +2757,37 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "pyopengl", marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/33/f7/235af1e87699ca1b1433cd1220c92742a39725ec3b61c1c151e7f9ef9f71/mujoco-4.0.1.tar.gz", hash = "sha256:bf669f944288038571a79dbbb98c9e94d4b9b2d97eaae5c98cf75f74be2f1c6d", size = 154912, upload-time = "2026-11-11T16:25:30.149Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/8f/fd5a2f687a7215933894c026a7b5180442c0c63f0832d735f88a51244777/mujoco-4.1.0.tar.gz", hash = "sha256:a4e1bc9b979abaf090890cabb1456cfe6590586d0359e12c610813c6c1d1a079", size = 154890, upload-time = "2026-12-01T16:33:29.527Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/37/50/a347e51f8a85cffcd02111165ea2b50508abeb89a30661bfe5442b1de411/mujoco-4.0.1-py3-none-any.whl", hash = "sha256:3a0ce4c6cd76dd599a89e60513ac1b03404642363a42267bcfd6b028cc753417", size = 108623, upload-time = "2026-11-11T16:25:28.431Z" }, + { url = "https://files.pythonhosted.org/packages/73/11/176cb8b2763a78a32bb0f65e7217da384fc1bde31c97711b96de42af6ff8/mujoco-4.1.0-py3-none-any.whl", hash = "sha256:eda027b90442bbd786862f7a2d6125162712ea2a5066228413678c3ed02b359b", size = 108621, upload-time = "2026-12-01T16:33:27.604Z" }, ] [[package]] name = "mujoco-core" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e8/fb/55e0bbfa81dc9f0c1db559813cba914a267f2547c43918c97e4c1597b134/mujoco_core-4.0.1.tar.gz", hash = "sha256:062883cac035b1b3ae6a769cccd155ecc8f06d8c1cb004c33e01d1cb0f0ccf49", size = 1849567, upload-time = "2026-11-11T16:19:55.415Z" } +sdist = { url = "https://files.pythonhosted.org/packages/80/5e/b3eb11ce0b83990a817c250dbbb23ae52d52f29ae11ccb9bfe4e640c2f87/mujoco_core-4.1.0.tar.gz", hash = "sha256:5be81b551dbc497ef570cdf59595838a34ed4ab475544ac9578017fe49023f7c", size = 1916919, upload-time = "2026-12-01T16:32:01.986Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/48/39/80ac2a43bb4c5dd0475ee4c8a5263f98bcdae6f04cc02244099466a204cd/mujoco_core-4.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2a898046fab1961b57b07bc199620d57c695eac19c3b49f6fd906cd29e5cc11f", size = 9884672, upload-time = "2026-11-11T16:18:47.139Z" }, - { url = "https://files.pythonhosted.org/packages/d4/00/c9c7cc05818be6e8a41eca232049ccb684dcd7cca459f87f4cc4017fcc3e/mujoco_core-4.0.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:52d934614a56f7d75dcfc2bd8bb72f058b465ecc19a0583a56df242f9505bdb6", size = 8916839, upload-time = "2026-11-11T16:18:49.719Z" }, - { url = "https://files.pythonhosted.org/packages/85/5b/03162469757e8f51ab2f9d14fffc33d9cdb326a8ba2077a37a7ebc37ac65/mujoco_core-4.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be28c0c7587347ef996b4de0487264e9da296282082b092bae211a9163e9aed6", size = 9560707, upload-time = "2026-11-11T16:18:52.082Z" }, - { url = "https://files.pythonhosted.org/packages/21/6b/0d3446f75ec7b45e40895944093a100d77e50962fa85b340362d1d0aec77/mujoco_core-4.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:e6bdf0b7a4d7381ff199b0172f192d2a2c79dc31d48dabb8d8121863554a8f8a", size = 8130103, upload-time = "2026-11-11T16:18:54.141Z" }, - { url = "https://files.pythonhosted.org/packages/64/93/243d260483723230528f38ffe4a1fb71abf01cf42455013e169c5b1c9a04/mujoco_core-4.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9b68ab5bea2557ed6b27b6160beebbb9804dba49b624c2fbb5bc2f5a38262a1", size = 9920947, upload-time = "2026-11-11T16:18:56.089Z" }, - { url = "https://files.pythonhosted.org/packages/2d/e5/d2ac34f1f4e06fcdd05c1e85741cb2adf5a23642fafe43545113b2d5832d/mujoco_core-4.0.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a401eaea5295a29d50c6fdfdb8df8d73c525ab2153751f91c36bd6ccdff95822", size = 8961229, upload-time = "2026-11-11T16:18:58.461Z" }, - { url = "https://files.pythonhosted.org/packages/f5/b0/7848d860e0a8262cfc6c504affcf9a481f17d198cd00c9ca0bcad32de159/mujoco_core-4.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efbfb6e8f2bd63c5f19473f8093f01696937ef453d647b3c7a92620f5873b845", size = 9684944, upload-time = "2026-11-11T16:19:01.02Z" }, - { url = "https://files.pythonhosted.org/packages/d6/9e/e7238fdc9ca2f0dd53de15702b3ff16f603ee1148cb4666c5e7a8cdecc01/mujoco_core-4.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:296f4d02b58df353a3fd6fc1b4fcea180c1622660a36b54d547db1ac8d67bc55", size = 8222366, upload-time = "2026-11-11T16:19:03.192Z" }, - { url = "https://files.pythonhosted.org/packages/69/c7/9239d33b1b5aaef808208f0753ba9fb16e2398019d205ed96266427dbd74/mujoco_core-4.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:918f0127ceb56faacb1374ae6bf49f2e426d4cc11a8b98939ccfbbcb9ebab7e8", size = 9920909, upload-time = "2026-11-11T16:19:05.43Z" }, - { url = "https://files.pythonhosted.org/packages/fc/54/b46bd3c15a760109558ffb11a871da8416fff22ef8b2862b08f27580efad/mujoco_core-4.0.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:554d7145476bf4354dbe170794f984088f187b09ea1588bd2c9ec6b85a623e3a", size = 8961329, upload-time = "2026-11-11T16:19:07.875Z" }, - { url = "https://files.pythonhosted.org/packages/79/b9/0e7a12212b6ead89c64df69f2751d505cc85559735583e203dd9db9e2ae9/mujoco_core-4.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:578c67b41be8a715b488f1f1b6bab13534f11c020d407b9605826f72eed086b3", size = 9685237, upload-time = "2026-11-11T16:19:10.359Z" }, - { url = "https://files.pythonhosted.org/packages/4c/e4/47ed37e018a7a802d300289a792b522d3a9f968b52731c1500b40db7f07f/mujoco_core-4.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:767f1c1f1f8e0126b7175c06303f630546b512005bb19744690a0bf941dc4855", size = 8222728, upload-time = "2026-11-11T16:19:12.544Z" }, + { url = "https://files.pythonhosted.org/packages/9b/01/f86ebec9855a70741544962bf319f3ff3e1d47c4a2b0083c12950034d759/mujoco_core-4.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa6cc91dc1d3502e13de3effb660e4ae1f3eac3ffe1159bdc960e36796c9e841", size = 10176409, upload-time = "2026-12-01T16:30:55.394Z" }, + { url = "https://files.pythonhosted.org/packages/67/fb/154c519c057716ac696274a8d21e062ecd0411a92cbb463e9baa92eb1579/mujoco_core-4.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b539e78c1dbfa8ecbface9c744f064b37671668af89c99b1446ace95bab564f5", size = 8986582, upload-time = "2026-12-01T16:30:58.002Z" }, + { url = "https://files.pythonhosted.org/packages/15/3c/00c2ec0bdf2d19e408784d8afa044d05e3c3e5250e379d47ec60e829077a/mujoco_core-4.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bd020e033ab0679caff92e2776a906ef27b5f0bf729377a56089a7548aef7710", size = 9633896, upload-time = "2026-12-01T16:31:00.122Z" }, + { url = "https://files.pythonhosted.org/packages/d6/6f/b2efe0cae887316016ee1cfb3bd9877293ebf4466a78f5873a47ac47350f/mujoco_core-4.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:e78d07067f885b01868f88b589d643bb8759b612231bf683c7cf89346d599880", size = 8162193, upload-time = "2026-12-01T16:31:02.23Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1d/636eafcd254df09a02a307ce4ecc09640154361b860ce086d78052577a2a/mujoco_core-4.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:485d4b76c5e04a2a827d082ff1b76f82a719f6e5ee0f30dcacbe0260541ff0ef", size = 10201253, upload-time = "2026-12-01T16:31:03.898Z" }, + { url = "https://files.pythonhosted.org/packages/f6/5e/09af73eaf08a21fc9e0409bd144acc41c9fd826fd7b0472fe175c750217f/mujoco_core-4.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8ed2e5a5a5ac7a57d9b9ee0c60f57759c85e37604106653ee7d9fb016f272fb", size = 9027179, upload-time = "2026-12-01T16:31:06.366Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e1/b90937bb2347e1badf51b57b586db6d1b73000146f37d9f7d4747b9958f8/mujoco_core-4.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c35d8549a606c173328d1a50b0c2fa470e27f6ed0e57dadc2e1f1db1ff674dc", size = 9748493, upload-time = "2026-12-01T16:31:09.217Z" }, + { url = "https://files.pythonhosted.org/packages/6b/d9/75146dae2a66cd22d9addc1293ea1d21d3e38162a5f6dc75e277177640bf/mujoco_core-4.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:771e7aa6f7dccd1c4a96ecac4fe8176345087a842c2547a7f995d375019f0a3e", size = 8268361, upload-time = "2026-12-01T16:31:11.75Z" }, + { url = "https://files.pythonhosted.org/packages/b9/85/c59e12324f69f5949c5781a2c3b17a0e4a2883f702f058e0b7f376219170/mujoco_core-4.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:085b790f38081a12cea7c3dfede8c2129d4048288c227463e55387b157646279", size = 10201350, upload-time = "2026-12-01T16:31:14.163Z" }, + { url = "https://files.pythonhosted.org/packages/66/cd/54fb41e59700a809618062178391d79ab5b0dace167b355a177ae9ef197b/mujoco_core-4.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:880eaaa60cd3eca1316f66bf750350cdd264ebc6a9f156fd97a3b38172c0f021", size = 9026855, upload-time = "2026-12-01T16:31:17.499Z" }, + { url = "https://files.pythonhosted.org/packages/25/e9/5d79ae9a000fe43721228dfaf9e6099a3110ab056bb87031a860948b0bde/mujoco_core-4.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:30daedac2e9f54f2b8cd24228ed831ebea1802d83bae776b5f471c4f09fbf910", size = 9748983, upload-time = "2026-12-01T16:31:20.662Z" }, + { url = "https://files.pythonhosted.org/packages/4e/99/d831aafea70dd5d2e72d9f92375eddcc79d0968e7c6d404b84c2b24be904/mujoco_core-4.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:7c97d779e9212aa28d931ee10e91b266dc47ca611b85cd8734d0476aa090fcd0", size = 8268891, upload-time = "2026-12-01T16:31:23.246Z" }, ] [[package]] name = "mujoco-studio" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mujoco-core", marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, @@ -2795,29 +2795,29 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "websockets", marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e7/eb/57a62669a40678a8e01d7bd05ce3122af948a19c81fff6c386f5e9dc1c3b/mujoco_studio-4.0.1.tar.gz", hash = "sha256:d5bc8ba43d747737c3922411a7b6466f984983018abdd5f46bb8ba20f6c4cece", size = 421236, upload-time = "2026-11-11T16:21:53.784Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d2/fe/8f519600b9d0258cda1c1b6d3dca09b87cd6450a938a328fb887440b1fb2/mujoco_studio-4.1.0.tar.gz", hash = "sha256:10c42f9eeae272e72548ef925529d09f6fd28002fb8365f8f4b71554ff7c6d92", size = 435165, upload-time = "2026-12-01T16:33:08.874Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/99/77/78661de9c79efc5ca988cd8e979e00d1a9e1517eecb26249469492b5024a/mujoco_studio-4.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:670f9d7d356c5b6497ab9e15d4bc10104a7ebe1df6eb0f849a9d5d6bc618aa6c", size = 7829462, upload-time = "2026-11-11T16:20:54.489Z" }, - { url = "https://files.pythonhosted.org/packages/12/b4/d496e0efaa8fcaacb09e825e243cae012eeef6479bdd49e9f9e8ed4bc319/mujoco_studio-4.0.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caa515ff656315c92b9673a1be5b2297dcc2af140790196cda6abff0b239dd50", size = 8277699, upload-time = "2026-11-11T16:20:56.868Z" }, - { url = "https://files.pythonhosted.org/packages/f6/42/be29eaba49a15b219ffc1e1bf375bbb703ca92c5979e361df1856ea79dd0/mujoco_studio-4.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:79fe3fc42e97d5b824a1b376c30d495df5f4221087b897331ee17d76b4fa9eef", size = 8710126, upload-time = "2026-11-11T16:20:58.695Z" }, - { url = "https://files.pythonhosted.org/packages/e6/31/b840263240ea1c1f7b7f6bcffa069c8f166d3cb3f69debeb5ae4479bd2c0/mujoco_studio-4.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:aae6a86668434de9b2799ef82c01e55b57bc8fc671b5e783a0f3c4697fc5ec25", size = 7975944, upload-time = "2026-11-11T16:21:01.062Z" }, - { url = "https://files.pythonhosted.org/packages/1b/0e/f2db09bab7dfc888ca1158e43a4cb0daa8ea6b7c0e40043b6e442653ffba/mujoco_studio-4.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c7939d48e5933e2bc9c92726939aa9b1e960481ba279b3dbdf6e70b29e04e67d", size = 7841031, upload-time = "2026-11-11T16:21:03.15Z" }, - { url = "https://files.pythonhosted.org/packages/a6/41/e73d8b8ca1a7727294bdc4ab74765335e97510a383f94d270c1dc8778dbb/mujoco_studio-4.0.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a58749829eef277375a0dedde533a4c88e0c396dd2b4f57f99146f67cf2c652", size = 8288869, upload-time = "2026-11-11T16:21:05.61Z" }, - { url = "https://files.pythonhosted.org/packages/30/c5/39781fb518059323aedacdd32cf7089ad39aa58ca211d2a2c44fb8cbc11f/mujoco_studio-4.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9f8e18cccbc69de0c888f487e2d3348c31b87f578ef557659b7bf4a3a739f38", size = 8749028, upload-time = "2026-11-11T16:21:07.771Z" }, - { url = "https://files.pythonhosted.org/packages/13/7f/a42796ce63c3de4a4e2b4b63c2e6194f58f5947b5c6822bdcc7e3227b46c/mujoco_studio-4.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:95f0265ea176b75166eece21e350f6a6b226486e4f7657761d8b8eb2fbecc8fc", size = 8014662, upload-time = "2026-11-11T16:21:10.001Z" }, - { url = "https://files.pythonhosted.org/packages/a4/33/715463cebaf6a092b2ca1756555c0899c0a464beea35bcf8f8aa93bfb3ad/mujoco_studio-4.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d4af70cd2a132d4c5cafaec67a741f694fd76615deef580e7770aa257926a19f", size = 7840937, upload-time = "2026-11-11T16:21:12.186Z" }, - { url = "https://files.pythonhosted.org/packages/7e/6b/122fae837ba6866583ca320c74532319b0aaee32a1c4b9e460f6e5f0d571/mujoco_studio-4.0.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:742323ab12b39b9320b3abbd57c2889efd375a55b2e9ec74b33c048f6aa5785d", size = 8288723, upload-time = "2026-11-11T16:21:14.729Z" }, - { url = "https://files.pythonhosted.org/packages/34/66/7437daa3ca2cbd9a4a89a89b4bc7bcfdcead566b03c661337b1fd157e379/mujoco_studio-4.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cbfe9e39fb89cd43b6d1236b9d8c676e833c763c694cab433ba381eb34c95c1d", size = 8749236, upload-time = "2026-11-11T16:21:17.078Z" }, - { url = "https://files.pythonhosted.org/packages/18/60/0af24570bd85a48f812ba40c432c79aaa3eb70dd45f3677337d34403f267/mujoco_studio-4.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:09352051bcba7510b51a26cb02c47c7ff8ab1c71c332919f92c77e71d5ee9b07", size = 8014774, upload-time = "2026-11-11T16:21:19.878Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2c/fbf327e6d19761a4811d606d62e3ae5d6f54f0bf19c30026b407d5530424/mujoco_studio-4.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ca5894b293daeef8cfa07d33a566ab9cff12a93cc956675936e00a0b5d3b6de8", size = 7147090, upload-time = "2026-12-01T16:32:14.435Z" }, + { url = "https://files.pythonhosted.org/packages/ae/2e/a3536db6120024e5aeb3681a01bedbea65c7a63b263be623bd9ba65b0871/mujoco_studio-4.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0ab829adf5f7cff96dd8054164f8c71996edf3e0456f50347d54728938e81dd", size = 7585787, upload-time = "2026-12-01T16:32:16.501Z" }, + { url = "https://files.pythonhosted.org/packages/6d/bf/03cc362a68b302b429016bdec7112df05231cfe9dc4da2120e7496e618d8/mujoco_studio-4.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e9e6445a8d3d9a763c46af018c6c8fb14cd0f8fb8a57aafc84421e8f72a97b1", size = 8023082, upload-time = "2026-12-01T16:32:18.352Z" }, + { url = "https://files.pythonhosted.org/packages/e8/38/7ca0efefb0b069b901f95b5cc7e2773be9faa0213285bf6b3100c6b61b79/mujoco_studio-4.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:1694be32c683f48cd447f20edcbe34962616911784b4ca02fa07263234dce53b", size = 7272075, upload-time = "2026-12-01T16:32:20.822Z" }, + { url = "https://files.pythonhosted.org/packages/65/93/5f08c9113601af3a554e2181111476a68ccd000365c8a5816617480dc344/mujoco_studio-4.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f17de5b967bae10de3ac4b183f9fad3cd4d9277b20e8c690219f8c4443f68ef6", size = 7156503, upload-time = "2026-12-01T16:32:22.737Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b3/6b83bc9cb0d5d9703cfcdf5766b474edd04e390aa7dfb51993435c5deccf/mujoco_studio-4.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:517d00cac468f37c2948776adddf58f5728d8efaee46d2190273ef4db79a1dd7", size = 7597766, upload-time = "2026-12-01T16:32:24.906Z" }, + { url = "https://files.pythonhosted.org/packages/35/be/5735adffd849ed715510a942cdf96a2444f2edf1aa3157ed6cc13473a9f0/mujoco_studio-4.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3054e306efd58823027d85ea34afe9e8f0e5f8939291056d09d70e73a02ee55c", size = 8060974, upload-time = "2026-12-01T16:32:27.142Z" }, + { url = "https://files.pythonhosted.org/packages/84/af/f7ff9b1f94aea092e55d3fc1e0fb803b9be12b228b664bb32d466e30e8f9/mujoco_studio-4.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:467cf427123b26fc3661d087c9291312e491467805003467ddd7e2a7fad30411", size = 7307749, upload-time = "2026-12-01T16:32:29.116Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/c07a238e5ae4a2f635076c9a386763d1e834005b5bd4a370decadfd188b9/mujoco_studio-4.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fa67da1a08aca47a1ac57eb3eea529574c17cf5f4da21f54122aeba6b19cb435", size = 7156709, upload-time = "2026-12-01T16:32:31.001Z" }, + { url = "https://files.pythonhosted.org/packages/65/92/58d2fac2e08d1212e8a0b98330b5039119863b32a316040de13c4a3b24ae/mujoco_studio-4.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:09ceeb241ddcf20aebed1bb358a1a8bc8f02053dcfeec331cc65fae552706f11", size = 7597258, upload-time = "2026-12-01T16:32:32.669Z" }, + { url = "https://files.pythonhosted.org/packages/66/2d/ba59fca70926c85012dc56e458a00b1cca569084003c52639507644b48f4/mujoco_studio-4.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4be19385967d5834bfcc399a8e03891a12e3e4d3014bee596ee8cf8f98c1149", size = 8061364, upload-time = "2026-12-01T16:32:34.581Z" }, + { url = "https://files.pythonhosted.org/packages/5d/f9/908e4b5fb0e1a27cd4b3fe277013a5d7341529dbf497dc2b60dd221a02c1/mujoco_studio-4.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:f26aa0e282160a6792f36792c87d1704c290f91bab4520f625eb5fefa588fa1e", size = 7307864, upload-time = "2026-12-01T16:32:37.012Z" }, ] [[package]] name = "mujoco-studio-wasm" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5b/20/d58817c428a858f9df7e46b18ea0434a581544a61756908f23acfb0cda38/mujoco_studio_wasm-4.0.1.tar.gz", hash = "sha256:90eb6c05d57e5b3171cf8a2ac4f491e3f1a1dcab2c06375f49b5c98dac8d5bfa", size = 2482121, upload-time = "2026-11-11T16:20:47.965Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/a5/244c4fe1414a556e388f5f5cb61fa12c95a715fa225a17290a31e37c6517/mujoco_studio_wasm-4.1.0.tar.gz", hash = "sha256:7bf9601dc4561ecd76b5f4eca3d1b3d4f9e86aacdc7821a2c4326cd36c16c668", size = 2584839, upload-time = "2026-12-01T16:32:08.285Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/f7/f59dc75abfbc4f232666ada6ae3946da0af8a8bcd46f058ee063786c3681/mujoco_studio_wasm-4.0.1-py3-none-any.whl", hash = "sha256:14d724721c971ec208baeb6b449797a9cd456ea0331bc8e8a8722e7823e60ccc", size = 2442076, upload-time = "2026-11-11T16:20:45.826Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f0/e784efd985867c745395410d89985d705de93ca4dac85fb41cb7ab8bf65c/mujoco_studio_wasm-4.1.0-py3-none-any.whl", hash = "sha256:588562726c1ace9d78e3778a17f944b23b904376fa5ea26fa52840c5267e8f7f", size = 2545870, upload-time = "2026-12-01T16:32:05.977Z" }, ] [[package]] @@ -2861,7 +2861,7 @@ wheels = [ [[package]] name = "mujoco-warp" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "(python_full_version >= '3.13' and platform_machine != 's390x' and sys_platform == 'linux') or (python_full_version >= '3.13' and platform_machine != 's390x' and sys_platform == 'win32')", @@ -2885,9 +2885,9 @@ dependencies = [ { name = "warp-lang", version = "1.16.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.11' and sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mjwarp') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra != 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra != 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "warp-lang", version = "1.17.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.11' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/0e/3b/3f7b2ca9bcbe08e4f0ae7745c939871e0b08f7e8d0af0bfd16bb0325296f/mujoco_warp-4.0.1.tar.gz", hash = "sha256:e1e40c16b944afe0e4f0ea646852df4cde110a31bdda9d4190c194906efa84c4", size = 2390466, upload-time = "2026-11-11T16:18:20.58Z" } +sdist = { url = "https://files.pythonhosted.org/packages/27/66/c5b2966ddc8d7cccdaa9196515d638f9169e885f6ee0d6021fc1ad93ef30/mujoco_warp-4.1.0.tar.gz", hash = "sha256:c493c39a814dafa2d9bbc83851934bf338c2c6f9a2aeab679e4f98c85c6f068b", size = 2549517, upload-time = "2026-12-01T16:30:06.485Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d2/bf/d8c9938c649ebe00725cc9dad3e82346d42ed8e8b0b4dfe1ac4b61285e9a/mujoco_warp-4.0.1-py3-none-any.whl", hash = "sha256:418b10733258f466f9a019bfccfa780b19674649a38c997a0e4f3a22f97c5463", size = 2469812, upload-time = "2026-11-11T16:18:18.958Z" }, + { url = "https://files.pythonhosted.org/packages/4c/ca/5d72995aa1edd75804ff7c5d6c7fcc20b80cc1da2333c067c31ea798bff6/mujoco_warp-4.1.0-py3-none-any.whl", hash = "sha256:246c9268f3fb35a2ab470ea7c7ed42a38260bb92a00ac23abdd07b3db5bec2b4", size = 2631085, upload-time = "2026-12-01T16:30:04.801Z" }, ] [[package]] @@ -5953,13 +5953,13 @@ dependencies = [ drake = [ { name = "drake-uni" }, { name = "mujoco", version = "3.11.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-mjwarp' and extra != 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-newton') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version == '3.11.*' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version >= '3.12' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-newton') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version == '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and platform_machine != 'x86_64' and extra != 'extra-6-unilab-newton') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco') or (python_full_version >= '3.11' and sys_platform != 'linux' and extra != 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (python_full_version < '3.11' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (sys_platform != 'linux' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] genesis = [ { name = "genesis-world" }, ] mjwarp = [ - { name = "mujoco-warp", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mujoco-warp", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "warp-lang", version = "1.16.0", source = { registry = "https://pypi.org/simple" }, marker = "(sys_platform != 'linux' and sys_platform != 'win32' and extra == 'extra-6-unilab-mjwarp') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra != 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra != 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "warp-lang", version = "1.17.0", source = { registry = "https://pypi.org/simple" }, marker = "(sys_platform == 'linux' and extra == 'extra-6-unilab-mjwarp') or (sys_platform == 'win32' and extra == 'extra-6-unilab-mjwarp') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] @@ -5971,7 +5971,7 @@ mtxwarp = [ ] mujoco = [ { name = "mjbatch-uni", marker = "python_full_version >= '3.11'" }, - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] newton = [ { name = "imgui-bundle" }, @@ -6021,11 +6021,11 @@ requires-dist = [ { name = "imgui-bundle", marker = "extra == 'newton'", specifier = ">=1.92.0" }, { name = "lark", specifier = ">=1.3.1" }, { name = "mediapy" }, - { name = "mjbatch-uni", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "==0.3.4" }, - { name = "mujoco", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "~=4.0.1" }, + { name = "mjbatch-uni", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "==0.3.5" }, + { name = "mujoco", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "~=4.1.0" }, { name = "mujoco", marker = "extra == 'drake'", specifier = ">=3.5" }, { name = "mujoco", marker = "extra == 'newton'", specifier = "==3.11.0" }, - { name = "mujoco-warp", marker = "python_full_version >= '3.11' and extra == 'mjwarp'", specifier = "~=4.0.1" }, + { name = "mujoco-warp", marker = "python_full_version >= '3.11' and extra == 'mjwarp'", specifier = "~=4.1.0" }, { name = "mujoco-warp", marker = "extra == 'newton'", specifier = "==3.11.0" }, { name = "newton", marker = "extra == 'newton'", specifier = "==1.5.1" }, { name = "ninja", marker = "sys_platform == 'linux'" }, @@ -6047,10 +6047,10 @@ requires-dist = [ { name = "trimesh", specifier = ">=3.21.7" }, { name = "typing-extensions" }, { name = "uniray", extras = ["warp"], marker = "extra == 'ray'", specifier = "==0.1.1" }, - { name = "unisim-core", specifier = "==2.9.2" }, - { name = "unisim-core", extras = ["motrix"], marker = "extra == 'motrix'", specifier = "==2.9.2" }, - { name = "unisim-core", extras = ["motrix-gpu"], marker = "extra == 'mtxwarp'", specifier = "==2.9.2" }, - { name = "unisim-core", extras = ["superdex"], marker = "python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'superdex'", specifier = "==2.9.2" }, + { name = "unisim-core", specifier = "==2.9.3" }, + { name = "unisim-core", extras = ["motrix"], marker = "extra == 'motrix'", specifier = "==2.9.3" }, + { name = "unisim-core", extras = ["motrix-gpu"], marker = "extra == 'mtxwarp'", specifier = "==2.9.3" }, + { name = "unisim-core", extras = ["superdex"], marker = "python_full_version >= '3.12' and platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'superdex'", specifier = "==2.9.3" }, { name = "viser", specifier = ">=1.0.26" }, { name = "wandb", marker = "extra == 'unirl'", specifier = ">=0.22.3" }, { name = "warp-lang", marker = "extra == 'mjwarp'", specifier = ">=1.15" }, @@ -6091,15 +6091,15 @@ warp = [ [[package]] name = "unisim-core" -version = "2.9.2" +version = "2.9.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11' or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mjwarp' and extra == 'extra-6-unilab-superdex') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-newton') or (extra == 'extra-6-unilab-mujoco' and extra == 'extra-6-unilab-superdex')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6b/d9/93d416d17b960e993767af0a6cf523209f6265b07a81fb4f898e224acdd4/unisim_core-2.9.2.tar.gz", hash = "sha256:5c1cb692a37b4baf34ae8ebb9d97b13ffe342b96c9d6d287f53311f4113aec93", size = 896921, upload-time = "2026-12-03T06:53:02.89Z" } +sdist = { url = "https://files.pythonhosted.org/packages/28/ee/5db225ceb33459862e3ae63d597d58362066184676f57ef21115f1726b3f/unisim_core-2.9.3.tar.gz", hash = "sha256:9f294e81fd66b12346918b789795bc6b33b1c03bb8a053e86feb8406dee6f139", size = 897754, upload-time = "2026-12-03T11:02:04.348Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bf/5e/97fa58081c0538e0707038b40a293aa531cdc1765c641762a500abe3440e/unisim_core-2.9.2-py3-none-any.whl", hash = "sha256:273fcce283fc70a4f91ab28ab6e20dcee9e9cae1da9e1962e923bf72a87d73d4", size = 954044, upload-time = "2026-12-03T06:53:00.987Z" }, + { url = "https://files.pythonhosted.org/packages/4a/c5/b36f8d491ae9c76b6fa5f6d735b831bb9e474fc874af3879b96bd52f62c5/unisim_core-2.9.3-py3-none-any.whl", hash = "sha256:801d8bd82b4a99610f01ae52bb73d8412892910a4bd7772d26490da7769cb454", size = 954856, upload-time = "2026-12-03T11:02:02.139Z" }, ] [package.optional-dependencies] diff --git a/uv.rocm.lock b/uv.rocm.lock index 11c1b7cfe..a8b087bad 100644 --- a/uv.rocm.lock +++ b/uv.rocm.lock @@ -1018,7 +1018,7 @@ dependencies = [ { name = "libigl" }, { name = "moviepy" }, { name = "mujoco", version = "3.11.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "numba" }, { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, @@ -2115,26 +2115,26 @@ wheels = [ [[package]] name = "mjbatch-uni" -version = "0.3.4" +version = "0.3.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" } }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" } }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" } }, ] -sdist = { url = "https://files.pythonhosted.org/packages/99/6e/6e634ac5a900c1f7efe7dd781ebd4e4ea55bf7623edcc50fdf4291929757/mjbatch_uni-0.3.4.tar.gz", hash = "sha256:9cbdbca47db59d03e00b71c3995ba9286a3cc42da2ceafd211a61a1fe12e4956", size = 55350, upload-time = "2026-12-03T06:34:49.061Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4c/db/9aae7cca5a3854f1ffa5159b3e9a7c91157e8eb23370d67db7ea8de4cee5/mjbatch_uni-0.3.5.tar.gz", hash = "sha256:7ed093473e59bd2495d6fbd1216aa5a001ee535f0ef36b2d6cd7cbf0ee8f821c", size = 55352, upload-time = "2026-12-03T10:19:28.375Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/47/65/3daa0f8d8ff9c77e75c080568ba22e15755547322d0bb919d93fe15e2bdf/mjbatch_uni-0.3.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:757152f22fbea3fad4ed2622e5c6afc23ad2391d29b4a880a74936f78f617644", size = 186273, upload-time = "2026-12-03T06:34:31.13Z" }, - { url = "https://files.pythonhosted.org/packages/33/b3/341520f620d8cca66ee8b320d0fa40cae480ddd5e0d7e1f5feb51e37e2dd/mjbatch_uni-0.3.4-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5ae17d2197018fe81d7331652b032722d23c1212ecd7febe6b926ab92abc97da", size = 232298, upload-time = "2026-12-03T06:34:32.189Z" }, - { url = "https://files.pythonhosted.org/packages/8b/c1/ef1817c46f9e882ab29015000e4e058955a59393ec90590446e88a2078c9/mjbatch_uni-0.3.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5b00c0f59dfbc1afef168c704f4e3ad326c73cdab066236b6bb05c2d60c01181", size = 246642, upload-time = "2026-12-03T06:34:33.323Z" }, - { url = "https://files.pythonhosted.org/packages/0a/b9/7c57004dc4f8247fb910fb2a4a1929002e664c20fa09c2b3c074d21786ad/mjbatch_uni-0.3.4-cp311-cp311-win_amd64.whl", hash = "sha256:b6c8537d0d225458cfdfa26b8db2aef823eba49ad3ca72ae1d677eeb5ca5cc38", size = 283847, upload-time = "2026-12-03T06:34:34.389Z" }, - { url = "https://files.pythonhosted.org/packages/eb/6a/2672bf57ecfd93b949b7fa12ebb6ba8c1f689193b35b865a50a5799d3c17/mjbatch_uni-0.3.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7e6d8892cc7dafcb9860da0eaa0120609b45beeaeeb7278471f267bad4376c41", size = 185513, upload-time = "2026-12-03T06:34:35.536Z" }, - { url = "https://files.pythonhosted.org/packages/e0/c3/ae2b7875d4a9067aed9e54a6c1ff29c7e8614ad7d9ca15ae8a3d0cb2e8e6/mjbatch_uni-0.3.4-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:20716b0805ab2214e156a850fb9e5232dbfdcc693eb37b577fb3d78a71faaafc", size = 231173, upload-time = "2026-12-03T06:34:36.608Z" }, - { url = "https://files.pythonhosted.org/packages/d1/ea/fe45d1801d73fd2e0324b190e38e99132757b05cfa01ac61489f322835fd/mjbatch_uni-0.3.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d40c84eb3a8b61e9507bb76b9ffac9216d23c7f7cba31354719959a4abea5f1b", size = 246455, upload-time = "2026-12-03T06:34:37.745Z" }, - { url = "https://files.pythonhosted.org/packages/27/20/0d7f92b8431656e4712a7f598125342102617aa52221caadaab9d403ca1e/mjbatch_uni-0.3.4-cp312-cp312-win_amd64.whl", hash = "sha256:bbe717bdcc712c679660484354e18f9639f5fcdf8d15c452be880a2765bdb505", size = 283000, upload-time = "2026-12-03T06:34:38.814Z" }, - { url = "https://files.pythonhosted.org/packages/e4/ea/db8d316ebca975f699bc07f8ec41adf1655ff57fa388ef080dd3cd50d6eb/mjbatch_uni-0.3.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e15802a3bde630c76a955d881a40717c194642a9d9fa0e0fccdcea0d31deccbe", size = 185552, upload-time = "2026-12-03T06:34:39.947Z" }, - { url = "https://files.pythonhosted.org/packages/40/38/49af69c2bc4df42456de78ca4536ba8c72ee5f0a32e870ddee7d0b976ad7/mjbatch_uni-0.3.4-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65925b6f0ee5864b7eb308c93f240c42f196ab34d9720fb7357b6c019dcf598e", size = 231175, upload-time = "2026-12-03T06:34:41.067Z" }, - { url = "https://files.pythonhosted.org/packages/3f/50/ebb6af290ae36f76b52016167531adaeabbbae1a849daebf794b0fa01eca/mjbatch_uni-0.3.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:290446a74c14b6c5721f367e08ae7d327ce2d029a7054c0c50c1316eecf0d220", size = 246461, upload-time = "2026-12-03T06:34:42.145Z" }, - { url = "https://files.pythonhosted.org/packages/ae/81/5897aa1e610bd1b5e746063ba8a2fe3fe5343c527b5c62351d4a213fc85f/mjbatch_uni-0.3.4-cp313-cp313-win_amd64.whl", hash = "sha256:fdec52bf72f9fabe07234634738b054ae0c548945a833ba5f051c1414bfe3184", size = 283025, upload-time = "2026-12-03T06:34:43.609Z" }, + { url = "https://files.pythonhosted.org/packages/07/ee/67b398215ae062d6eb7a08dfea5395a2a9b6675e920aa8b4fe033ae744b5/mjbatch_uni-0.3.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4e6a08a0d3a6a992bd30b5cc9a29826cf00002c61b9346692ee18e104ad271a1", size = 186530, upload-time = "2026-12-03T10:19:08.355Z" }, + { url = "https://files.pythonhosted.org/packages/b2/6f/bccb8c0be010ab517f8a531a780f66ab79a05e1a8da9542ea83640b583ed/mjbatch_uni-0.3.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de9db65a77ed239e3078de73ad9fb7842f28d9dc06ae70c50fe08645990295e3", size = 232456, upload-time = "2026-12-03T10:19:09.708Z" }, + { url = "https://files.pythonhosted.org/packages/da/f1/77c051c527708c4928bc1c0464a80b76af3d47400b386c7ab6f0465a64c6/mjbatch_uni-0.3.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f4a415aea61cd2bf43c6884671090edcb88aaf9b9fcba95d7e42d902754e8f6b", size = 246598, upload-time = "2026-12-03T10:19:11.188Z" }, + { url = "https://files.pythonhosted.org/packages/32/4e/ea025c28e3b59143615269dc978df1bb9455d2693f60a16faefde423e8c1/mjbatch_uni-0.3.5-cp311-cp311-win_amd64.whl", hash = "sha256:d4ad8305dbbcc8b727c6f1bf1acefc2b0b94a662395affa899d3d6c7909f54ab", size = 284337, upload-time = "2026-12-03T10:19:12.752Z" }, + { url = "https://files.pythonhosted.org/packages/47/22/4ddaa7eba3a7ccacd9b76709117df7fd849392c191d73fe67fd611d00c97/mjbatch_uni-0.3.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4c22b8b18fab9da3f28e23df0eae8a9af3ac4ae68276b9cd8cbe9c28d8d1dd67", size = 185768, upload-time = "2026-12-03T10:19:13.985Z" }, + { url = "https://files.pythonhosted.org/packages/bf/8a/53b45b90fe7afa6e4d3372e36a28d21378bbc1220a7ef22f50745163c48f/mjbatch_uni-0.3.5-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5616ea11a90e21477375dc7fb9fa451e887460c27121da942fbd9703823753a4", size = 231394, upload-time = "2026-12-03T10:19:15.406Z" }, + { url = "https://files.pythonhosted.org/packages/f5/f2/804ba7239daff5476733569b2caa17f19799267b6eb4d143f41f4935eed2/mjbatch_uni-0.3.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:10cc959eac94f3d2ea5d6fdeb0168256bb94644820329779bca9dbd0836729e1", size = 246345, upload-time = "2026-12-03T10:19:16.684Z" }, + { url = "https://files.pythonhosted.org/packages/f4/0e/5599b2507c392de812551d845c873db8b87c8074b2581c77baa01c7fd08f/mjbatch_uni-0.3.5-cp312-cp312-win_amd64.whl", hash = "sha256:db0601ded4c67d782ae8776b4716cb29a0b0d791204122ee7724e70896116bd3", size = 283391, upload-time = "2026-12-03T10:19:17.957Z" }, + { url = "https://files.pythonhosted.org/packages/e5/bb/d4ce411b625d33216ee56e925f2e32f6a7fdd0834ee58294491250601c4d/mjbatch_uni-0.3.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8f784f9607b236c9e27431c034f7542a341e401ecf488e5fe06a7e576c61dce6", size = 185796, upload-time = "2026-12-03T10:19:19.02Z" }, + { url = "https://files.pythonhosted.org/packages/52/c7/16c96937eaf81453583251f90bbf81c312425cbda1a645a6aed5979aebae/mjbatch_uni-0.3.5-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f549747343e04f6115a48af1470c58e2e13a7be223efebfd7cdd7e469b7c84ea", size = 231410, upload-time = "2026-12-03T10:19:20.174Z" }, + { url = "https://files.pythonhosted.org/packages/f3/6e/0dfbcdbc0a9102c1a6df54f276d3d289f11210ba5163c762c6b91c74b853/mjbatch_uni-0.3.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7a4a4daa2a126c78388000ffe01e7434144e31a591a5ec3708d9de2213cc142d", size = 246354, upload-time = "2026-12-03T10:19:21.295Z" }, + { url = "https://files.pythonhosted.org/packages/a8/90/bf4e71abd938ee0f957af0647d45ba366a9968cdfef5b2ead530fe60785f/mjbatch_uni-0.3.5-cp313-cp313-win_amd64.whl", hash = "sha256:1fee4841b31e857835939139f95c3e38128f98744a25c2320cd96a3e4bf8aa82", size = 283334, upload-time = "2026-12-03T10:19:22.418Z" }, ] [[package]] @@ -2307,7 +2307,7 @@ wheels = [ [[package]] name = "mujoco" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'", @@ -2327,37 +2327,37 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" } }, { name = "pyopengl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/33/f7/235af1e87699ca1b1433cd1220c92742a39725ec3b61c1c151e7f9ef9f71/mujoco-4.0.1.tar.gz", hash = "sha256:bf669f944288038571a79dbbb98c9e94d4b9b2d97eaae5c98cf75f74be2f1c6d", size = 154912, upload-time = "2026-11-11T16:25:30.149Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/8f/fd5a2f687a7215933894c026a7b5180442c0c63f0832d735f88a51244777/mujoco-4.1.0.tar.gz", hash = "sha256:a4e1bc9b979abaf090890cabb1456cfe6590586d0359e12c610813c6c1d1a079", size = 154890, upload-time = "2026-12-01T16:33:29.527Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/37/50/a347e51f8a85cffcd02111165ea2b50508abeb89a30661bfe5442b1de411/mujoco-4.0.1-py3-none-any.whl", hash = "sha256:3a0ce4c6cd76dd599a89e60513ac1b03404642363a42267bcfd6b028cc753417", size = 108623, upload-time = "2026-11-11T16:25:28.431Z" }, + { url = "https://files.pythonhosted.org/packages/73/11/176cb8b2763a78a32bb0f65e7217da384fc1bde31c97711b96de42af6ff8/mujoco-4.1.0-py3-none-any.whl", hash = "sha256:eda027b90442bbd786862f7a2d6125162712ea2a5066228413678c3ed02b359b", size = 108621, upload-time = "2026-12-01T16:33:27.604Z" }, ] [[package]] name = "mujoco-core" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" } }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e8/fb/55e0bbfa81dc9f0c1db559813cba914a267f2547c43918c97e4c1597b134/mujoco_core-4.0.1.tar.gz", hash = "sha256:062883cac035b1b3ae6a769cccd155ecc8f06d8c1cb004c33e01d1cb0f0ccf49", size = 1849567, upload-time = "2026-11-11T16:19:55.415Z" } +sdist = { url = "https://files.pythonhosted.org/packages/80/5e/b3eb11ce0b83990a817c250dbbb23ae52d52f29ae11ccb9bfe4e640c2f87/mujoco_core-4.1.0.tar.gz", hash = "sha256:5be81b551dbc497ef570cdf59595838a34ed4ab475544ac9578017fe49023f7c", size = 1916919, upload-time = "2026-12-01T16:32:01.986Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/48/39/80ac2a43bb4c5dd0475ee4c8a5263f98bcdae6f04cc02244099466a204cd/mujoco_core-4.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2a898046fab1961b57b07bc199620d57c695eac19c3b49f6fd906cd29e5cc11f", size = 9884672, upload-time = "2026-11-11T16:18:47.139Z" }, - { url = "https://files.pythonhosted.org/packages/d4/00/c9c7cc05818be6e8a41eca232049ccb684dcd7cca459f87f4cc4017fcc3e/mujoco_core-4.0.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:52d934614a56f7d75dcfc2bd8bb72f058b465ecc19a0583a56df242f9505bdb6", size = 8916839, upload-time = "2026-11-11T16:18:49.719Z" }, - { url = "https://files.pythonhosted.org/packages/85/5b/03162469757e8f51ab2f9d14fffc33d9cdb326a8ba2077a37a7ebc37ac65/mujoco_core-4.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:be28c0c7587347ef996b4de0487264e9da296282082b092bae211a9163e9aed6", size = 9560707, upload-time = "2026-11-11T16:18:52.082Z" }, - { url = "https://files.pythonhosted.org/packages/21/6b/0d3446f75ec7b45e40895944093a100d77e50962fa85b340362d1d0aec77/mujoco_core-4.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:e6bdf0b7a4d7381ff199b0172f192d2a2c79dc31d48dabb8d8121863554a8f8a", size = 8130103, upload-time = "2026-11-11T16:18:54.141Z" }, - { url = "https://files.pythonhosted.org/packages/64/93/243d260483723230528f38ffe4a1fb71abf01cf42455013e169c5b1c9a04/mujoco_core-4.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9b68ab5bea2557ed6b27b6160beebbb9804dba49b624c2fbb5bc2f5a38262a1", size = 9920947, upload-time = "2026-11-11T16:18:56.089Z" }, - { url = "https://files.pythonhosted.org/packages/2d/e5/d2ac34f1f4e06fcdd05c1e85741cb2adf5a23642fafe43545113b2d5832d/mujoco_core-4.0.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a401eaea5295a29d50c6fdfdb8df8d73c525ab2153751f91c36bd6ccdff95822", size = 8961229, upload-time = "2026-11-11T16:18:58.461Z" }, - { url = "https://files.pythonhosted.org/packages/f5/b0/7848d860e0a8262cfc6c504affcf9a481f17d198cd00c9ca0bcad32de159/mujoco_core-4.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:efbfb6e8f2bd63c5f19473f8093f01696937ef453d647b3c7a92620f5873b845", size = 9684944, upload-time = "2026-11-11T16:19:01.02Z" }, - { url = "https://files.pythonhosted.org/packages/d6/9e/e7238fdc9ca2f0dd53de15702b3ff16f603ee1148cb4666c5e7a8cdecc01/mujoco_core-4.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:296f4d02b58df353a3fd6fc1b4fcea180c1622660a36b54d547db1ac8d67bc55", size = 8222366, upload-time = "2026-11-11T16:19:03.192Z" }, - { url = "https://files.pythonhosted.org/packages/69/c7/9239d33b1b5aaef808208f0753ba9fb16e2398019d205ed96266427dbd74/mujoco_core-4.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:918f0127ceb56faacb1374ae6bf49f2e426d4cc11a8b98939ccfbbcb9ebab7e8", size = 9920909, upload-time = "2026-11-11T16:19:05.43Z" }, - { url = "https://files.pythonhosted.org/packages/fc/54/b46bd3c15a760109558ffb11a871da8416fff22ef8b2862b08f27580efad/mujoco_core-4.0.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:554d7145476bf4354dbe170794f984088f187b09ea1588bd2c9ec6b85a623e3a", size = 8961329, upload-time = "2026-11-11T16:19:07.875Z" }, - { url = "https://files.pythonhosted.org/packages/79/b9/0e7a12212b6ead89c64df69f2751d505cc85559735583e203dd9db9e2ae9/mujoco_core-4.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:578c67b41be8a715b488f1f1b6bab13534f11c020d407b9605826f72eed086b3", size = 9685237, upload-time = "2026-11-11T16:19:10.359Z" }, - { url = "https://files.pythonhosted.org/packages/4c/e4/47ed37e018a7a802d300289a792b522d3a9f968b52731c1500b40db7f07f/mujoco_core-4.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:767f1c1f1f8e0126b7175c06303f630546b512005bb19744690a0bf941dc4855", size = 8222728, upload-time = "2026-11-11T16:19:12.544Z" }, + { url = "https://files.pythonhosted.org/packages/9b/01/f86ebec9855a70741544962bf319f3ff3e1d47c4a2b0083c12950034d759/mujoco_core-4.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa6cc91dc1d3502e13de3effb660e4ae1f3eac3ffe1159bdc960e36796c9e841", size = 10176409, upload-time = "2026-12-01T16:30:55.394Z" }, + { url = "https://files.pythonhosted.org/packages/67/fb/154c519c057716ac696274a8d21e062ecd0411a92cbb463e9baa92eb1579/mujoco_core-4.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b539e78c1dbfa8ecbface9c744f064b37671668af89c99b1446ace95bab564f5", size = 8986582, upload-time = "2026-12-01T16:30:58.002Z" }, + { url = "https://files.pythonhosted.org/packages/15/3c/00c2ec0bdf2d19e408784d8afa044d05e3c3e5250e379d47ec60e829077a/mujoco_core-4.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bd020e033ab0679caff92e2776a906ef27b5f0bf729377a56089a7548aef7710", size = 9633896, upload-time = "2026-12-01T16:31:00.122Z" }, + { url = "https://files.pythonhosted.org/packages/d6/6f/b2efe0cae887316016ee1cfb3bd9877293ebf4466a78f5873a47ac47350f/mujoco_core-4.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:e78d07067f885b01868f88b589d643bb8759b612231bf683c7cf89346d599880", size = 8162193, upload-time = "2026-12-01T16:31:02.23Z" }, + { url = "https://files.pythonhosted.org/packages/f0/1d/636eafcd254df09a02a307ce4ecc09640154361b860ce086d78052577a2a/mujoco_core-4.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:485d4b76c5e04a2a827d082ff1b76f82a719f6e5ee0f30dcacbe0260541ff0ef", size = 10201253, upload-time = "2026-12-01T16:31:03.898Z" }, + { url = "https://files.pythonhosted.org/packages/f6/5e/09af73eaf08a21fc9e0409bd144acc41c9fd826fd7b0472fe175c750217f/mujoco_core-4.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d8ed2e5a5a5ac7a57d9b9ee0c60f57759c85e37604106653ee7d9fb016f272fb", size = 9027179, upload-time = "2026-12-01T16:31:06.366Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e1/b90937bb2347e1badf51b57b586db6d1b73000146f37d9f7d4747b9958f8/mujoco_core-4.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c35d8549a606c173328d1a50b0c2fa470e27f6ed0e57dadc2e1f1db1ff674dc", size = 9748493, upload-time = "2026-12-01T16:31:09.217Z" }, + { url = "https://files.pythonhosted.org/packages/6b/d9/75146dae2a66cd22d9addc1293ea1d21d3e38162a5f6dc75e277177640bf/mujoco_core-4.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:771e7aa6f7dccd1c4a96ecac4fe8176345087a842c2547a7f995d375019f0a3e", size = 8268361, upload-time = "2026-12-01T16:31:11.75Z" }, + { url = "https://files.pythonhosted.org/packages/b9/85/c59e12324f69f5949c5781a2c3b17a0e4a2883f702f058e0b7f376219170/mujoco_core-4.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:085b790f38081a12cea7c3dfede8c2129d4048288c227463e55387b157646279", size = 10201350, upload-time = "2026-12-01T16:31:14.163Z" }, + { url = "https://files.pythonhosted.org/packages/66/cd/54fb41e59700a809618062178391d79ab5b0dace167b355a177ae9ef197b/mujoco_core-4.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:880eaaa60cd3eca1316f66bf750350cdd264ebc6a9f156fd97a3b38172c0f021", size = 9026855, upload-time = "2026-12-01T16:31:17.499Z" }, + { url = "https://files.pythonhosted.org/packages/25/e9/5d79ae9a000fe43721228dfaf9e6099a3110ab056bb87031a860948b0bde/mujoco_core-4.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:30daedac2e9f54f2b8cd24228ed831ebea1802d83bae776b5f471c4f09fbf910", size = 9748983, upload-time = "2026-12-01T16:31:20.662Z" }, + { url = "https://files.pythonhosted.org/packages/4e/99/d831aafea70dd5d2e72d9f92375eddcc79d0968e7c6d404b84c2b24be904/mujoco_core-4.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:7c97d779e9212aa28d931ee10e91b266dc47ca611b85cd8734d0476aa090fcd0", size = 8268891, upload-time = "2026-12-01T16:31:23.246Z" }, ] [[package]] name = "mujoco-studio" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mujoco-core" }, @@ -2365,29 +2365,29 @@ dependencies = [ { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" } }, { name = "websockets" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/e7/eb/57a62669a40678a8e01d7bd05ce3122af948a19c81fff6c386f5e9dc1c3b/mujoco_studio-4.0.1.tar.gz", hash = "sha256:d5bc8ba43d747737c3922411a7b6466f984983018abdd5f46bb8ba20f6c4cece", size = 421236, upload-time = "2026-11-11T16:21:53.784Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d2/fe/8f519600b9d0258cda1c1b6d3dca09b87cd6450a938a328fb887440b1fb2/mujoco_studio-4.1.0.tar.gz", hash = "sha256:10c42f9eeae272e72548ef925529d09f6fd28002fb8365f8f4b71554ff7c6d92", size = 435165, upload-time = "2026-12-01T16:33:08.874Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/99/77/78661de9c79efc5ca988cd8e979e00d1a9e1517eecb26249469492b5024a/mujoco_studio-4.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:670f9d7d356c5b6497ab9e15d4bc10104a7ebe1df6eb0f849a9d5d6bc618aa6c", size = 7829462, upload-time = "2026-11-11T16:20:54.489Z" }, - { url = "https://files.pythonhosted.org/packages/12/b4/d496e0efaa8fcaacb09e825e243cae012eeef6479bdd49e9f9e8ed4bc319/mujoco_studio-4.0.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caa515ff656315c92b9673a1be5b2297dcc2af140790196cda6abff0b239dd50", size = 8277699, upload-time = "2026-11-11T16:20:56.868Z" }, - { url = "https://files.pythonhosted.org/packages/f6/42/be29eaba49a15b219ffc1e1bf375bbb703ca92c5979e361df1856ea79dd0/mujoco_studio-4.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:79fe3fc42e97d5b824a1b376c30d495df5f4221087b897331ee17d76b4fa9eef", size = 8710126, upload-time = "2026-11-11T16:20:58.695Z" }, - { url = "https://files.pythonhosted.org/packages/e6/31/b840263240ea1c1f7b7f6bcffa069c8f166d3cb3f69debeb5ae4479bd2c0/mujoco_studio-4.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:aae6a86668434de9b2799ef82c01e55b57bc8fc671b5e783a0f3c4697fc5ec25", size = 7975944, upload-time = "2026-11-11T16:21:01.062Z" }, - { url = "https://files.pythonhosted.org/packages/1b/0e/f2db09bab7dfc888ca1158e43a4cb0daa8ea6b7c0e40043b6e442653ffba/mujoco_studio-4.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c7939d48e5933e2bc9c92726939aa9b1e960481ba279b3dbdf6e70b29e04e67d", size = 7841031, upload-time = "2026-11-11T16:21:03.15Z" }, - { url = "https://files.pythonhosted.org/packages/a6/41/e73d8b8ca1a7727294bdc4ab74765335e97510a383f94d270c1dc8778dbb/mujoco_studio-4.0.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a58749829eef277375a0dedde533a4c88e0c396dd2b4f57f99146f67cf2c652", size = 8288869, upload-time = "2026-11-11T16:21:05.61Z" }, - { url = "https://files.pythonhosted.org/packages/30/c5/39781fb518059323aedacdd32cf7089ad39aa58ca211d2a2c44fb8cbc11f/mujoco_studio-4.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9f8e18cccbc69de0c888f487e2d3348c31b87f578ef557659b7bf4a3a739f38", size = 8749028, upload-time = "2026-11-11T16:21:07.771Z" }, - { url = "https://files.pythonhosted.org/packages/13/7f/a42796ce63c3de4a4e2b4b63c2e6194f58f5947b5c6822bdcc7e3227b46c/mujoco_studio-4.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:95f0265ea176b75166eece21e350f6a6b226486e4f7657761d8b8eb2fbecc8fc", size = 8014662, upload-time = "2026-11-11T16:21:10.001Z" }, - { url = "https://files.pythonhosted.org/packages/a4/33/715463cebaf6a092b2ca1756555c0899c0a464beea35bcf8f8aa93bfb3ad/mujoco_studio-4.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d4af70cd2a132d4c5cafaec67a741f694fd76615deef580e7770aa257926a19f", size = 7840937, upload-time = "2026-11-11T16:21:12.186Z" }, - { url = "https://files.pythonhosted.org/packages/7e/6b/122fae837ba6866583ca320c74532319b0aaee32a1c4b9e460f6e5f0d571/mujoco_studio-4.0.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:742323ab12b39b9320b3abbd57c2889efd375a55b2e9ec74b33c048f6aa5785d", size = 8288723, upload-time = "2026-11-11T16:21:14.729Z" }, - { url = "https://files.pythonhosted.org/packages/34/66/7437daa3ca2cbd9a4a89a89b4bc7bcfdcead566b03c661337b1fd157e379/mujoco_studio-4.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cbfe9e39fb89cd43b6d1236b9d8c676e833c763c694cab433ba381eb34c95c1d", size = 8749236, upload-time = "2026-11-11T16:21:17.078Z" }, - { url = "https://files.pythonhosted.org/packages/18/60/0af24570bd85a48f812ba40c432c79aaa3eb70dd45f3677337d34403f267/mujoco_studio-4.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:09352051bcba7510b51a26cb02c47c7ff8ab1c71c332919f92c77e71d5ee9b07", size = 8014774, upload-time = "2026-11-11T16:21:19.878Z" }, + { url = "https://files.pythonhosted.org/packages/ce/2c/fbf327e6d19761a4811d606d62e3ae5d6f54f0bf19c30026b407d5530424/mujoco_studio-4.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ca5894b293daeef8cfa07d33a566ab9cff12a93cc956675936e00a0b5d3b6de8", size = 7147090, upload-time = "2026-12-01T16:32:14.435Z" }, + { url = "https://files.pythonhosted.org/packages/ae/2e/a3536db6120024e5aeb3681a01bedbea65c7a63b263be623bd9ba65b0871/mujoco_studio-4.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0ab829adf5f7cff96dd8054164f8c71996edf3e0456f50347d54728938e81dd", size = 7585787, upload-time = "2026-12-01T16:32:16.501Z" }, + { url = "https://files.pythonhosted.org/packages/6d/bf/03cc362a68b302b429016bdec7112df05231cfe9dc4da2120e7496e618d8/mujoco_studio-4.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e9e6445a8d3d9a763c46af018c6c8fb14cd0f8fb8a57aafc84421e8f72a97b1", size = 8023082, upload-time = "2026-12-01T16:32:18.352Z" }, + { url = "https://files.pythonhosted.org/packages/e8/38/7ca0efefb0b069b901f95b5cc7e2773be9faa0213285bf6b3100c6b61b79/mujoco_studio-4.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:1694be32c683f48cd447f20edcbe34962616911784b4ca02fa07263234dce53b", size = 7272075, upload-time = "2026-12-01T16:32:20.822Z" }, + { url = "https://files.pythonhosted.org/packages/65/93/5f08c9113601af3a554e2181111476a68ccd000365c8a5816617480dc344/mujoco_studio-4.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f17de5b967bae10de3ac4b183f9fad3cd4d9277b20e8c690219f8c4443f68ef6", size = 7156503, upload-time = "2026-12-01T16:32:22.737Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b3/6b83bc9cb0d5d9703cfcdf5766b474edd04e390aa7dfb51993435c5deccf/mujoco_studio-4.1.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:517d00cac468f37c2948776adddf58f5728d8efaee46d2190273ef4db79a1dd7", size = 7597766, upload-time = "2026-12-01T16:32:24.906Z" }, + { url = "https://files.pythonhosted.org/packages/35/be/5735adffd849ed715510a942cdf96a2444f2edf1aa3157ed6cc13473a9f0/mujoco_studio-4.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3054e306efd58823027d85ea34afe9e8f0e5f8939291056d09d70e73a02ee55c", size = 8060974, upload-time = "2026-12-01T16:32:27.142Z" }, + { url = "https://files.pythonhosted.org/packages/84/af/f7ff9b1f94aea092e55d3fc1e0fb803b9be12b228b664bb32d466e30e8f9/mujoco_studio-4.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:467cf427123b26fc3661d087c9291312e491467805003467ddd7e2a7fad30411", size = 7307749, upload-time = "2026-12-01T16:32:29.116Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/c07a238e5ae4a2f635076c9a386763d1e834005b5bd4a370decadfd188b9/mujoco_studio-4.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fa67da1a08aca47a1ac57eb3eea529574c17cf5f4da21f54122aeba6b19cb435", size = 7156709, upload-time = "2026-12-01T16:32:31.001Z" }, + { url = "https://files.pythonhosted.org/packages/65/92/58d2fac2e08d1212e8a0b98330b5039119863b32a316040de13c4a3b24ae/mujoco_studio-4.1.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:09ceeb241ddcf20aebed1bb358a1a8bc8f02053dcfeec331cc65fae552706f11", size = 7597258, upload-time = "2026-12-01T16:32:32.669Z" }, + { url = "https://files.pythonhosted.org/packages/66/2d/ba59fca70926c85012dc56e458a00b1cca569084003c52639507644b48f4/mujoco_studio-4.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4be19385967d5834bfcc399a8e03891a12e3e4d3014bee596ee8cf8f98c1149", size = 8061364, upload-time = "2026-12-01T16:32:34.581Z" }, + { url = "https://files.pythonhosted.org/packages/5d/f9/908e4b5fb0e1a27cd4b3fe277013a5d7341529dbf497dc2b60dd221a02c1/mujoco_studio-4.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:f26aa0e282160a6792f36792c87d1704c290f91bab4520f625eb5fefa588fa1e", size = 7307864, upload-time = "2026-12-01T16:32:37.012Z" }, ] [[package]] name = "mujoco-studio-wasm" -version = "4.0.1" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5b/20/d58817c428a858f9df7e46b18ea0434a581544a61756908f23acfb0cda38/mujoco_studio_wasm-4.0.1.tar.gz", hash = "sha256:90eb6c05d57e5b3171cf8a2ac4f491e3f1a1dcab2c06375f49b5c98dac8d5bfa", size = 2482121, upload-time = "2026-11-11T16:20:47.965Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/a5/244c4fe1414a556e388f5f5cb61fa12c95a715fa225a17290a31e37c6517/mujoco_studio_wasm-4.1.0.tar.gz", hash = "sha256:7bf9601dc4561ecd76b5f4eca3d1b3d4f9e86aacdc7821a2c4326cd36c16c668", size = 2584839, upload-time = "2026-12-01T16:32:08.285Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/f7/f59dc75abfbc4f232666ada6ae3946da0af8a8bcd46f058ee063786c3681/mujoco_studio_wasm-4.0.1-py3-none-any.whl", hash = "sha256:14d724721c971ec208baeb6b449797a9cd456ea0331bc8e8a8722e7823e60ccc", size = 2442076, upload-time = "2026-11-11T16:20:45.826Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f0/e784efd985867c745395410d89985d705de93ca4dac85fb41cb7ab8bf65c/mujoco_studio_wasm-4.1.0-py3-none-any.whl", hash = "sha256:588562726c1ace9d78e3778a17f944b23b904376fa5ea26fa52840c5267e8f7f", size = 2545870, upload-time = "2026-12-01T16:32:05.977Z" }, ] [[package]] @@ -4841,7 +4841,7 @@ motrix = [ ] mujoco = [ { name = "mjbatch-uni", marker = "python_full_version >= '3.11'" }, - { name = "mujoco", version = "4.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "mujoco", version = "4.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] unirl = [ { name = "rsl-rl-lib" }, @@ -4875,8 +4875,8 @@ requires-dist = [ { name = "imageio-ffmpeg", specifier = ">=0.6.0" }, { name = "lark", specifier = ">=1.3.1" }, { name = "mediapy" }, - { name = "mjbatch-uni", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "==0.3.4" }, - { name = "mujoco", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "~=4.0.1" }, + { name = "mjbatch-uni", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "==0.3.5" }, + { name = "mujoco", marker = "python_full_version >= '3.11' and extra == 'mujoco'", specifier = "~=4.1.0" }, { name = "ninja", marker = "sys_platform == 'linux'" }, { name = "numpy" }, { name = "omegaconf" }, @@ -4895,8 +4895,8 @@ requires-dist = [ { name = "trimesh", specifier = ">=3.21.7" }, { name = "triton-rocm", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'", specifier = "==3.8.0", index = "https://download.pytorch.org/whl/rocm7.2" }, { name = "typing-extensions" }, - { name = "unisim-core", specifier = "==2.9.2" }, - { name = "unisim-core", extras = ["motrix"], marker = "extra == 'motrix'", specifier = "==2.9.2" }, + { name = "unisim-core", specifier = "==2.9.3" }, + { name = "unisim-core", extras = ["motrix"], marker = "extra == 'motrix'", specifier = "==2.9.3" }, { name = "viser", specifier = ">=1.0.26" }, { name = "wandb", marker = "extra == 'unirl'", specifier = ">=0.22.3" }, ] @@ -4915,15 +4915,15 @@ rl = [{ name = "unilab", extras = ["unirl"] }] [[package]] name = "unisim-core" -version = "2.9.2" +version = "2.9.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, { name = "numpy", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/6b/d9/93d416d17b960e993767af0a6cf523209f6265b07a81fb4f898e224acdd4/unisim_core-2.9.2.tar.gz", hash = "sha256:5c1cb692a37b4baf34ae8ebb9d97b13ffe342b96c9d6d287f53311f4113aec93", size = 896921, upload-time = "2026-12-03T06:53:02.89Z" } +sdist = { url = "https://files.pythonhosted.org/packages/28/ee/5db225ceb33459862e3ae63d597d58362066184676f57ef21115f1726b3f/unisim_core-2.9.3.tar.gz", hash = "sha256:9f294e81fd66b12346918b789795bc6b33b1c03bb8a053e86feb8406dee6f139", size = 897754, upload-time = "2026-12-03T11:02:04.348Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bf/5e/97fa58081c0538e0707038b40a293aa531cdc1765c641762a500abe3440e/unisim_core-2.9.2-py3-none-any.whl", hash = "sha256:273fcce283fc70a4f91ab28ab6e20dcee9e9cae1da9e1962e923bf72a87d73d4", size = 954044, upload-time = "2026-12-03T06:53:00.987Z" }, + { url = "https://files.pythonhosted.org/packages/4a/c5/b36f8d491ae9c76b6fa5f6d735b831bb9e474fc874af3879b96bd52f62c5/unisim_core-2.9.3-py3-none-any.whl", hash = "sha256:801d8bd82b4a99610f01ae52bb73d8412892910a4bd7772d26490da7769cb454", size = 954856, upload-time = "2026-12-03T11:02:02.139Z" }, ] [package.optional-dependencies] From 9295ec3963c178743fb6552bcf3f7a7f38ed98e1 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 19:53:03 +0800 Subject: [PATCH 6/9] docs: update MuJoCo 4.1 installation versions --- .../en/1-getting_started/2-installation.md | 18 +++++++++--------- .../en/2-user_guide/3-backends/1-mujoco.md | 6 +++--- .../en/2-user_guide/3-backends/7-newton.md | 2 +- .../zh_CN/1-getting_started/2-installation.md | 18 +++++++++--------- .../zh_CN/2-user_guide/3-backends/1-mujoco.md | 8 ++++---- .../zh_CN/2-user_guide/3-backends/7-newton.md | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/sphinx/source/en/1-getting_started/2-installation.md b/docs/sphinx/source/en/1-getting_started/2-installation.md index 96e6188b0..a6d5aad30 100644 --- a/docs/sphinx/source/en/1-getting_started/2-installation.md +++ b/docs/sphinx/source/en/1-getting_started/2-installation.md @@ -9,8 +9,8 @@ live in the getting-started and algorithm pages. - `uv`, used for dependency sync and command execution. - Git and `curl`, used to clone the repository and fetch runtime assets. - For the `mujoco` and `mjwarp` extras: Python `>=3.11` is required by the - MuJoCo 4.0 line. The `mujoco` extra installs the published - `mjbatch-uni==0.3.3` native engine, which provides prebuilt wheels for + MuJoCo 4.1 line. The `mujoco` extra installs the published + `mjbatch-uni==0.3.5` native engine, which provides prebuilt wheels for CPython 3.11–3.13 on Linux, macOS, and Windows. If a source build is needed, install a C++17 toolchain and Python development headers: - macOS: `xcode-select --install` @@ -83,7 +83,7 @@ pip install -e . # pip install . # MuJoCo (Python >=3.11): -pip install "mujoco~=4.0.1" "mjbatch-uni==0.3.3" +pip install "mujoco~=4.1.0" "mjbatch-uni==0.3.5" ``` The editable install points at the checkout; the regular install copies the @@ -120,7 +120,7 @@ claim; use the generated support matrix for the evidence grade of each algorithm/task/backend combination. ```bash -# Compatible MuJoCo 4.0-line backends: +# Compatible MuJoCo 4.1-line backends: uv sync --extra mujoco --extra mjwarp --extra genesis --extra motrix --extra mtxwarp # Newton and SuperDex use MuJoCo 3.11; sync them separately from the set above: @@ -130,13 +130,13 @@ uv sync --extra superdex | Backend | Install path | Important prerequisites | | --- | --- | --- | -| MuJoCo | `make setup` or `uv sync --extra mujoco` | Python >=3.11; installs prebuilt `mjbatch-uni==0.3.3` wheels where available | +| MuJoCo | `make setup` or `uv sync --extra mujoco` | Python >=3.11; installs prebuilt `mjbatch-uni==0.3.5` wheels where available | | MJWarp | `uv sync --extra mujoco --extra mjwarp` | Python >=3.11 and NVIDIA CUDA; on a single-GPU host the current CUDA device is used by default, while multi-GPU topology remains explicit | | Genesis | `uv sync --extra genesis` | Linux x86_64 with NVIDIA CUDA; Linux ROCm uses HIP Torch and exact `gs.amdgpu` (see the ROCm notes) | | Newton | `uv sync --extra newton` | Linux CUDA with the pinned newton / MuJoCo-Warp / Warp versions; use a separate environment from `mujoco` and `mjwarp` | | Motrix | `uv sync --extra motrix` | CPU-authoritative MotrixSim with packed Torch HOST_BRIDGE transfers | | Motrix Warp | `uv sync --extra mtxwarp` | CUDA-resident MotrixSim on Linux x86_64 with NVIDIA CUDA | -| SuperDex | `uv sync --extra superdex` | Python 3.12 or 3.13 on Linux x86_64; scoped to the configured PPO `go2_joystick_flat` owner and separate from the MuJoCo 4.0-line extras | +| SuperDex | `uv sync --extra superdex` | Python 3.12 or 3.13 on Linux x86_64; scoped to the configured PPO `go2_joystick_flat` owner and separate from the MuJoCo 4.1-line extras | | Drake | `make setup-drake` | Local Drake C++ prefix plus the DrakeUni native batch extension; currently scoped to PPO `go2_joystick_flat` | | IsaacGym | `bash scripts/tools/setup_isaacgym_env.sh` | Isolated external Python 3.8 IsaacGym Preview 4 worker on Linux CUDA | | IsaacSim | `bash scripts/tools/setup_isaacsim_env.sh` | Isolated external Python 3.11 IsaacSim/IsaacLab worker on Linux CUDA | @@ -183,8 +183,8 @@ If your code imports `uni_rl` directly, see ## Switching The Local MuJoCo Version -On Python 3.11 and newer, the `mujoco` extra declares `mujoco~=4.0.1` and -`mjbatch-uni==0.3.3`. The engine records its build-time mujoco version and +On Python 3.11 and newer, the `mujoco` extra declares `mujoco~=4.1.0` and +`mjbatch-uni==0.3.5`. The engine records its build-time mujoco version and refuses to import against a different one (see the watchdog row in "Install Error Signatures"). Switching the local MuJoCo version therefore requires a compatible `mjbatch` release — it is not a UniLab config change: @@ -219,7 +219,7 @@ playback uses the `mjpython` application bundled by the official MuJoCo wheel. T `cuda` alias resolves to MPS when CUDA is absent. On Windows, use the direct `uv sync` commands from above unless GNU `make` and -Bash are available. `mjbatch-uni` 0.3.3 publishes Windows wheels, but the +Bash are available. `mjbatch-uni` 0.3.5 publishes Windows wheels, but the MuJoCo physics backend is not a validated Windows support lane; plain `mujoco` (MJCF conversion and playback rendering via other backends) still installs. If you want to use the Makefile, install GNU Make and Bash separately diff --git a/docs/sphinx/source/en/2-user_guide/3-backends/1-mujoco.md b/docs/sphinx/source/en/2-user_guide/3-backends/1-mujoco.md index 4993fa0fb..3b5df2493 100644 --- a/docs/sphinx/source/en/2-user_guide/3-backends/1-mujoco.md +++ b/docs/sphinx/source/en/2-user_guide/3-backends/1-mujoco.md @@ -2,7 +2,7 @@ MuJoCo is the default backend path in the committed owner configs. On Python 3.11 and newer, the `mujoco` extra installs the official `mujoco` package -(`~=4.0.1`) plus the published `mjbatch-uni==0.3.3` native batch engine, with +(`~=4.1.0`) plus the published `mjbatch-uni==0.3.5` native batch engine, with exact versions pinned by the committed `uv.lock`. Python 3.10 is not a supported backend lane: dependency markers leave the extra empty and the runtime fails closed. The adapter lives under `unisim.backend.mujoco`. @@ -30,8 +30,8 @@ rather than opening the Motrix native interactive renderer. ## Switching MuJoCo Versions -On Python 3.11 and newer, pyproject constrains `mujoco~=4.0.1` and pins -`mjbatch-uni==0.3.3`; the committed `uv.lock` pins the exact default versions, +On Python 3.11 and newer, pyproject constrains `mujoco~=4.1.0` and pins +`mjbatch-uni==0.3.5`; the committed `uv.lock` pins the exact default versions, and uv's prefer-locked semantics keep ordinary relocks from drifting. The `mjbatch` engine records its build-time `mujoco` version and refuses to import against a different one (fail-closed, never a silent behavior change). diff --git a/docs/sphinx/source/en/2-user_guide/3-backends/7-newton.md b/docs/sphinx/source/en/2-user_guide/3-backends/7-newton.md index c1067cf6d..7f0c39577 100644 --- a/docs/sphinx/source/en/2-user_guide/3-backends/7-newton.md +++ b/docs/sphinx/source/en/2-user_guide/3-backends/7-newton.md @@ -51,7 +51,7 @@ The extra pins `newton==1.5.1`, `mujoco-warp==3.11.0`, and `mujoco==3.11.0` exactly, requires `warp-lang>=1.16.0` (resolved to 1.17.0 in `uv.lock`), and includes the native ViewerGL dependencies (`pyglet>=2.1.6,<3`, `imgui-bundle>=1.92.0`). The `mujoco` and `mjwarp` extras -now use the MuJoCo 4.0.1 line, so their dependency resolver declarations are +now use the MuJoCo 4.1.0 line, so their dependency resolver declarations are explicitly mutually exclusive with `newton`. Install Newton in a separate environment; do not combine it with the `mujoco` or `mjwarp` extra. diff --git a/docs/sphinx/source/zh_CN/1-getting_started/2-installation.md b/docs/sphinx/source/zh_CN/1-getting_started/2-installation.md index 4ad295ee7..8fe3c1249 100644 --- a/docs/sphinx/source/zh_CN/1-getting_started/2-installation.md +++ b/docs/sphinx/source/zh_CN/1-getting_started/2-installation.md @@ -7,8 +7,8 @@ - Python `>=3.10,<3.14`,来自 `pyproject.toml`。 - `uv`,用于依赖同步和命令执行。 - Git 和 `curl`,用于克隆仓库及下载 runtime asset。 -- 使用 `mujoco` 和 `mjwarp` extra 时:MuJoCo 4.0 版本线要求 Python `>=3.11`。 - `mujoco` extra 安装发布版 `mjbatch-uni==0.3.3` 原生引擎,其为 Linux、 +- 使用 `mujoco` 和 `mjwarp` extra 时:MuJoCo 4.1 版本线要求 Python `>=3.11`。 + `mujoco` extra 安装发布版 `mjbatch-uni==0.3.5` 原生引擎,其为 Linux、 macOS 和 Windows 上的 CPython 3.11–3.13 提供预编译 wheel。若需要从源码 构建,请安装 C++17 工具链和 Python 开发头文件: - macOS:`xcode-select --install` @@ -77,7 +77,7 @@ pip install -e . # pip install . # 需要 MuJoCo 时(Python >=3.11): -pip install "mujoco~=4.0.1" "mjbatch-uni==0.3.3" +pip install "mujoco~=4.1.0" "mjbatch-uni==0.3.5" ``` editable install 会指向源码 checkout;常规安装会把 package 和任务配置 @@ -108,7 +108,7 @@ Hugging Face endpoint 无法访问时,可设置 `HF_ENDPOINT=https://hf-mirror 证据等级请查看生成的支持矩阵。 ```bash -# 可组合的 MuJoCo 4.0 版本线后端: +# 可组合的 MuJoCo 4.1 版本线后端: uv sync --extra mujoco --extra mjwarp --extra genesis --extra motrix --extra mtxwarp # Newton 和 SuperDex 使用 MuJoCo 3.11,需与上面一组分开同步: @@ -118,13 +118,13 @@ uv sync --extra superdex | 后端 | 安装路径 | 重要前置条件 | | --- | --- | --- | -| MuJoCo | `make setup` 或 `uv sync --extra mujoco` | Python >=3.11;在可用平台上安装预编译 `mjbatch-uni==0.3.3` wheel | +| MuJoCo | `make setup` 或 `uv sync --extra mujoco` | Python >=3.11;在可用平台上安装预编译 `mjbatch-uni==0.3.5` wheel | | MJWarp | `uv sync --extra mujoco --extra mjwarp` | Python >=3.11 与 NVIDIA CUDA;单 GPU 主机默认使用当前 CUDA 设备,多卡拓扑仍需显式配置 | | Genesis | `uv sync --extra genesis` | Linux x86_64 + NVIDIA CUDA;Linux ROCm 使用 HIP Torch 和 exact `gs.amdgpu`(见下方 ROCm 说明) | | Newton | `uv sync --extra newton` | Linux CUDA,并钉定 newton / MuJoCo-Warp / Warp 版本;需与 `mujoco`、`mjwarp` 使用独立环境 | | Motrix | `uv sync --extra motrix` | CPU-authoritative MotrixSim 与 packed Torch HOST_BRIDGE 传输 | | Motrix Warp | `uv sync --extra mtxwarp` | Linux x86_64 + NVIDIA CUDA 上的 CUDA-resident MotrixSim | -| SuperDex | `uv sync --extra superdex` | Linux x86_64 上的 Python 3.12 或 3.13;当前 scoped 到已配置的 PPO `go2_joystick_flat` owner,并与 MuJoCo 4.0 版本线 extras 分开安装 | +| SuperDex | `uv sync --extra superdex` | Linux x86_64 上的 Python 3.12 或 3.13;当前 scoped 到已配置的 PPO `go2_joystick_flat` owner,并与 MuJoCo 4.1 版本线 extras 分开安装 | | Drake | `make setup-drake` | 本地 Drake C++ 前缀与 DrakeUni native batch extension;当前 scoped 到 PPO `go2_joystick_flat` | | IsaacGym | `bash scripts/tools/setup_isaacgym_env.sh` | Linux CUDA 上隔离的外部 Python 3.8 IsaacGym Preview 4 worker | | IsaacSim | `bash scripts/tools/setup_isaacsim_env.sh` | Linux CUDA 上隔离的外部 Python 3.11 IsaacSim/IsaacLab worker | @@ -167,8 +167,8 @@ extra(例如从 `mujoco` 换到 `newton`)不会再卸载训练栈, ## 切换本地 MuJoCo 版本 -在 Python 3.11 及更高版本上,`mujoco` extra 声明 `mujoco~=4.0.1` 和 -`mjbatch-uni==0.3.3`。引擎会记录编译时的 mujoco 版本,加载时检测到不一致 +在 Python 3.11 及更高版本上,`mujoco` extra 声明 `mujoco~=4.1.0` 和 +`mjbatch-uni==0.3.5`。引擎会记录编译时的 mujoco 版本,加载时检测到不一致 会拒绝导入(见「安装错误特征对照表」中的 watchdog 行)。因此切换本地 MuJoCo 版本需要兼容的 `mjbatch` 发布版本,而不是修改 UniLab 配置: @@ -200,7 +200,7 @@ wheel 来源是在 `pyproject.toml` 中配置的 PyTorch `cu130` 索引。 没有 CUDA 时,`cuda` alias 会解析到 MPS。 在 Windows 上,如果没有 GNU `make` 和 Bash,请使用上面的直接 `uv sync` 命令。 -`mjbatch-uni` 0.3.3 已发布 Windows wheel,但 MuJoCo 物理后端尚未形成经过验证的 +`mjbatch-uni` 0.3.5 已发布 Windows wheel,但 MuJoCo 物理后端尚未形成经过验证的 Windows 支持通道;纯 `mujoco`(MJCF 转换、其他后端的回放渲染)仍可安装。 如果要使用 Makefile,请另行安装 GNU Make 和 Bash(例如通过 Chocolatey 或 WSL)。 diff --git a/docs/sphinx/source/zh_CN/2-user_guide/3-backends/1-mujoco.md b/docs/sphinx/source/zh_CN/2-user_guide/3-backends/1-mujoco.md index e3d0ca064..febb37162 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/3-backends/1-mujoco.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/3-backends/1-mujoco.md @@ -1,8 +1,8 @@ # MuJoCo 后端 MuJoCo 是已提交 owner 配置中的默认后端路径。在 Python 3.11 及更高版本上, -`mujoco` extra 安装官方 `mujoco` 包(`~=4.0.1`)和发布版 -`mjbatch-uni==0.3.3` 原生 batch 引擎,精确版本由已提交的 `uv.lock` 钉住。 +`mujoco` extra 安装官方 `mujoco` 包(`~=4.1.0`)和发布版 +`mjbatch-uni==0.3.5` 原生 batch 引擎,精确版本由已提交的 `uv.lock` 钉住。 Python 3.10 不是受支持的后端路径:依赖 marker 会使 extra 为空,运行时会 fail closed。适配层位于 `unisim.backend.mujoco` 下。 @@ -27,8 +27,8 @@ MuJoCo 在 `unisim.backend.mujoco.backend` 中声明对物理状态回放的支 ## 切换 MuJoCo 版本 -在 Python 3.11 及更高版本上,pyproject 约束 `mujoco~=4.0.1` 并钉定 -`mjbatch-uni==0.3.3`;默认精确版本由已提交的 `uv.lock` 钉住,uv 的 +在 Python 3.11 及更高版本上,pyproject 约束 `mujoco~=4.1.0` 并钉定 +`mjbatch-uni==0.3.5`;默认精确版本由已提交的 `uv.lock` 钉住,uv 的 prefer-locked 语义保证普通 relock 不会漂移。`mjbatch` 引擎记录编译时的 `mujoco` 版本,拒绝在其它版本下导入(fail-closed,不会静默改变行为)。 因此切换版本需要兼容的 `mjbatch` 发布版本: diff --git a/docs/sphinx/source/zh_CN/2-user_guide/3-backends/7-newton.md b/docs/sphinx/source/zh_CN/2-user_guide/3-backends/7-newton.md index 46963fea8..c76681113 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/3-backends/7-newton.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/3-backends/7-newton.md @@ -48,7 +48,7 @@ pip install "unilab[newton]" `mujoco==3.11.0`,要求 `warp-lang>=1.16.0`(`uv.lock` 解析为 1.17.0),并包含 原生 ViewerGL 依赖(`pyglet>=2.1.6,<3`、`imgui-bundle>=1.92.0`)。`mujoco` 和 `mjwarp` extra -现使用 MuJoCo 4.0.1 版本线,依赖解析声明与 `newton` 明确互斥。请在独立环境 +现使用 MuJoCo 4.1.0 版本线,依赖解析声明与 `newton` 明确互斥。请在独立环境 中安装 Newton,不要与 `mujoco` 或 `mjwarp` extra 组合安装。 前置条件: From 0e4fe205031de9d09ad0a660c633d5fc8efaf6a3 Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 19:57:29 +0800 Subject: [PATCH 7/9] fix(env): drain reset diagnostics on nonfatal polls --- src/unilab/base/torch_env.py | 1 + tests/envs/test_fixed_shape_autoreset.py | 71 +++++++++++++++++++++++- 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/src/unilab/base/torch_env.py b/src/unilab/base/torch_env.py index 46731ae48..8231f04cb 100644 --- a/src/unilab/base/torch_env.py +++ b/src/unilab/base/torch_env.py @@ -1447,6 +1447,7 @@ def poll_finite_validation(self, *, force: bool = False) -> bool: if callable(poll) and poll() is False: handled_nonfatal = True if handled_nonfatal and base_valid: + self._publish_reset_done_interval() return True sources: list[str] = [] if not base_valid: diff --git a/tests/envs/test_fixed_shape_autoreset.py b/tests/envs/test_fixed_shape_autoreset.py index 350e363a6..dd241d956 100644 --- a/tests/envs/test_fixed_shape_autoreset.py +++ b/tests/envs/test_fixed_shape_autoreset.py @@ -9,11 +9,12 @@ from __future__ import annotations import gc +import itertools import weakref from collections.abc import Iterator from contextlib import contextmanager from dataclasses import dataclass -from typing import Any, cast +from typing import Any, Literal, cast import numpy as np import pytest @@ -714,6 +715,74 @@ def test_masked_reset_diagnostics_publish_complete_intervals(device: str) -> Non assert all(non_poll.info["timing"][key] == 0.0 for key in RESET_DONE_DETAIL_TIMING_KEYS) +@pytest.mark.parametrize("nan_policy", ["warn", "sanitize"]) +def test_nonfatal_observation_polls_publish_aligned_reset_diagnostics( + monkeypatch: pytest.MonkeyPatch, + nan_policy: Literal["warn", "sanitize"], +) -> None: + inject_nonfinite = True + + def observation(env: ManagerBasedRlEnv) -> torch.Tensor: + values = _policy_obs(env) + if not inject_nonfinite: + return values + values = values.clone() + values[0, 0] = torch.nan + return values + + env, _ = _make_env( + "cpu", + masked_autoreset=True, + persistent_step_buffers=True, + finite_validation_interval=3, + observations={ + "actor": ObservationGroupCfg( + terms={"policy": ObservationTermCfg(func=observation, history_length=3)}, + nan_policy=nan_policy, + ), + "value": ObservationGroupCfg(terms={"critic": ObservationTermCfg(func=_critic_obs)}), + }, + ) + env.reset() + env.set_episode_length_buf(torch.zeros(NUM_ENVS, dtype=torch.int64)) + clock = itertools.count() + monkeypatch.setattr( + "unilab.base.reset_diagnostics.time.perf_counter_ns", + lambda: next(clock) * 1_000_000, + ) + action = torch.zeros((NUM_ENVS, 1)) + action[0] = 0.9 + + for step in range(1, 4): + first = env.step(action) + if step < 3: + assert first.info["timing"]["reset_done_count"] == 0.0 + assert "Episode_Metrics/length" not in first.info["log"] + assert first.info["timing"]["reset_done_count"] == 3.0 + first_reset_call_ms = first.info["timing"]["reset_done_reset_call_ms"] + assert first_reset_call_ms > 0.0 + assert first.info["log"]["Episode_Metrics/length"] == pytest.approx(1.0) + assert first.info["log"]["Episode_Termination/failure"] == 3 + assert first.info["log"]["Episode_Termination/time_out"] == 0 + + env.poll_finite_validation(force=True) + assert first.info["timing"]["reset_done_count"] == 3.0 + assert first.info["timing"]["reset_done_reset_call_ms"] == first_reset_call_ms + assert first.info["log"]["Episode_Metrics/length"] == pytest.approx(1.0) + + inject_nonfinite = False + for step in range(4, 7): + second = env.step(action) + if step < 6: + assert second.info["timing"]["reset_done_count"] == 0.0 + assert "Episode_Metrics/length" not in second.info["log"] + assert second.info["timing"]["reset_done_count"] == 10.0 + assert second.info["timing"]["reset_done_reset_call_ms"] == first_reset_call_ms + assert second.info["log"]["Episode_Metrics/length"] == pytest.approx(2.05) + assert second.info["log"]["Episode_Termination/failure"] == 3 + assert second.info["log"]["Episode_Termination/time_out"] == 7 + + def test_deferred_named_checks_fail_closed_at_the_poll_boundary() -> None: env, _ = _make_env("cpu", masked_autoreset=True, persistent_step_buffers=True) env.reset() From 95b43f950fe80d5fcc474af7f7e4ef33131474cc Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 20:07:00 +0800 Subject: [PATCH 8/9] fix(env): guard captured body source addresses --- src/unilab/base/entity.py | 30 ++++- src/unilab/envs/manager_based_rl_env.py | 2 +- tests/base/test_entity_tensor_read_plan.py | 122 ++++++++++++++++++++- tests/envs/test_fixed_shape_autoreset.py | 103 ++++++++++++++++- 4 files changed, 249 insertions(+), 8 deletions(-) diff --git a/src/unilab/base/entity.py b/src/unilab/base/entity.py index f876546b8..84d25a01b 100644 --- a/src/unilab/base/entity.py +++ b/src/unilab/base/entity.py @@ -532,6 +532,8 @@ def __init__( ] = {} self._packet: Mapping[str, torch.Tensor] = MappingProxyType({}) self._body_packet_buffers: dict[str, torch.Tensor] = {} + self._body_packet_sources: dict[str, torch.Tensor] = {} + self._transient_body_packet_sources: set[str] = set() self._body_pair_contact_names = MappingProxyType(dict(body_pair_contact_names)) self._body_pair_contact_batches: dict[str, BodyPairContactBatch] = dict( body_pair_contact_batches or {} @@ -558,15 +560,25 @@ def bind_graph_capture(self, capture: ExternalGraphCapture | None) -> None: self._capture_address_check_pending = False self._packet = _ObservedPacket(self._packet, self._record_capture_packet_read) - def validate_capture_sensor_addresses(self) -> None: - """Fail during construction if a device-resident sensor changes storage on refresh.""" + def validate_capture_read_addresses(self) -> None: + """Validate sensor storage and identify transient body projections before capture.""" self._require_not_closed() - if self._host_plan_value is not None or not self._packet_sensor_owners: + if self._host_plan_value is not None or not ( + self._packet_sensor_owners or self._packet_body_axes + ): return try: self.refresh() addresses = {name: self._packet[name].data_ptr() for name in self._packet_sensor_owners} + body_addresses = { + name: value.data_ptr() for name, value in self._body_packet_sources.items() + } self.refresh() + self._transient_body_packet_sources = { + name + for name, captured in body_addresses.items() + if self._body_packet_sources[name].data_ptr() != captured + } for name, captured in addresses.items(): current = self._packet[name].data_ptr() if current != captured: @@ -686,6 +698,9 @@ def _compile_site_layout( def _current_packet_value(self, name: str) -> torch.Tensor | None: return self._packet.get(name) + def _current_body_packet_source(self, name: str) -> torch.Tensor | None: + return self._body_packet_sources.get(name) + def _current_site_value(self, owner: "Entity", field: str) -> torch.Tensor: return getattr(owner.data._site_carrier_view(), field) @@ -1466,6 +1481,7 @@ def close(self) -> None: finally: self._aggregate_body_views.clear() self._body_packet_buffers.clear() + self._body_packet_sources.clear() self._body_pair_contact_batches.clear() self._contact_reads_ready = False self._packet_body_index_cache.clear() @@ -1543,6 +1559,14 @@ def _read_packet( raw[name] = backend.get_sensor_view(name, device=self._device) continue block = getattr(body_view, _PACKET_FIELD_BODY_FIELDS[name]) + self._body_packet_sources[name] = block + # Transient projections are regenerated by the captured backend ops. + if name not in self._transient_body_packet_sources: + self._record_capture_read( + f"body-source:{name}", + block, + partial(self._current_body_packet_source, name), + ) if tuple(self._packet_body_axes[name]) != tuple( self._packet_body_axes[body_packet_names[0]] ): diff --git a/src/unilab/envs/manager_based_rl_env.py b/src/unilab/envs/manager_based_rl_env.py index 8a88763a8..80fc4cdbf 100644 --- a/src/unilab/envs/manager_based_rl_env.py +++ b/src/unilab/envs/manager_based_rl_env.py @@ -569,7 +569,7 @@ def _compile_tensor_read_plan(self) -> None: else None ) if self._autoreset_cuda_graph and self.scene.read_plan is not None: - self.scene.read_plan.validate_capture_sensor_addresses() + self.scene.read_plan.validate_capture_read_addresses() def _bind_graph_capture(self, capture: ExternalGraphCapture | None) -> None: super()._bind_graph_capture(capture) diff --git a/tests/base/test_entity_tensor_read_plan.py b/tests/base/test_entity_tensor_read_plan.py index 245aa0a42..ac1b6d236 100644 --- a/tests/base/test_entity_tensor_read_plan.py +++ b/tests/base/test_entity_tensor_read_plan.py @@ -69,6 +69,7 @@ def __init__(self, *, device_resident: bool = False) -> None: "body_lin_vel_w": self.sensors["track_linvel_w_hip"].reshape(2, 3).contiguous(), "body_ang_vel_w": self.sensors["track_angvel_w_hip"].reshape(2, 3).contiguous(), } + self.tracked_body_sources: dict[str, torch.Tensor] | None = None self._selected_rows = torch.empty((0,), dtype=torch.int64) def get_tensor_capabilities(self) -> TensorLifecycleCapabilities: @@ -123,9 +124,17 @@ def get_tracked_body_views(self, body_names=None, device=None) -> TrackedBodySta self.aggregate_body_view_calls += 1 names = ("hip",) if body_names is None else tuple(body_names) names = tuple(name.rsplit("/", 1)[-1] for name in names) + target = torch.device(device) if device is not None else torch.device("cpu") + if self.tracked_body_sources is not None: + return TrackedBodyStateViews( + body_names=names, + pos_w=self.tracked_body_sources["pos_w"].to(target), + quat_w=self.tracked_body_sources["quat_w"].to(target), + lin_vel_w=self.tracked_body_sources["lin_vel_w"].to(target), + ang_vel_w=self.tracked_body_sources["ang_vel_w"].to(target), + ) if names != ("hip",): raise ValueError(f"unknown tracked bodies: {names}") - target = torch.device(device) if device is not None else torch.device("cpu") return TrackedBodyStateViews( body_names=names, pos_w=self.sensors["track_pos_w_hip"].unsqueeze(1).to(target), @@ -586,7 +595,7 @@ def unstable_sensor_view(name: str, device="cpu") -> torch.Tensor: backend.get_sensor_view = unstable_sensor_view # type: ignore[method-assign] with pytest.raises(GraphCaptureError, match=r"sensor 'imu_gyro'.*stable tensor storage"): - plan.validate_capture_sensor_addresses() + plan.validate_capture_read_addresses() assert not plan.ready @@ -616,6 +625,115 @@ def test_capture_guard_covers_body_sensor_and_direct_packet_reads() -> None: plan.bind_graph_capture(None) +@pytest.mark.parametrize( + ("source_field", "packet_name"), + ( + ("pos_w", "body_pos_w"), + ("quat_w", "body_quat_w"), + ("lin_vel_w", "body_lin_vel_w"), + ("ang_vel_w", "body_ang_vel_w"), + ), +) +def test_capture_guard_covers_rebound_body_sources_and_narrow_projections( + source_field: str, packet_name: str +) -> None: + backend = _SceneTensorBackend(device_resident=True) + quat = torch.zeros((2, 2, 4), dtype=torch.float32) + quat[..., 0] = 1.0 + backend.tracked_body_sources = { + "pos_w": torch.zeros((2, 2, 3), dtype=torch.float32), + "quat_w": quat, + "lin_vel_w": torch.zeros((2, 2, 3), dtype=torch.float32), + "ang_vel_w": torch.zeros((2, 2, 3), dtype=torch.float32), + } + scene = EntityScene( + { + "robot": EntityCfg( + joint_names=("hip",), body_names=("hip",), actuator_names=("hip_motor",) + ), + "floor": EntityCfg(body_names=("floor",)), + }, + cast(SimBackend, backend), + ) + plan = scene.compile_tensor_reads( + "cpu", + ( + SceneTensorReadSpec(entity="robot", body_names=("hip",)), + SceneTensorReadSpec( + entity="floor", body_names=("floor",), body_fields=("pos_w", "quat_w") + ), + ), + ) + plan.validate_capture_read_addresses() + capture = ExternalGraphCapture(torch_stream=None) + plan.bind_graph_capture(capture) + try: + plan.refresh() + carrier = plan._packet[packet_name] + if packet_name in ("body_pos_w", "body_quat_w"): + assert plan._packet_body_axes[packet_name] == ("robot/hip", "floor/floor") + assert { + "body-source:body_pos_w", + "body-source:body_quat_w", + "body-source:body_lin_vel_w", + "body-source:body_ang_vel_w", + } <= set(plan._capture_read_addresses) + + plan.refresh() + capture.check_replay_guards() + assert plan._packet[packet_name].data_ptr() == carrier.data_ptr() + plan.bind_graph_capture(None) + + assert backend.tracked_body_sources is not None + backend.tracked_body_sources[source_field] = backend.tracked_body_sources[ + source_field + ].clone() + plan.refresh() + assert plan._packet[packet_name].data_ptr() == carrier.data_ptr() + with pytest.raises( + GraphCaptureError, match=rf"body-source:{packet_name}.*changed tensor storage" + ): + capture.check_replay_guards() + finally: + plan.bind_graph_capture(None) + + +def test_capture_probe_excludes_transient_body_projections() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + get_tracked_body_views = backend.get_tracked_body_views + + def transient_body_views(body_names=None, device=None) -> TrackedBodyStateViews: + views = get_tracked_body_views(body_names, device) + return TrackedBodyStateViews( + body_names=views.body_names, + pos_w=views.pos_w.clone(), + quat_w=views.quat_w.clone(), + lin_vel_w=views.lin_vel_w.clone(), + ang_vel_w=views.ang_vel_w.clone(), + ) + + backend.get_tracked_body_views = transient_body_views # type: ignore[method-assign] + plan.validate_capture_read_addresses() + assert plan._transient_body_packet_sources == { + "body_pos_w", + "body_quat_w", + "body_lin_vel_w", + "body_ang_vel_w", + } + + capture = ExternalGraphCapture(torch_stream=None) + plan.bind_graph_capture(capture) + try: + plan.refresh() + plan.body_tensor_view("robot") + plan.refresh() + capture.check_replay_guards() + assert not any(name.startswith("body-source:") for name in plan._capture_read_addresses) + finally: + plan.bind_graph_capture(None) + + def test_capture_guard_rechecks_sensor_addresses_after_every_refresh() -> None: backend = _SceneTensorBackend(device_resident=True) plan = _scene(backend).compile_tensor_reads("cpu", _specs()) diff --git a/tests/envs/test_fixed_shape_autoreset.py b/tests/envs/test_fixed_shape_autoreset.py index 350e363a6..17f076e4c 100644 --- a/tests/envs/test_fixed_shape_autoreset.py +++ b/tests/envs/test_fixed_shape_autoreset.py @@ -25,6 +25,7 @@ TensorExecution, TensorLifecycleCapabilities, TensorProcessTopology, + TrackedBodyStateViews, ) from unisim.backend.graph_capture import ExternalGraphCapture, GraphCaptureError, closing_capture from unisim.ray_query import RaySiteFrameDescription @@ -32,7 +33,7 @@ from tests.envs.test_manager_based_rl_env import _ResetBackend from unilab.base.autoreset_graph import AutoresetGraph from unilab.base.backend_timing import RESET_DONE_DETAIL_TIMING_KEYS -from unilab.base.entity import EntityCfg +from unilab.base.entity import EntityCfg, EntityScene, SceneTensorReadSpec from unilab.base.registry import apply_cfg_overrides from unilab.base.reset_selection import ( ResetSelection, @@ -144,10 +145,49 @@ def torch_graph_capture_scope( class _ReadPlanTensorBackend(_TensorBackend): - def __init__(self, num_envs: int, device: str, *, unstable_sensor: bool = False) -> None: + def __init__( + self, + num_envs: int, + device: str, + *, + unstable_sensor: bool = False, + tracked_body_names: tuple[str, ...] = ("base",), + ) -> None: super().__init__(num_envs, device) self.imu = torch.zeros((num_envs, 3), dtype=torch.float32, device=self.device) self.unstable_sensor = unstable_sensor + self.tracked_body_names = tracked_body_names + self.body_sources = { + field: torch.zeros( + (num_envs, len(tracked_body_names), width), + dtype=torch.float32, + device=self.device, + ) + for field, width in ( + ("pos_w", 3), + ("quat_w", 4), + ("lin_vel_w", 3), + ("ang_vel_w", 3), + ) + } + self.body_sources["quat_w"][..., 0] = 1.0 + + def get_body_ids(self, names) -> np.ndarray: + available = ("base", "platform") + return np.asarray([available.index(name) for name in names], dtype=np.int32) + + def get_tracked_body_views(self, body_names, device=None) -> TrackedBodyStateViews: + del device + names = tuple(body_names) + if names != self.tracked_body_names: + raise KeyError(names) + return TrackedBodyStateViews( + body_names=names, + pos_w=self.body_sources["pos_w"], + quat_w=self.body_sources["quat_w"], + lin_vel_w=self.body_sources["lin_vel_w"], + ang_vel_w=self.body_sources["ang_vel_w"], + ) def get_sensor_names(self) -> tuple[str, ...]: return ("imu",) @@ -869,6 +909,65 @@ def test_rebound_sensor_fails_before_captured_autoreset_replay() -> None: env.close() +@cuda_only +@pytest.mark.parametrize( + ("source_field", "packet_name", "narrow_axis"), + ( + ("pos_w", "body_pos_w", False), + ("quat_w", "body_quat_w", False), + ("lin_vel_w", "body_lin_vel_w", False), + ("ang_vel_w", "body_ang_vel_w", False), + ("pos_w", "body_pos_w", True), + ), +) +def test_rebound_tracked_body_source_fails_before_captured_replay( + source_field: str, packet_name: str, narrow_axis: bool +) -> None: + tracked_body_names = ("base", "platform") if narrow_axis else ("base",) + backend = _ReadPlanTensorBackend(NUM_ENVS, "cuda", tracked_body_names=tracked_body_names) + entities = { + "robot": EntityCfg(joint_names=("joint",), body_names=("base",), actuator_names=("motor",)) + } + specs = [SceneTensorReadSpec(entity="robot", body_names=("base",))] + if narrow_axis: + entities["floor"] = EntityCfg(body_names=("platform",)) + specs.append( + SceneTensorReadSpec( + entity="floor", body_names=("platform",), body_fields=("pos_w", "quat_w") + ) + ) + plan = EntityScene(entities, cast(SimBackend, backend)).compile_tensor_reads("cuda", specs) + plan.validate_capture_read_addresses() + graph = AutoresetGraph( + backend=backend, + device=torch.device("cuda"), + body=plan.refresh, + bind_capture=plan.bind_graph_capture, + warmup=1, + ) + try: + graph.run() + graph.run() + assert graph.captured + assert graph.replays == 1 + carrier = plan._packet[packet_name] + if narrow_axis: + assert plan._packet_body_axes["body_pos_w"] == ("robot/base", "floor/platform") + assert plan._packet_body_axes["body_lin_vel_w"] == ("robot/base",) + + replays = graph.replays + backend.body_sources[source_field] = backend.body_sources[source_field].clone() + plan.refresh() + assert plan._packet[packet_name].data_ptr() == carrier.data_ptr() + with pytest.raises( + GraphCaptureError, match=rf"body-source:{packet_name}.*changed tensor storage" + ): + graph.run() + assert graph.replays == replays + finally: + plan.close() + + @cuda_only def test_unstable_sensor_fails_during_graph_enabled_env_construction() -> None: with pytest.raises(GraphCaptureError, match=r"sensor 'imu'.*stable tensor storage"): From 53052916bbc395413336b0ed765408a2e7b15b3e Mon Sep 17 00:00:00 2001 From: TATP-233 Date: Thu, 3 Dec 2026 20:22:42 +0800 Subject: [PATCH 9/9] fix(env): reject unstable captured body sources --- src/unilab/base/entity.py | 29 ++++++------ tests/base/test_entity_tensor_read_plan.py | 54 +++++++++++++--------- 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/src/unilab/base/entity.py b/src/unilab/base/entity.py index 84d25a01b..e22f58e9e 100644 --- a/src/unilab/base/entity.py +++ b/src/unilab/base/entity.py @@ -533,7 +533,6 @@ def __init__( self._packet: Mapping[str, torch.Tensor] = MappingProxyType({}) self._body_packet_buffers: dict[str, torch.Tensor] = {} self._body_packet_sources: dict[str, torch.Tensor] = {} - self._transient_body_packet_sources: set[str] = set() self._body_pair_contact_names = MappingProxyType(dict(body_pair_contact_names)) self._body_pair_contact_batches: dict[str, BodyPairContactBatch] = dict( body_pair_contact_batches or {} @@ -561,7 +560,7 @@ def bind_graph_capture(self, capture: ExternalGraphCapture | None) -> None: self._packet = _ObservedPacket(self._packet, self._record_capture_packet_read) def validate_capture_read_addresses(self) -> None: - """Validate sensor storage and identify transient body projections before capture.""" + """Require stable device-resident sensor and body source storage before capture.""" self._require_not_closed() if self._host_plan_value is not None or not ( self._packet_sensor_owners or self._packet_body_axes @@ -574,11 +573,15 @@ def validate_capture_read_addresses(self) -> None: name: value.data_ptr() for name, value in self._body_packet_sources.items() } self.refresh() - self._transient_body_packet_sources = { - name - for name, captured in body_addresses.items() - if self._body_packet_sources[name].data_ptr() != captured - } + for name, captured in body_addresses.items(): + current = self._body_packet_sources[name].data_ptr() + if current != captured: + raise GraphCaptureError( + f"backend '{self._scene._backend.backend_type}' body source '{name}' " + "does not have stable tensor storage across read-plan refreshes " + f"(0x{captured:x} != 0x{current:x}); the read plan cannot prove " + "its captured inputs are stable" + ) for name, captured in addresses.items(): current = self._packet[name].data_ptr() if current != captured: @@ -1560,13 +1563,11 @@ def _read_packet( continue block = getattr(body_view, _PACKET_FIELD_BODY_FIELDS[name]) self._body_packet_sources[name] = block - # Transient projections are regenerated by the captured backend ops. - if name not in self._transient_body_packet_sources: - self._record_capture_read( - f"body-source:{name}", - block, - partial(self._current_body_packet_source, name), - ) + self._record_capture_read( + f"body-source:{name}", + block, + partial(self._current_body_packet_source, name), + ) if tuple(self._packet_body_axes[name]) != tuple( self._packet_body_axes[body_packet_names[0]] ): diff --git a/tests/base/test_entity_tensor_read_plan.py b/tests/base/test_entity_tensor_read_plan.py index ac1b6d236..b85dcd1f9 100644 --- a/tests/base/test_entity_tensor_read_plan.py +++ b/tests/base/test_entity_tensor_read_plan.py @@ -698,7 +698,7 @@ def test_capture_guard_covers_rebound_body_sources_and_narrow_projections( plan.bind_graph_capture(None) -def test_capture_probe_excludes_transient_body_projections() -> None: +def test_capture_probe_rejects_transient_body_projections() -> None: backend = _SceneTensorBackend(device_resident=True) plan = _scene(backend).compile_tensor_reads("cpu", _specs()) get_tracked_body_views = backend.get_tracked_body_views @@ -707,31 +707,41 @@ def transient_body_views(body_names=None, device=None) -> TrackedBodyStateViews: views = get_tracked_body_views(body_names, device) return TrackedBodyStateViews( body_names=views.body_names, - pos_w=views.pos_w.clone(), - quat_w=views.quat_w.clone(), - lin_vel_w=views.lin_vel_w.clone(), - ang_vel_w=views.ang_vel_w.clone(), + pos_w=torch.cat((views.pos_w,), dim=1), + quat_w=views.quat_w, + lin_vel_w=views.lin_vel_w, + ang_vel_w=views.ang_vel_w, ) backend.get_tracked_body_views = transient_body_views # type: ignore[method-assign] - plan.validate_capture_read_addresses() - assert plan._transient_body_packet_sources == { - "body_pos_w", - "body_quat_w", - "body_lin_vel_w", - "body_ang_vel_w", - } + with pytest.raises(GraphCaptureError, match=r"body source 'body_pos_w'.*stable tensor storage"): + plan.validate_capture_read_addresses() + assert not plan.ready - capture = ExternalGraphCapture(torch_stream=None) - plan.bind_graph_capture(capture) - try: - plan.refresh() - plan.body_tensor_view("robot") - plan.refresh() - capture.check_replay_guards() - assert not any(name.startswith("body-source:") for name in plan._capture_read_addresses) - finally: - plan.bind_graph_capture(None) + +def test_capture_probe_rejects_cloned_body_output_with_stable_source() -> None: + backend = _SceneTensorBackend(device_resident=True) + plan = _scene(backend).compile_tensor_reads("cpu", _specs()) + get_tracked_body_views = backend.get_tracked_body_views + stable_source = backend.sensors["track_pos_w_hip"] + + def cloned_body_views(body_names=None, device=None) -> TrackedBodyStateViews: + views = get_tracked_body_views(body_names, device) + return TrackedBodyStateViews( + body_names=views.body_names, + pos_w=views.pos_w.clone(), + quat_w=views.quat_w, + lin_vel_w=views.lin_vel_w, + ang_vel_w=views.ang_vel_w, + ) + + backend.get_tracked_body_views = cloned_body_views # type: ignore[method-assign] + with pytest.raises( + GraphCaptureError, match=r"body source 'body_pos_w'.*captured inputs are stable" + ): + plan.validate_capture_read_addresses() + assert backend.sensors["track_pos_w_hip"] is stable_source + assert not plan.ready def test_capture_guard_rechecks_sensor_addresses_after_every_refresh() -> None: