Skip to content

fix(env): align upright reward with quaternion inverse - #2589

Merged
TATP-233 merged 1 commit into
mainfrom
fix/issue-2585-upright-reward
Nov 6, 2026
Merged

TATP-233 merged 1 commit into
mainfrom
fix/issue-2585-upright-reward

Conversation

@TATP-233

@TATP-233 TATP-233 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaced the hand-rolled inverse-rotation formula in mdp.upright with the shared quat_apply_inverse primitive.
  • Kept the quaternion as the read-plan resident tensor and materialized the immutable gravity table directly on env.device.
  • Extended the reward regression fixture with a mixed-axis quaternion and non-axis-aligned gravity so the second cross-product term's sign is covered.

For the usual flat-ground gravity vector (0, 0, -1), the old formula's horizontal squared norm happens to match the standard result; the projected vector itself remains wrong. Non-axis-aligned gravity exposes the numerical difference. No in-tree task configuration currently enables mdp.upright, so there is no in-tree task requiring a retraining regression.

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_NO_SYNC=1 make test-all

Results:

  • Formatting and lint checks passed.
  • Mypy passed for 212 source files.
  • Pyright reported 0 errors (one pre-existing warning).
  • Non-slow coverage suite: 2963 passed, 35 skipped, 375 deselected, 1 xfailed.
  • Benchmark smoke: module-mode 35/35 and script-mode 36/36 passed.

Remote CI route:

  • Base main: current-head CI link/status: pending at PR creation.

Impact

  • Backend impact: none
  • Platform impact: both
  • Training effect expected: no change for in-tree configured tasks; corrects projected-gravity semantics for any external consumer supplying non-axis-aligned gravity

Artifacts

  • W&B: none
  • benchmark result: none
  • video / screenshot: none
  • ONNX / checkpoint: none

Checklist

  • Added or updated tests where needed
  • Updated docs if behavior or workflow changed
  • Linked the driving issue
  • Noted any follow-up work explicitly

Replace the hand-rolled inverse-rotation formula with the shared quat_apply_inverse primitive. Keep the quaternion as the read-plan tensor and materialize the immutable gravity table on env.device.

The regression fixture combines a mixed-axis rotation with non-axis-aligned gravity so both cross-product terms are exercised. No in-tree task configuration currently enables mdp.upright.
@TATP-233
TATP-233 merged commit b8d2f61 into main Nov 6, 2026
10 of 11 checks passed
@TATP-233
TATP-233 deleted the fix/issue-2585-upright-reward branch November 6, 2026 04:41
@TATP-233 TATP-233 mentioned this pull request Nov 6, 2026
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