Skip to content

Preserve authored scale in Newton Fabric sync - #7481

Merged
kellyguo11 merged 1 commit into
isaac-sim:developfrom
kellyguo11:codex/preserve-newton-fabric-scale
Sep 3, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:developfrom
kellyguo11:codex/preserve-newton-fabric-scale

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Newton's Kit/RTX Fabric synchronization rebuilt every rigid-body world matrix from a Newton transformf, which contains translation and rotation but no scale. The first render sync therefore overwrote composed USD scale with unit scale, making scaled rigid assets appear oversized.

This change captures each body's initialized Fabric world scale by Newton body index and reapplies it when composing subsequent render matrices. It fixes the synchronization contract at the backend boundary, following the same root-fix approach used for OVRTX in #7010, and removes the need for the task-specific asset substitution proposed in #7476.

No new dependencies are required.

Related: #7010, #7476

Type of change

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

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable; the regression test checks the rendering-side Fabric world matrix directly.

Validation

  • Ruff format and lint passed for the changed Python files.
  • git diff --check passed.
  • The changelog gate passed against current upstream/develop.
  • A Warp 1.16 CPU smoke test compiled and exercised the scale-capture and transform-composition kernels.
  • The Isaac Sim/CUDA regression test was not run locally because this host is macOS/arm; it is marked for Isaac Sim CI.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the full pre-commit checks with uv run isaaclab -f (unsupported on this macOS/arm host)
  • No public API or documentation change is required
  • My changes generate no new warnings in the available local checks
  • I have added a regression test that proves the fix preserves non-uniform authored scale across pose synchronization
  • I have added a changelog fragment under source/isaaclab_newton/changelog.d/
  • My name already exists in CONTRIBUTORS.md

@kellyguo11
kellyguo11 requested a review from a team September 2, 2026 00:42
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 2, 2026
@kellyguo11
kellyguo11 requested a review from pbarejko September 2, 2026 00:42
@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 Sep 2, 2026
@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR preserves authored rigid-body scale while synchronizing Newton poses into Fabric world matrices.

  • Captures initialized Fabric world scale by Newton body index.
  • Reapplies cached scale when composing render matrices.
  • Adds an Isaac Sim regression test and changelog fragment.

Confidence Score: 4/5

This PR should not merge until scale capture safely handles a first Fabric selection that contains only a subset of Newton bodies.

The new cache is allocated without initialization and considered complete after the first non-empty CUDA selection, allowing bodies whose attributes propagate later to consume uncaptured scale entries.

Files Needing Attention: source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Adds scale capture and composition, but the one-time uninitialized cache can miss bodies when the first GPU-visible selection is partial.
source/isaaclab_newton/test/physics/test_newton_fabric_body_sync.py Adds a useful non-uniform-scale regression test, although its single-body scene does not cover partial multi-body attribute propagation.
source/isaaclab_newton/changelog.d/newton-fabric-preserve-usd-scale.rst Accurately documents the intended rendering-scale fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[USD-authored transform] --> B[Fabric world matrix]
  B --> C[Capture scale by Newton body index]
  D[Newton pose state] --> E[Compose pose with cached scale]
  C --> E
  E --> F[Fabric world matrix]
  F --> G[Kit and RTX rendering]
Loading

Reviews (1): Last reviewed commit: "Preserve Newton Fabric body scales" | Re-trigger Greptile

Comment on lines +749 to +754
if cls._fabric_body_scales is None:
NewtonManager._fabric_body_scales = wp.empty(
cls._model.body_count,
dtype=wp.vec3f,
device=PhysicsManager._device,
)

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.

P1 Partial capture leaves uninitialized scales

If GPU propagation exposes only a subset of the newly authored newton:index attributes during the first non-empty selection, this block treats the partially populated wp.empty array as a complete cache. Bodies exposed by later selections then read uninitialized scale entries in _set_fabric_transforms, causing incorrectly scaled or missing rendered geometry.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is only true if the first GPU selection can be partial, if the selection is None or all, then this is not a valid concern. I assume this is a false positive if the selection is synchronous @kellyguo11 ?

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.

You're right, conditional on the invariant that the first selection is always complete (None/all) and Fabric has synchronously materialized every newton:index. In that case, every body slot is written by _capture_fabric_scales before _set_fabric_transforms consumes it, so wp.empty is safe here. My finding assumed a supported first call with a subset selection; without evidence that such a path exists, this is a false positive. The relevant requirement is selection completeness, rather than synchrony alone.

@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

The change captures initialized Fabric world scale by Newton body index and recomposes it with each Newton pose, addressing the render-scale loss at the Fabric synchronization boundary. It includes a package changelog fragment and a focused Isaac Sim CI regression test for non-uniform scale preservation.

  • Design and architecture: The one-shot scale cache is placed at the producer boundary where Newton poses are converted to Fabric world matrices, and it is reset by both simulation startup and manager cleanup. This intentionally freezes scale at the first successful sync, so runtime USD scale edits after startup remain a non-blocking behavioral limitation.
  • API: No public API changes were identified. The new kernel, cache, and modified kernel signature are internal, and the changed call path remains contained within NewtonManager Fabric synchronization.
  • Implementation: The capture runs before the first pose overwrite, and the transpose/decomposition/composition path is consistent with the existing Fabric matrix convention. The proposed uninitialized-buffer concern is not established by the patch: the code retries when no indexed prims are available, but the supplied context does not demonstrate that a successful first selection can later expand to previously uncaptured body indices. The regression test checks both initial non-uniform scale and preservation after a pose write.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@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 Sep 2, 2026
idx = int(newton_indices[i])
matrix = wp.mat44f(fabric_transforms[i])
body_scales[idx] = wp.vec3f(
wp.length(wp.vec3f(matrix[0, 0], matrix[0, 1], matrix[0, 2])),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

question (non-blocking): wp.length will drop the sign if there were negative scales in the matrix, is this important for us?

@nvsekkin

nvsekkin commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

clean root cause fix, looks good to me!

@kellyguo11
kellyguo11 merged commit 0077d98 into isaac-sim:develop Sep 3, 2026
77 of 78 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as c620a79.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 3, 2026
# Description

Newton's Kit/RTX Fabric synchronization rebuilt every rigid-body world
matrix from a Newton `transformf`, which contains translation and
rotation but no scale. The first render sync therefore overwrote
composed USD scale with unit scale, making scaled rigid assets appear
oversized.

This change captures each body's initialized Fabric world scale by
Newton body index and reapplies it when composing subsequent render
matrices. It fixes the synchronization contract at the backend boundary,
following the same root-fix approach used for OVRTX in #7010, and
removes the need for the task-specific asset substitution proposed in
#7476.

No new dependencies are required.

Related: #7010, #7476

## Type of change

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

## Release backport

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

## Screenshots

Not applicable; the regression test checks the rendering-side Fabric
world matrix directly.

## Validation

- Ruff format and lint passed for the changed Python files.
- `git diff --check` passed.
- The changelog gate passed against current `upstream/develop`.
- A Warp 1.16 CPU smoke test compiled and exercised the scale-capture
and transform-composition kernels.
- The Isaac Sim/CUDA regression test was not run locally because this
host is macOS/arm; it is marked for Isaac Sim CI.

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the full pre-commit checks with `uv run isaaclab -f`
(unsupported on this macOS/arm host)
- [x] No public API or documentation change is required
- [x] My changes generate no new warnings in the available local checks
- [x] I have added a regression test that proves the fix preserves
non-uniform authored scale across pose synchronization
- [x] I have added a changelog fragment under
`source/isaaclab_newton/changelog.d/`
- [x] My name already exists in `CONTRIBUTORS.md`

(cherry picked from commit 0077d98)
@j3soon

j3soon commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the fix! We just hit this independently and narrowed down to the same issue. I confirmed this PR fixes our issue by pulling the latest develop branch! In our case, this initially seems to be a rendering/material issue when switching from PhysX to Newton (MJWarp). I'll leave our observations below for future reference in case others encounter similar issues when using the v3.0.0-beta2.patch1 release.

Information below was drafted and tested by Claude.


It showed up for us as a rendering bug with no physics symptom: millimetre-authored CAD
accessories on a Go2 (0.001 scale in xformOp:transform) were drawn 1000x too large, engulfing
the camera, so the whole scene went black. At first, it seems like the terrain material was broken, in fact it's due to the transform.

Steps to reproduce (by Claude)

Download repro_newton_fabric_scale.py into an empty directory, then run:

docker run --rm --gpus all -e ACCEPT_EULA=Y -e PRIVACY_CONSENT=Y -e OMNI_KIT_ACCEPT_EULA=YES \
  -v "$PWD:/work" -w /work --entrypoint /workspace/isaaclab/_isaac_sim/python.sh \
  nvcr.io/nvidia/isaac-lab:3.0.0-beta2-post1 /work/repro_newton_fabric_scale.py

It overlays a stock robot with one extra fixed-joint body under a scaled Xform, then compares the
prim's composed USD world scale against the omni:fabric:worldMatrix the render delegate reads.
Exits non-zero on mismatch:

  USD    world scale      = 0.001
  fabric worldMatrix scale= 1   <- used for rendering
  MEAN BRIGHTNESS         = 13.31
FAIL: fabric scale 1 != USD scale 0.001  -> mesh is rendered 1000x its true size

Add --backend physx for the passing control, or --scale 2 for a plain non-CAD scale (fails at
0.5x). --robot spot behaves the same.

Before and after, same image, the only difference being whether the scale is preserved:

before (broken brightness) after (fixed brightness)
pr_before pr_after

Verified against this PR

On an image built from develop @ 860facd10 with docker/Dockerfile.base, swapping only
newton_manager.py:

newton_manager.py result
as merged PASS, fabric scale 0.001
#7481 reverted FAIL, fabric scale 1

Notes

  • The brightness numbers above are from 3.0.0-beta2-post1. On our develop builds the Newton
    articulation is not drawn by a Camera sensor at all in this standalone (no InteractiveScene)
    setup — only the ground appears, and the log says Fabric GPU transform hierarchy unavailable; falling back to update_world_xforms(). Possibly something missing in our script rather than a
    defect, but mentioning it in case it is not. The transform check is unaffected either way.
  • Tested on RTX PRO 6000 Blackwell Max-Q Workstation Edition, driver 580.173.02, Ubuntu 24.04.

kellyguo11 pushed a commit that referenced this pull request Sep 4, 2026
# Description

Revives #6308 on current `develop` and supersedes #3728 with a single
backend-neutral contract for kinematic rigid-object rendering.

## Architecture

`source/isaaclab/test/renderers/rigid_object_rendering_contract.py` is
the composition root. It owns the cloned scene, kinematic pose sequence,
depth measurements, and assertions. Package-local adapters own only
availability checks, simulation/renderer selection, and backend cleanup:

- Isaac RTX + PhysX on CPU and CUDA, with and without a coexisting
articulation;
- Newton Warp + PhysX on CUDA;
- OVRTX + OVPhysX on CUDA through both legacy and OVStage scene
ownership (OVStage runs when installed).

The dependency direction is adapter -> shared test contract -> public
Isaac Lab APIs. An AST architecture gate rejects backend imports in the
shared contract and rejects scene, asset, sensor, or class ownership in
adapters.

The contract creates two cloned instanceable DexCubes with root-level
nonuniform scale, verifies their depth silhouettes, moves both kinematic
bodies through the public rigid-object tensor API, verifies the physics
poses, and requires opposite rendered centroid displacement.

## Current-develop audit

Most production changes in the old PR have since landed through newer
ownership boundaries: Isaac RTX render-product lifetime in #6729, Newton
shadow-state copying in #6773, OVRTX scale-aware transform writes in
#7010, and Newton Fabric scale preservation in #7481. This revival
removes those stale patches rather than carrying duplicate
implementations.

The revived contract exposed one remaining OVRTX bug: composed scale was
captured only for clone-plan source paths, while OVRTX creates
non-source destinations after exporting the host USD stage. Those
destinations therefore defaulted to unit scale. As a deliberately
temporary bridge, this PR projects only captured non-unit scales through
the existing `isaaclab.cloner.query.path_env_ids` and `path_to_clone`
boundary using the already-validated `ClonePlan`; real destination
scales take precedence. It adds no plan fields, query APIs, renderer
configuration, or per-body fallback, and the bridge can be deleted as
one unit when SDP supplies composed scale aligned with canonical
rigid-body paths.

Historical context: [Isaac Sim forum
report](https://forums.developer.nvidia.com/t/rigidbody-prim-is-not-updated-in-rendering-pipeline-if-set-to-kinematic/346608).

## Type of change

- Bug fix
- Shared regression coverage

## Testing

- Isaac RTX contract: 4 passed (CUDA/CPU x articulation absent/present).
- Newton Warp contract: 1 passed.
- OVRTX contract: 2 passed (legacy and OVStage).
- OVRTX renderer unit surface: 167 passed.
- Core architecture and Newton visualization suites: 25 passed.
- OVRTX clone-plan suite: 17 passed.
- Cloner query and rendering-contract architecture suites: 87 passed.
- Controlled OVRTX regression: failed before the production fix with
clone silhouettes of 264 vs. 36 pixels; passed after the fix.
- Incoming #7462 NumPy-backed `ClonePlan` query-boundary smoke check:
passed unchanged, including non-dense environment ids.
- `uv run isaaclab -f`: all hooks passed against the exact upstream
`develop` base, including changelog validation.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks
- [x] Documentation changes are not applicable
- [x] I have added unit and integration regression coverage
- [x] I have added changelog fragments for every touched package
- [x] My name is already present in `CONTRIBUTORS.md`
kellyguo11 added a commit that referenced this pull request Sep 5, 2026
#7587)

# Description

Backports #6308 to `release/3.0.0`.

The canonical merged commit `ab34e8c5e3ee7a2c5f260d1511714e5be3bed3eb`
was cherry-picked with `-x` provenance. Eleven of its twelve source
paths replay exactly.
`source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py` required a
localized release-compatible conflict resolution, so this PR is
intentionally a draft for release-maintainer review.

| Field | Commit |
|---|---|
| Original merged change | `ab34e8c5e3ee7a2c5f260d1511714e5be3bed3eb` |
| Release base used | `1c754876008f0806fdcfda8e3a6b2f593b34d6fc` |
| Proposed backport | `740e3d7b2efe15c5a25f671583d29c034602e36f` |

## Conflict resolution

The release renderer already contains the prerequisite work from #6729,
#6773, #7010, and #7481, but differs from the source parent around
clone-plan handling and method documentation.

The resolution preserves the release branch's tensor-backed `ClonePlan`
validation and existing renderer structure, then adds only #6308's
semantic change:

- imports the existing `isaaclab.cloner.query` API;
- passes the validated release clone plan into `_capture_object_scales`;
- projects captured non-unit source scales to active clone destinations
with `path_env_ids` and `path_to_clone`;
- retains real destination scales via `setdefault`.

No paths outside the original PR are changed.

## Type of change

- Bug fix
- Shared regression coverage

## Validation

- Repository backport candidate validation passed across all 12 original
source paths.
- Per-file stable patch IDs match on 11 paths; only the
conflict-resolved renderer path differs.
- Shared rendering-contract architecture tests — 2 passed.
- Focused clone-query tests for `path_env_ids` and `path_to_clone` — 4
passed.
- Python compilation passed for all changed Python files.
- All changed-file pre-commit hooks passed, including changelog and Git
LFS checks.
- `git diff --check upstream/release/3.0.0...HEAD` passed.
- The focused OVRTX runtime test was retried with the documented `ov`
extra, but the release lock has no macOS/arm64 environment. Backend
rendering tests and the canonical `uv run isaaclab -f` remain pending
Linux CI.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the available pre-commit checks
- [x] Documentation changes are not applicable
- [x] The original unit and integration regression coverage is preserved
- [x] Changelog fragments are preserved for every touched package
- [x] The original contributor is already listed in `CONTRIBUTORS.md`

Co-authored-by: ooctipus <[email protected]>
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.

4 participants