Skip to content

fix(sim): encode fused root angular reset in root frame - #2513

Merged
TATP-233 merged 1 commit into
mainfrom
fix/issue-2512-fused-root-angular-velocity
Oct 23, 2026
Merged

TATP-233 merged 1 commit into
mainfrom
fix/issue-2512-fused-root-angular-velocity

Conversation

@TATP-233

Copy link
Copy Markdown
Collaborator

Summary

  • Encode the angular channels of community 13-D world-frame root state before fused tensor reset submission.
  • write_root_state_tensor() and write_motion_state_tensor() now share a device-resident encoder: linear velocity stays world-frame, while angular velocity is rotated with quat_apply_inverse(root_quat, w_world) into generalized free-root/body-frame qvel.
  • Keep the existing fused submission structure and backend commit boundary. The encoder uses one reusable full-width scratch tensor, so it does not return to the host reset path or add stable allocations per reset.
  • This corrects immediate reset state and downstream MotionCommand motion resets for rotated roots and nonzero world angular velocity.

Linked Work

Validation

  • make test-all passed on the final local head before this PR was created or updated
  • Additional task-specific validation listed below

Commands actually run:

uv run pytest tests/base/test_reset_state.py -q
# 39 passed

uv run pytest tests/base/test_backend_conformance.py -q -k 'root_qvel_body_angular or fused_tensor_root_reset'
# 2 passed, 2 skipped (Motrix unavailable locally; MuJoCo authoritative readback passed)

uv run pytest tests/tasks/test_motion_term_parity.py::test_motion_reset_values_kernel_matches_eager_and_reuses_scratch -q
# 1 passed

uv run ruff format --check src/unilab/base/reset_state.py tests/base/test_reset_state.py tests/base/test_backend_conformance.py
uv run ruff check src/unilab/base/reset_state.py tests/base/test_reset_state.py tests/base/test_backend_conformance.py
# passed

uv run mypy src/unilab
uv run pyright
# 0 errors

make test-all
# formatting/types/test checks passed
# 2781 passed, 61 skipped, 373 deselected, 24 warnings
# benchmark smoke: module mode 34/34, script mode 35/35

Remote CI route:

  • Base main: current-head CI is requested with this PR; status will be checked after GitHub schedules it.

Impact

  • Backend impact: mujoco / motrix / both
  • Platform impact: both
  • Training effect expected: yes — motion and tensor root resets with rotated roots and nonzero world angular velocity now initialize the intended physical angular velocity.

Artifacts

  • W&B: N/A
  • benchmark result: N/A (no benchmark regressions introduced; make test-all benchmark smoke passed)
  • video / screenshot: N/A
  • ONNX / checkpoint: N/A

Checklist

  • Added or updated tests where needed
  • Updated docs if behavior or workflow changed (no public API semantic change; this restores the documented world-frame input contract)
  • Linked the driving issue
  • Noted any follow-up work explicitly

Follow-up: run the Motrix parameterized conformance regression in an environment with motrixsim; it was skipped locally because that optional runtime is not installed.

@TATP-233
TATP-233 merged commit d825dab into main Oct 23, 2026
12 checks passed
@TATP-233
TATP-233 deleted the fix/issue-2512-fused-root-angular-velocity branch October 23, 2026 11:11
@TATP-233 TATP-233 mentioned this pull request Oct 23, 2026
6 tasks done
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