Skip to content

perf: MuJoCo backend 接入单次 dispatch per-substep control (#1259 M1b) #1267

Description

@TATP-233

Parent: #1259 (Wave 2, M1b). 硬依赖: #1266(M1a upstream 能力发布为 mujoco-uni-runtime 0.4.0)。

一句话目标

MuJoCoBackend._step_with_pre_step_control 从「每 substep 一次 pool.step(nstep=1)」改为单次 pool.step(nstep=N, control_callback=...),消除 #1257 归因的多 dispatch 固定成本,保持 MBA per-substep control 数值语义不变。

Scope

  • src/unilab/base/backend/mujoco/backend.py:重写 _step_with_pre_step_control;callback 内写 _physics_state/_sensor_data、调 _apply_pre_step_control、按需 concat pending xfrc;保留 timing dict 三个 key;不新增 SimBackend 方法、不保留多 dispatch fallback。
  • pyproject.toml / pyproject.rocm.toml pin 升到 mujoco-uni-runtime==0.4.0,同步 uv.lock / uv.rocm.lock
  • 更新 tests/base/test_backend_pre_step_control.py:断言单次 dispatch、callback 逐 substep 重算与 sensor 可见性不变。

Non-goals

  • 不改 Motrix/其他 backend;不改 manager/action term 语义;不改 collector/runner。
  • 不做 M2 chunk tuner、M3 sensor materialization。

Acceptance criteria

  • focused 测试更新后通过;最终提交本地 make test-all 通过。
  • 同机同配置 before/after 局部 timing(既有 scripts/benchmark/physics/benchmark_mujoco_backend_step_detail.py 口径)附在 PR;body 记录最终 commit、make test-all 结果、MuJoCo/Motrix 行为影响。
  • PR base = `dev/issue-1042-manager-based-api`,本地-only gate,不等远程 CI。

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions