Skip to content

Read position components without constructing full poses - #1289

Open
cyanseek wants to merge 2 commits into
mujocolab:mainfrom
cyanseek:codex/position-component-reads
Open

cyanseek wants to merge 2 commits into
mujocolab:mainfrom
cyanseek:codex/position-component-reads

Conversation

@cyanseek

Copy link
Copy Markdown

Position-only EntityData reads currently evaluate full-pose properties before slicing out the position. Read the MuJoCo position fields directly, avoiding the unused quaternion work and pose concatenation. Root getters retain clone() because integer indexing aliases simulation storage; batched tensor indexing already produces independent storage. The test checks values against an independent MuJoCo model, caller writes, and snapshots across partial root-pose updates. The Upcoming changelog is updated.

This follows the discussion in #1275. On RTX 5090 with 1024 Lift environments, complete env.step time decreased from 4.530 to 4.020 ms (11.3%). A separate RTX 2080 Ti comparison measured 10.117 ms with the original getters, 8.994 ms changing only site_pos_w, 9.778 ms changing the other five, and 8.886 ms with all six. Both use seed 42, zero actions, 50 warmup steps and five 500-step samples; reproduction details and the allocation/aliasing explanation are in #1275. Thanks to @stergiosba for prompting the additional allocation and attribution checks.

make test-all, including ty and pyright, passed on Python 3.13: CPU 1113 passed / 13 skipped, CUDA 1126 passed. The original main accessors also pass the new compatibility test. The test was additionally rerun on H200, and the six getters passed bitwise same-state and storage-independence checks on RTX 2080 Ti.

Read position fields directly and preserve independent storage for root positions. Check world-frame values against MuJoCo and retain snapshot behavior across writes and partial resets.

This branch has not been deployed

No deployments
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