Repository navigation
Preserve authored scale in Newton Fabric sync - #7481
Conversation
|
run-ci |
Greptile SummaryThis PR preserves authored rigid-body scale while synchronizing Newton poses into Fabric world matrices.
Confidence Score: 4/5This 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
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]
Reviews (1): Last reviewed commit: "Preserve Newton Fabric body scales" | Re-trigger Greptile |
| if cls._fabric_body_scales is None: | ||
| NewtonManager._fabric_body_scales = wp.empty( | ||
| cls._model.body_count, | ||
| dtype=wp.vec3f, | ||
| device=PhysicsManager._device, | ||
| ) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
run-ci |
| 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])), |
There was a problem hiding this comment.
question (non-blocking): wp.length will drop the sign if there were negative scales in the matrix, is this important for us?
|
clean root cause fix, looks good to me! |
|
Backported to |
# 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)
|
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
It showed up for us as a rendering bug with no physics symptom: millimetre-authored CAD 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.pyIt overlays a stock robot with one extra fixed-joint body under a scaled Xform, then compares the Add Before and after, same image, the only difference being whether the scale is preserved:
Verified against this PR On an image built from
Notes
|
# 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`
#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]>


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
Release backport
developScreenshots
Not applicable; the regression test checks the rendering-side Fabric world matrix directly.
Validation
git diff --checkpassed.upstream/develop.Checklist
uv run isaaclab -f(unsupported on this macOS/arm host)source/isaaclab_newton/changelog.d/CONTRIBUTORS.md