Skip to content

Feat: 迁移 mjlab managers 并转换为 NumPy #1045

Description

@TATP-233

一句话问题

ADR-0006 已固定公共语义,但 UniLab 还没有可独立测试的 NumPy manager package。

最小交付结果

将 mjlab v1.6.0 commit 0fb8a681 的 12-file src/mjlab/managers/ package 直接迁移为 src/unilab/managers/,在不接 production env 的情况下通过 upstream-derived NumPy tests。

In scope

  • 保留上游模块职责、exports、term cfg、dict order、function/class term、reset 与 manager lifecycle。
  • 做 import rename、Torch→NumPy、buffer/RNG/finite/typing 机械适配。
  • 删除 device、Warp/model mutation、viewer-only glue;能力缺口直接报错。
  • 只增加最小 typed fake env/scene test context 和必要的通用 NumPy buffer/noise primitive。
  • 每个 source-derived 文件记录 upstream commit/path、Apache-2.0 与修改说明。
  • 测试覆盖所有 manager 模块、intentional differences、无 Torch/IPC/runner/scripts import。

Non-goals

  • 不修改 NpEnv.step()、真实 backend、production task、Hydra compose、scripts、runner 或 IPC。
  • 不实现真实 entity facade 或 lifecycle integration。
  • 不搬运 mjlab scene/simulation/viewer/runtime。

Owner 与预算

Manager core;source-aligned exception:≤40 个非删除文件、≤5,000 行 source-derived/mechanical、≤800 行 UniLab-specific glue,1 PR,base 为 dev/issue-1042-manager-based-api

Acceptance criteria

  • 12 个 manager source 文件与 exports 可追溯到 pinned upstream。
  • upstream-derived tests 覆盖 action/observation/reward/termination/event/command/curriculum/metrics/recorder/selector。
  • manager package 无 Torch、backend private、IPC、runner 或 scripts import。
  • shape/finite/capability errors fail closed;显式空配置的 Null semantics 保留。
  • focused tests 与 make test-all 通过。

Stop conditions

如果需要 production lifecycle、backend public method,或 UniLab-specific glue 超过预算,停止并拆到后续 owner child。

Umbrella: #1042
Depends on: #1043

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions