Skip to content

[Backport release/3.0.0] Fix Newton body-offset Jacobian and streamline core offset math (#8203) - #8318

Merged
kellyguo11 merged 2 commits into
isaac-sim:release/3.0.0from
kellyguo11:codex/backport-8203-release-3.0.0
Oct 6, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:release/3.0.0from
kellyguo11:codex/backport-8203-release-3.0.0

Conversation

@kellyguo11

Copy link
Copy Markdown
Contributor

Description

Backports #8203 onto release/3.0.0.

This fixes the Newton task-space body-offset Jacobian by shifting its translational rows with the world-frame lever arm before rotating the Jacobian into root axes. It also carries the equivalent core task-space optimization that replaces skew-matrix multiplication with batched cross products.

This is an exact, conflict-free cherry-pick of the merged source change. The Newton regression coverage and both package changelog fragments are included unchanged.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Release backport

Release backport

  • Not applicable: this PR targets release/3.0.0 directly.

Screenshots

Not applicable.

Validation

  • Exact-patch validation passed: the source and backport patch IDs both resolve to 1a90740c29ae269d3409b448dd321d67ba4d2a55.
  • Release-aware changelog validation passed against the current upstream release/3.0.0 tip.
  • All repository pre-commit hooks passed over the backport range.
  • git diff --check passed.
  • Test-audit review confirmed that the consolidated Newton controller test protects the Newton-specific body-offset frame convention and would catch the original world/root-frame mismatch without adding a production test seam.
  • Fix Newton body-offset Jacobian and streamline core offset math #8203 reported 8 Newton controller tests and 5 core DiffIK tests passing. The focused test was not repeated locally because the project lockfile supports Linux and Windows, not this macOS ARM64 host.

Checklist

  • I have read and understood the contribution guidelines.
  • I have run the applicable formatting and lint checks.
  • Documentation changes are not required beyond the included changelog entries.
  • My changes generate no new warnings.
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria.
  • I have included the required isaaclab and isaaclab_newton changelog fragments.
  • The original contributor is already listed in CONTRIBUTORS.md.

Original PR: #8203
Cherry-picked merge commit: e67c5cb4cfbc8f40de8bf60559048707ea229f58
Backport commit: e3fc1ed20

@kellyguo11
kellyguo11 requested a review from a team October 6, 2026 04:29
@kellyguo11 kellyguo11 added the isaac-lab Related to Isaac Lab team label Oct 6, 2026
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Refactors task-space Jacobian math for offset frames.

The PR appears safe to merge; the test assertion is a non-blocking maintainability issue.

Findings

  1. P2 Unrelated assertion makes test fragile ▶

Summary

This backport corrects the Newton body-offset Jacobian by applying the lever-arm shift in world coordinates before rotating into root axes. It also replaces skew-matrix products with batched cross products in the core task-space actions and adds regression coverage and changelog fragments.

Reviews (1) · Last reviewed commit: "Fix Newton body-offset Jacobian and stre..."

# The body-local x offset is root-local y; a root-z rotation gives linear velocity -x.
expected = torch.tensor([[-1.0, 0.0, 0.0, 0.0, 0.0, 1.0]]).repeat(_NUM_ENVS, 1)
torch.testing.assert_close(jacobian[:, :, 0], expected, atol=1e-6, rtol=0.0)
assert not hasattr(math_utils, "velocity_at_point")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unrelated assertion makes test fragile

This assertion checks that a math helper does not exist, rather than checking the Jacobian or controller result. If velocity_at_point is added later, this test will fail even though the behavior it tests remains correct. The Jacobian and controller results are already checked separately; remove this assertion.

Suggested change
assert not hasattr(math_utils, "velocity_at_point")

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Test quality (1). Other reviewed categories look good.

  • PR description: The “reduced overhead” claim lacks measurements; cite #8203 with baseline/candidate revisions, command, hardware, backend, environment count, warmup, and metric, or remove the performance wording.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: Style consistency looks good.
  • Test quality: The Jacobian regression covers the Newton-specific frame mismatch, but the unrelated velocity_at_point symbol-absence assertion is implementation inventory and must be removed.

Minor fixes needed. Posted 1 inline finding.

Automated review; human maintainers own approval decisions.

# The body-local x offset is root-local y; a root-z rotation gives linear velocity -x.
expected = torch.tensor([[-1.0, 0.0, 0.0, 0.0, 0.0, 1.0]]).repeat(_NUM_ENVS, 1)
torch.testing.assert_close(jacobian[:, :, 0], expected, atol=1e-6, rtol=0.0)
assert not hasattr(math_utils, "velocity_at_point")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Test Quality — Unrelated symbol-absence assertion in test

assert not hasattr(math_utils, "velocity_at_point") guards no Jacobian contract and fails if any unrelated helper gains that name. Delete it, correcting the source change on main so this backport stays an exact cherry-pick.

@kellyguo11

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 6, 2026
AntoineRichard pushed a commit that referenced this pull request Oct 6, 2026
# Description

Enable the root `ov` extra in the release base Docker image so its
locked environment includes `ovphysx`, `ovrtx`, and `ovstage`. This
aligns `release/3.0.0` with the base-image dependency set on `develop`
and fixes OVRTX-backed task configurations failing during standard
Docker package tests with `ModuleNotFoundError: No module named
'ovrtx'`.\n\nThis is a focused release-branch workflow fix for the CI
failure exposed by #8318. It does not change dependency pins or the
lockfile.\n\n## Type of change\n\n- Bug fix (non-breaking Docker
dependency fix)\n\n## Release backport\n\nNot applicable; this PR
targets `release/3.0.0` directly.\n\n## Screenshots\n\nNot
applicable.\n\n## Validation\n\n- `uv run --extra test python -m pytest
docker/test/test_dockerfile_nonroot.py` — 24 passed\n-
`SKIP=check-changelog-fragments uv run isaaclab -f` — all applicable
formatting and lint hooks passed\n- `git diff --check`\n\nThe full
formatting command’s changelog hook compares the release snapshot
against `develop` and reports the release branch’s already-compiled
fragments. No `source/<package>` files are changed, so no package
changelog fragment applies.\n\n## Checklist\n\n- [x] I have read and
understood the contribution guidelines\n- [x] I have run the applicable
formatting and lint checks\n- [x] Documentation changes are not required
for this Docker dependency fix\n- [x] My changes generate no new
warnings\n- [x] I have validated the closest Docker contract tests\n-
[x] No source package changed, so no package changelog fragment is
required\n- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
@AntoineRichard

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 6, 2026
…c-sim#8203)

# Description

A task-space action with `body_offset` needs a Jacobian at the offset
point. The core DiffIK and OSC actions received the corrected frame
convention in isaac-sim#7989, but the Newton model-free action retained its own
formula: it used a body-local lever arm against a root-frame Jacobian
and rotated the angular rows by the offset orientation. With a rotated
body or root, `J @ qdot` therefore disagreed with the offset-frame
twist.

This PR fixes the Newton action by rotating the offset into world axes,
applying `Jv_point = Jv_origin + Jw × r`, and then rotating the Jacobian
into root axes. The angular rows stay unchanged. Core DiffIK and OSC now
use the same direct `torch.linalg.cross` operation in root axes instead
of constructing a skew matrix and multiplying it by the angular
Jacobian. The two forms are mathematically equivalent; the direct cross
product avoids an extra matrix allocation and multiplication. No new
math wrapper is needed.

The Newton task-space actions use Newton's model-free controllers, which
require a caller-supplied tool-point pose and Jacobian. Newton's
separate model-based controllers and IK objectives support
tool-site/link offsets, but are not the controller API used here. The
Newton action continues to accept both Newton and PhysX asset data
through the public link-origin Jacobian contract.

On the official Franka validation from the original fix (rotated fixed
root and a hand offset), `J @ qdot` matched the simulator's offset-frame
twist: Newton linear error fell from about 0.27 m/s to 2e-6 m/s and
angular error from about 0.95 rad/s to 1e-7 rad/s. PhysX errors were
1e-4 to 4e-4, matching the core term's floor. Only configurations with
`body_offset` are affected; no shipped task currently uses these Newton
action terms.

Fixes isaac-sim#8202

## Type of change

- Bug fix and task-space offset performance improvement

## Release backport

- [x] Backport this pull request to the active release branch after it
merges into `develop`

## Validation

- `uv run --frozen --extra test python -m pytest
source/isaaclab/test/envs/test_diffik_jacobian_aliasing.py -q` — 5
passed.
- `uv run --frozen --extra test python -m pytest
source/isaaclab_newton/test/controllers/test_newton_controllers.py -q` —
8 passed; the existing DiffIK case now checks the offset Jacobian.
- `uv run --frozen isaaclab -f` — passed with the local changelog base
set to this PR's upstream base commit.
- 4,096-env, 7-joint Torch GPU microbenchmarks on RTX 5090 (median of 8
paired rounds of 100 calls): Newton world-frame point shift, direct
cross 149.6 us/call versus skew matrix 213.5 us/call; core root-frame
point shift, direct cross 107.0 us/call versus skew matrix 181.0
us/call. These measure Jacobian computation, not a full simulation step.

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the pre-commit checks.
- [x] I have added changelog fragments for both touched packages.
- [x] The focused regression tests pass.
- [ ] I have made corresponding changes to the documentation.

---------

Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
(cherry picked from commit e67c5cb)
@AntoineRichard
AntoineRichard force-pushed the codex/backport-8203-release-3.0.0 branch from e3fc1ed to a62bc47 Compare October 6, 2026 08:53
@kellyguo11

Copy link
Copy Markdown
Contributor Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 6, 2026
@kellyguo11
kellyguo11 merged commit ed73bb9 into isaac-sim:release/3.0.0 Oct 6, 2026
57 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants