Skip to content

fix(entity): slice device-resident packet body fields by their own axes - #2612

Merged
TATP-233 merged 2 commits into
Motphys:mainfrom
hhhappyshow:fix/device-resident-packet-per-field-axes
Nov 18, 2026
Merged

TATP-233 merged 2 commits into
Motphys:mainfrom
hhhappyshow:fix/device-resident-packet-per-field-axes

Conversation

@hhhappyshow

Copy link
Copy Markdown
Contributor

Summary

The device-resident branch of SceneTensorReadPlan._read_packet fetched one tracked-body view for the first packet field's aggregate axis and published every body packet field from that same view. When fields declare different body axes — e.g. a pose-only floor entity appears in body_pos_w/body_quat_w but not in body_lin_vel_w/body_ang_vel_w — the published width no longer matched the compiled per-field axes and every refresh failed with a shape mismatch:

ValueError: Scene tensor body field 'body_lin_vel_w' on backend 'mjwarp' has shape (256, 102); expected (256, 90)

Host-bridge plans compile per-field widths and were unaffected, so this only surfaces on device-resident backends (mjwarp today, newton/genesis paths too).

Fix

Select each body field's columns from the shared tracked-body view by public body name through the existing _packet_body_indices cache. Fields whose axes match the first field's axis keep the previous fast path (no extra indexing on the hot loop).

Verification

  • Found while bringing the G1 navigation raycast task (Perceptive-UniLab) up on the mjwarp backend; with this fix the task trains end to end on mjwarp (256 envs, RTX 4070).
  • Host-bridge mujoco run unchanged: same 2.12 s collection baseline before/after.
  • Based on Motphys/UniLab 794c0bbd (current main lock of the consumer project).

Made with Cursor

The device-resident branch of SceneTensorReadPlan._read_packet fetched
one tracked-body view for the first packet field's aggregate axis and
published every body field from that same view. When fields declare
different body axes (e.g. a pose-only floor entity is absent from the
velocity fields), the published width no longer matched the compiled
per-field axes and refresh failed with a shape mismatch. Host-bridge
plans compile per-field widths and were unaffected.

Select each body field's columns from the shared view by public body
name through the existing _packet_body_indices cache; fields whose
axes match the first field keep the previous fast path. Found while
bringing the G1 navigation raycast task up on the mjwarp backend;
host-bridge (mujoco) behavior is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@TATP-233
TATP-233 merged commit 4899571 into Motphys:main Nov 18, 2026
11 of 12 checks passed
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.

2 participants