Skip to content

perf(body-state): fuse selected body cache copies (#1307) - #1310

Merged
TATP-233 merged 1 commit into
dev/issue-1304-motion-numba-body-statefrom
perf/issue-1307-body-state-copy
Aug 25, 2026
Merged

perf(body-state): fuse selected body cache copies (#1307)#1310
TATP-233 merged 1 commit into
dev/issue-1304-motion-numba-body-statefrom
perf/issue-1307-body-state-copy

Conversation

@TATP-233

Copy link
Copy Markdown
Collaborator

Summary

  • 在冷路径通过 Entity.bind_body_state_copy() 固化 local → backend body IDs。
  • MotionCommand 的 full refresh 直接消费正式 SimBackend.copy_body_state_w() contract;partial-reset row getters 保持不变。
  • MuJoCo 与 MJWarp 共用永久的 fused Numba host-copy kernel。
  • Motrix 暂时使用 packed-cache kernel,并以 TODO(#1305, #1308) 明确约束删除时点;它不是长期 support contract。

Closes #1307
Part of #1304
Blocked follow-up: #1308 waits for #1305

Scope

  • 10 files
  • 298 additions / 49 deletions
  • 未改变 reward、body subset、reset、runner/lifecycle 或配置语义。

Validation

Performance

统一参数:8192 envs,warmup 10 / measure 100,各 3 次取中位数。相对 Child 1:

Backend update_state reset_done env/s
MuJoCo 25.778 → 19.732 ms(-23.5%) 7.077 → 7.001 ms 73,628 → 76,884(+4.4%)
Motrix 35.782 → 27.773 ms(-22.4%) 13.837 → 13.166 ms 66,543 → 72,965(+9.7%)
MJWarp 25.323 → 18.283 ms(-27.8%) 14.971 → 14.628 ms 130,895 → 154,075(+17.7%)

固定输入 probe:

  • 旧双 gather:7.210 ms
  • 四次 direct copy:0.732 ms
  • fused Numba:0.100 ms

相对 roadmap 初始基线,当前 update_state:

  • MuJoCo:29.766 → 19.732 ms(-33.7%)
  • Motrix:38.648 → 27.773 ms(-28.2%)
  • MJWarp:28.704 → 18.283 ms(-36.3%)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant