fix: expose mjwarp tracked body kinematics for the MBA body-state contract - #1283
Merged
TATP-233 merged 1 commit intoAug 24, 2026
Merged
Conversation
Collaborator
Author
|
已同步 main 的 CUDA graph 优化(cherry-pick 1939cfd, #1273),与本 PR 的 tracked body kinematics 兼容(sensor cache 仍在 graph replay 后的显式 barrier 下载)。 验证(head 5052096):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1282
Summary
uv run train --algo sac --task g1_walk_flat --sim mjwarp自 #1232 G1 迁入 Manager-Based runtime 起在建 env 阶段失败:Entity初始化 eager 校验 body-state 能力,而 mjwarp host_numpy profile 对全部get_body_*抛NotImplementedError,且create_backend的 mjwarp 分支静默丢弃body_state_required。本 PR 按 issue 规划补齐 mjwarp 的只读 body kinematics,不放宽任何契约:
create_backend:mjwarp 分支将body_state_required=True映射为add_body_sensors=True(对齐 mujoco/motrix)。inject_mujoco_tracking_sensors注入 world-frame tracking frame sensors;临时 XML 在模型编译后立即释放(对齐 MuJoCo backend 生命周期)。MjwarpBackend:get_body_{pos,quat,lin_vel,ang_vel}_w从每步本已下载的_sensor_cache零拷贝读取(热路径零新增 device→host 同步);get_body_{lin,ang}_vel_b按 fix: pin get_body_*_vel_b to analytical body-frame semantics across backends #1254 语义用np_quat_apply_inverse_batched解析计算;绑定顺序/维度/连续性 fail-closed 校验;get_body_{pos,quat}_b保持明确NotImplementedError。不改 obs 维度、不改 owner YAML DENYLIST 字段、不改
SimBackend接口(getter 早已声明)。Tests
test_g1_walk_flat_owner_one_step[ppo/sac](在 dev HEAD 上实际为红)。create_backend接线测试:mjwarp 现在映射body_state_required。Validation
uv run pytest tests/base/test_mjwarp_backend.py tests/base/test_mjwarp_capabilities.py -m slow:7 passed。uv run pytest tests/base/test_motrix_backend_options.py:35 passed。make test-all:通过(exit 0)。uv run train --algo sac --task g1_walk_flat --sim mjwarp:完整跑完 5000 iterations(10.26M env steps),checkpoint 保存与 play 视频渲染均成功。