Skip to content

[Core] Refactor and cleanup core subpackage for 3.0 [5C/N] - #7991

Merged
ooctipus merged 1 commit into
isaac-sim:developfrom
StafaH:core-cleanup/05c-backend-signatures
Sep 24, 2026
Merged

ooctipus merged 1 commit into
isaac-sim:developfrom
StafaH:core-cleanup/05c-backend-signatures

Conversation

@StafaH

@StafaH StafaH commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Part of the series that splits the core cleanup in #7949 into small, reviewable pieces. An audit of the backend asset classes (after the tendon issues in #7985 / #7990) found two public API signatures that always fail on one backend. This PR fixes both. It is independent of #7985 / #7990.

Fixes

  • Newton, deprecated joint friction writers. Articulation.write_joint_friction_coefficient_to_sim (deprecated) was overridden in Newton to pass joint_friction_coeff positionally to the keyword-only write_joint_friction_coefficient_to_sim_index, and to forward full_data, which that method does not accept. It always raised TypeError, and so did the deprecated write_joint_friction_to_sim, which the base class routes through it. The override is removed, so Newton uses the base class implementation that PhysX and OVPhysX match (keyword forwarding to the index writer).
  • PhysX, RigidObjectCollection mask writers. write_body_link_pose_to_sim_mask, write_body_com_pose_to_sim_mask, write_body_com_velocity_to_sim_mask, and write_body_link_velocity_to_sim_mask took body_ids instead of the body_mask that the base class, OVPhysX, and Newton declare, so body_mask= raised TypeError on PhysX. They now take body_mask. body_ids still works but emits a DeprecationWarning (passing both raises ValueError).

Tests

  • test/assets/test_articulation_iface.py: new test_deprecated_joint_friction_writers calls both deprecated friction writers on every backend; it fails for Newton on develop.
  • test/assets/test_rigid_object_collection_iface.py: the mask writer tests skipped body_mask for the link/com variants (with a note about this mismatch). The workaround and note are removed, so body_mask is exercised for all six mask writers on every backend. PhysX is only available in these tests with Kit; I confirmed under Kit that all four PhysX writers reject body_mask= on develop and accept it here. The full file passes locally for Newton and OVPhysX (1276 passed).

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@StafaH
StafaH requested a review from a team September 24, 2026 02:28
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 24, 2026
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The implementation appears safe to merge, with a non-blocking test-coverage gap around the new PhysX compatibility behavior.

Findings

  1. P2 Compatibility branches lack coverage ▶

Summary

This PR aligns backend writer signatures with their base interfaces:

  • Removes Newton's broken deprecated joint-friction override so the compatible base implementation is inherited.
  • Adds body_mask support to four PhysX rigid-object-collection writers while retaining deprecated body_ids compatibility.
  • Expands cross-backend interface coverage, although the newly added compatibility branches remain untested.

Reviews (1) · Last reviewed commit: "Fix Newton deprecated friction writers a..."

Comment on lines +1345 to +1356
) -> Sequence[int] | torch.Tensor | wp.array | slice:
"""Resolve the bodies of a mask writer, accepting the deprecated ``body_ids`` in place of ``body_mask``."""
if body_ids is None:
return self._resolve_body_mask(body_mask)
if body_mask is not None:
raise ValueError("Pass either 'body_mask' or the deprecated 'body_ids', not both.")
warnings.warn(
"The 'body_ids' argument of the rigid object collection mask writers is deprecated. Please use"
" 'body_mask' instead.",
DeprecationWarning,
stacklevel=3,
)

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 Compatibility branches lack coverage

This helper adds two public behaviors: it emits a deprecation warning when only body_ids is supplied, and raises ValueError when both body_ids and body_mask are supplied. The updated interface tests exercise only the body_mask path, so regressions in the warning category, deprecated forwarding, or conflict handling could go unnoticed. Please add tests for both compatibility branches.

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

The PR consistently repairs two backend-specific API mismatches: Newton now inherits the functional base implementation for deprecated joint-friction writers, and four PhysX rigid-object collection mask writers accept the shared body_mask contract while retaining body_ids through a documented deprecation path. Targeted regression coverage and package changelog fragments accompany both fixes.

  • Design and architecture: Removing the broken Newton override restores the shared base-class forwarding path. PhysX keeps mask conversion localized at the backend boundary through _resolve_mask_writer_body_ids, consistent with its existing environment/body mask helpers and index-based implementation.
  • API: The four PhysX writers remain keyword-only, accept the base API's body_mask, preserve existing body_ids callers with a DeprecationWarning, and reject ambiguous use of both arguments. The Newton deprecated methods retain their public surface through inheritance. Changelog entries document both user-visible corrections and migration guidance.
  • Implementation: The PhysX helper resolves masks before forwarding to the existing index writers with full_data=True, preserving the established data-shape and simulation-write paths. Tests now exercise body_mask across all relevant backends and both deprecated Newton friction writers. The existing narrow wp.array | None mask annotation remains a minor typing limitation because the implementation also handles torch masks, but this is consistent with surrounding APIs and does not block the fix.

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.

@StafaH

StafaH commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator 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 24, 2026
@ooctipus
ooctipus merged commit 2b62263 into isaac-sim:develop Sep 24, 2026
54 checks passed
StafaH added a commit to StafaH/IsaacLab that referenced this pull request Sep 24, 2026
StafaH added a commit that referenced this pull request Sep 24, 2026
…#7941, #7977, #7983, #7991, #8003) (#8002)

## Description

Backports the rendering changes and related release fixes:

- #7941 — routes rigid rendering transforms through `SceneDataProvider`
and preserves shared Fabric bindings.
- #7977 — batches due camera captures by renderer and fixes moving and
cloned camera updates. This supersedes #8001.
- #7983 — removes `CameraRenderSpec.camera_path_relative_to_env_0` and
derives and validates the OVRTX source camera path from
`camera_prim_paths`. The rendering changes were developed with this
interface, so it is required by their OVRTX tests.
- #7991 — fixes Newton's deprecated joint friction writers and the PhysX
rigid object collection `body_mask` writer signatures.
- #8003 — consolidates redundant Newton tests to shorten the Newton CI
job without changing runtime code.

#7941 required conflict resolution in the OVRTX legacy and OvStage
transform binding functions: the release branch's Newton model path
collection was replaced by SDP-published paths. #7983 was then
integrated with those SDP paths. Each added commit records its source
commit.

Custom scene-data backends must follow the `transforms_version`
publication contract described in the included migration documentation.
Direct callers of `BaseRenderer.render()` must pass a sequence, for
example `render([data])`. Callers constructing `CameraRenderSpec` must
remove the `camera_path_relative_to_env_0` argument; OVRTX now derives
it from `camera_prim_paths`.

## Validation

- Rendering and scene-data focused tests from the original backport
passed locally: 27 renderer tests and 50 scene-data / PhysX renderer
tests. OVRTX runtime cases were skipped locally because the optional
`ovrtx` module is unavailable.
- #7991: the Newton deprecated friction writer test passed, and 72 rigid
object collection mask writer cases passed. The new friction test fails
without the fix and passes with it.
- #8003: all 8 revised contact lifecycle cases passed. Kit-based Newton
asset tests remain for CI.
- `uv run isaaclab -f` passed after all additions with the changelog
base set to `release/3.0.0`, as did `git diff --check`.
- The original backport's documentation build passed with warnings
treated as errors. Full GPU and Kit CI is running on the updated PR.

## Type of change

- Rendering bug fixes and performance improvement
- Backend API bug fixes and breaking renderer / scene-data interface
changes with migration guidance
- Newton test consolidation
- Documentation and changelog fragments for affected source packages

## Release backport

This PR targets `release/3.0.0`; no further backport is needed.

## Checklist

- [x] Contribution guidance reviewed
- [x] Focused local tests and formatting checks passed
- [x] Public documentation and package changelog fragments included
- [ ] Full GPU and Kit CI passed

---------

Co-authored-by: ooctipus <[email protected]>
Co-authored-by: Piotr Barejko <[email protected]>
ooctipus added a commit that referenced this pull request Sep 25, 2026
# Description

Part of the series that splits the core cleanup in #7949 into small,
reviewable pieces. Following #7985, event terms and task code should not
branch on the physics manager's class name; they should call the asset
API and let each backend handle (or reject) what it supports. An audit
found the remaining places that branched on the backend name, plus one
Newton solver gap. This PR fixes them. It is independent of #7985 /
#7990 / #7991.

## Changes
- **`randomize_joint_parameters`** chose the friction write path with
`"newton" in manager_name`, treating every other backend (including
OVPhysX) as PhysX. It now randomizes dynamic friction whenever the asset
data exposes `joint_dynamic_friction_coeff` (PhysX, OVPhysX; not
Newton), and makes one `write_joint_friction_coefficient_to_sim_index`
call on every backend. Newton's writer already applies the viscous part
and ignores dynamic friction. Its invalid-operation error also named
`'randomize_fixed_tendon_parameters'`; it now names the right term.
- **`randomize_rigid_body_com`** sliced the pose to a position on Newton
(`"newton" in manager_name`) because Newton's `set_coms_*` accepted
positions only, unlike the base API, PhysX, and OVPhysX, which take
poses. Newton's `set_coms_index` / `set_coms_mask` (articulation, rigid
object, rigid object collection) now also accept poses (trailing
dimension 7 or `wp.transformf`) and ignore the orientation, since Newton
models the center of mass as a position. The event passes poses on every
backend.
- **`randomize_rigid_body_scale`** detected articulations with
`cls.__name__ == "Articulation"` over the MRO; it now uses
`isinstance(asset, BaseArticulation)`.
- **NIST `reset_end_effector_around_asset`** (`isaaclab_tasks` contrib)
no longer performs a backend-specific Jacobian refresh. Joint writes
invalidate articulation data, and subsequent body-pose reads refresh
forward kinematics on demand. This also removes the invalid
`root_physx_view` access on OVPhysX.
- **Newton Featherstone inertia changes.** `SolverFeatherstone` derives
its inertia data (`body_I_m`, `body_X_com`) from the model only in its
constructor, and its `notify_model_changed` ignores
`ModelFlags.BODY_INERTIAL_PROPERTIES`. So `set_masses_*`, `set_coms_*`,
`set_inertias_*`, and the mass/CoM/inertia randomization events silently
had no effect on Featherstone. The real fix is upstream in Newton. Until
then, a manager can declare model changes its solver does not apply
(`NewtonManager._ignored_model_changes`). Featherstone declares
`BODY_INERTIAL_PROPERTIES`, and the manager logs a warning the first
time such a change is flushed.
- **Pretrained checkpoints** (`isaaclab_rl`): OVPhysX configs resolve to
the PhysX checkpoints through the `"physx"` substring match. This is
intended, since they run the same PhysX engine, so it is only
documented.

Not changed: Newton ignores `joint_velocity_limit` on MJWarp (documented
by Newton). A warning was considered, but actuator setup writes velocity
limits for every articulation, so it would fire on every MJWarp run.

## Tests
- `isaaclab_physx/test/assets/test_articulation.py`: the two CUDA cases
of `test_write_joint_state_data_consistency` pass, verifying fresh body
state after manual joint writes without a simulation step or explicit
Jacobian read.
- `test/envs/test_articulation_ordering_events.py`: the Newton
joint-parameter randomization test no longer gives the term a physics
manager. It fails on `develop`, where the term reads `env.sim`. The fake
Newton articulation now forwards viscous friction the way Newton's
writer does.
- `isaaclab_newton/test/assets/test_articulation.py`:
`test_randomize_rigid_body_com` also sets CoMs from full poses (fails on
`develop` with a shape mismatch).
- `isaaclab_newton/test/physics/test_newton_manager_abstraction.py`:
`test_initialize_solver_populates_canonical_state` checks that only
Featherstone registers `BODY_INERTIAL_PROPERTIES` as ignored (8 solver
variants).
- Also passing: the full Newton manager abstraction tests (199) and the
Newton articulation / rigid object / collection CoM and friction tests.

## 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`

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Octi Zhang <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 25, 2026
# Description

Part of the series that splits the core cleanup in #7949 into small,
reviewable pieces. Following #7985, event terms and task code should not
branch on the physics manager's class name; they should call the asset
API and let each backend handle (or reject) what it supports. An audit
found the remaining places that branched on the backend name, plus one
Newton solver gap. This PR fixes them. It is independent of #7985 /
#7990 / #7991.

## Changes
- **`randomize_joint_parameters`** chose the friction write path with
`"newton" in manager_name`, treating every other backend (including
OVPhysX) as PhysX. It now randomizes dynamic friction whenever the asset
data exposes `joint_dynamic_friction_coeff` (PhysX, OVPhysX; not
Newton), and makes one `write_joint_friction_coefficient_to_sim_index`
call on every backend. Newton's writer already applies the viscous part
and ignores dynamic friction. Its invalid-operation error also named
`'randomize_fixed_tendon_parameters'`; it now names the right term.
- **`randomize_rigid_body_com`** sliced the pose to a position on Newton
(`"newton" in manager_name`) because Newton's `set_coms_*` accepted
positions only, unlike the base API, PhysX, and OVPhysX, which take
poses. Newton's `set_coms_index` / `set_coms_mask` (articulation, rigid
object, rigid object collection) now also accept poses (trailing
dimension 7 or `wp.transformf`) and ignore the orientation, since Newton
models the center of mass as a position. The event passes poses on every
backend.
- **`randomize_rigid_body_scale`** detected articulations with
`cls.__name__ == "Articulation"` over the MRO; it now uses
`isinstance(asset, BaseArticulation)`.
- **NIST `reset_end_effector_around_asset`** (`isaaclab_tasks` contrib)
no longer performs a backend-specific Jacobian refresh. Joint writes
invalidate articulation data, and subsequent body-pose reads refresh
forward kinematics on demand. This also removes the invalid
`root_physx_view` access on OVPhysX.
- **Newton Featherstone inertia changes.** `SolverFeatherstone` derives
its inertia data (`body_I_m`, `body_X_com`) from the model only in its
constructor, and its `notify_model_changed` ignores
`ModelFlags.BODY_INERTIAL_PROPERTIES`. So `set_masses_*`, `set_coms_*`,
`set_inertias_*`, and the mass/CoM/inertia randomization events silently
had no effect on Featherstone. The real fix is upstream in Newton. Until
then, a manager can declare model changes its solver does not apply
(`NewtonManager._ignored_model_changes`). Featherstone declares
`BODY_INERTIAL_PROPERTIES`, and the manager logs a warning the first
time such a change is flushed.
- **Pretrained checkpoints** (`isaaclab_rl`): OVPhysX configs resolve to
the PhysX checkpoints through the `"physx"` substring match. This is
intended, since they run the same PhysX engine, so it is only
documented.

Not changed: Newton ignores `joint_velocity_limit` on MJWarp (documented
by Newton). A warning was considered, but actuator setup writes velocity
limits for every articulation, so it would fire on every MJWarp run.

## Tests
- `isaaclab_physx/test/assets/test_articulation.py`: the two CUDA cases
of `test_write_joint_state_data_consistency` pass, verifying fresh body
state after manual joint writes without a simulation step or explicit
Jacobian read.
- `test/envs/test_articulation_ordering_events.py`: the Newton
joint-parameter randomization test no longer gives the term a physics
manager. It fails on `develop`, where the term reads `env.sim`. The fake
Newton articulation now forwards viscous friction the way Newton's
writer does.
- `isaaclab_newton/test/assets/test_articulation.py`:
`test_randomize_rigid_body_com` also sets CoMs from full poses (fails on
`develop` with a shape mismatch).
- `isaaclab_newton/test/physics/test_newton_manager_abstraction.py`:
`test_initialize_solver_populates_canonical_state` checks that only
Featherstone registers `BODY_INERTIAL_PROPERTIES` as ignored (8 solver
variants).
- Also passing: the full Newton manager abstraction tests (199) and the
Newton articulation / rigid object / collection CoM and friction tests.

## 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`

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Octi Zhang <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>

(cherry picked from commit 8835a34)
@ooctipus ooctipus self-assigned this Sep 25, 2026
@ooctipus ooctipus added this to the Isaac Lab 3.0 GA milestone Sep 25, 2026
@StafaH
StafaH deleted the core-cleanup/05c-backend-signatures branch October 10, 2026 19:43
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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants