Skip to content

[Backport release/3.0.0] [5D] Bind Newton consumers to shared native resources - #8099

Merged
ooctipus merged 1 commit into
isaac-sim:release/3.0.0from
ooctipus:backport/8027-release-3.0.0
Sep 28, 2026
Merged

ooctipus merged 1 commit into
isaac-sim:release/3.0.0from
ooctipus:backport/8027-release-3.0.0

Conversation

@ooctipus

Copy link
Copy Markdown
Collaborator

Summary

Backports #8027 (b05a35a0eedda86662f82e663993c2b7046bf94f) to release/3.0.0.

Newton cameras, raycasters, and visualizers acquire shared native resources through the simulation registry and consume transforms and geometry through SDP. The original API migration notes and changelog fragments are included unchanged.

This is an exact, conflict-free cherry-pick. The prerequisite #8021 is already present on the release branch. No additional refactoring or fixes are included.

Validation

  • Exact-patch backport validation passed.
  • Formatting, lint, and changelog checks passed.
  • 14 focused registry/lifecycle tests passed.
  • A broader local test invocation encountered Rerun/package-import collection errors. Further local testing was stopped at the user's request; full package, GPU, rendering, and documentation validation is delegated to CI.

Backport isaac-sim#8027 without changes.

(cherry picked from commit b05a35a)
@ooctipus
ooctipus requested a review from a team September 28, 2026 02:45
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 28, 2026
@ooctipus

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 28, 2026
@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[High risk] Restructures how physics and rendering backends are owned and initialized.

The PR is not yet safe to merge because foreign-physics Newton rendering can fail to initialize and web visualizers can select incompatible camera batches.

Findings

  1. P1 Joint labels break binding ▶
  2. P1 Fallback camera count unchecked ▶

Summary

The backport moves Newton builders and native models into the simulation resource registry and makes cameras, ray casters, and visualizers consume SDP data directly.

  • It also adds consumer-owned query graphs, renderer-configuration selection for streaming cameras, and lifecycle updates across rendering backends.
  • The review identifies foreign-physics joint-path binding and fallback-camera selection regressions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Clone[Clone plan] --> Builder[Shared Newton builder]
  Builder --> Native[Registry-owned Newton backend]
  Native --> Camera[Camera renderer]
  Native --> Ray[Ray caster]
  Native --> Viewer[Visualizers]
  SDP[Scene Data Provider] --> Camera
  SDP --> Ray
  SDP --> Viewer
Loading

Reviews (1) · Last reviewed commit: "Backport Newton consumer resource owners..."

sim = SimulationContext.instance()
self.backend = sim.get_or_create_backend(self.newton_cfg)
self._scene_data_provider = sim.get_scene_data_provider()
self._transform_mapping = self._scene_data_provider.create_mapping(list(self.backend.model.body_label))

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 Joint labels break binding

In a foreign-physics scene, a Newton body can be labeled with its joint prim path, while PhysX publishes the rigid-body prim path. Passing the joint label directly to create_mapping raises KeyError and prevents this renderer from initializing. The removed visualization path resolved joint labels to their target bodies; the Newton visualizers and ray caster now use this direct mapping too.

if self.cfg.streaming_cam_target_prim_path is None:
cameras = self._scene_data_provider.get_camera_sensors()
if cameras:
self._camera_sensor = next(iter(cameras.values()))

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 Fallback camera count unchecked

If a scene has multiple cameras and the first covers fewer environments than the simulation, this selects it without checking its view count. The streaming path then uses simulation environment IDs to index that camera's frames, which can raise an out-of-range error even when a suitable camera appears later. Viser makes the same selection.

@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 Newton consumer-ownership backport coherently moves builders, native models, renderers, and query consumers onto the simulation registry and SDP paths. Before merge, restore Kit's camera-enablement gate, make the new PhysX synchronization CPU-safe, and document the newly public NewtonQueries symbol.

  • Design and architecture: The NewtonBuilderCfg/NewtonBackendCfg lifetime split and consumer-owned query graphs align with the registry and SDP ownership rules. However, centralizing early renderer acquisition in BaseVisualizer removed Kit's /isaaclab/cameras_enabled guard, so an auto-camera configuration can initialize RTX infrastructure even when cameras were not enabled.
  • API: The breaking Newton manager and streaming-renderer migrations include migration guidance. NewtonQueries is now exported through the package API and described in the changelog, but it is missing from the updated generated API reference; add an autosummary/autoclass entry or keep the helper private.
  • Implementation: The Newton renderer, ray-caster, and visualizer producer/consumer paths consistently acquire shared resources and use SDP. Two concrete fixes remain: preserve Kit's camera-availability precondition before renderer construction, and replace or guard wp.synchronize_stream(self.device) because CPU-backed rigid-object mass, COM, and inertia setters cannot synchronize a CUDA stream.

Minor fixes needed. Posted 3 actionable findings inline.

Automated review; human maintainers own approval decisions.

# Declare the camera renderer before cloning gathers consumer requirements.
owns_camera = cfg.streaming_sensor_prim_path is None and cfg.streaming_cam_target_prim_path is not None
if cfg.streaming_view and owns_camera:
sim_utils.SimulationContext.instance().get_or_create_backend(cfg.streaming_cam_renderer_cfg)

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 · Implementation — Kit streaming renderer loses cameras-enabled guard

The registration moved from KitVisualizer.__init__ drops the /isaaclab/cameras_enabled condition. With streaming_view=True and an auto-created camera target but no --enable_cameras, IsaacRtxRendererCfg is now constructed, enabling omni.replicator.core and attaching the RTX Hydra engine. KitVisualizerCfg's unchanged docstring still promises the streaming view is silently skipped in that case. Re-apply the camera-availability gate before acquiring the renderer.

cpu_env_ids = self._get_cpu_env_ids(env_ids, sim_env_ids)
wp.copy(self._cpu_body_mass, self.data._body_mass)
# PhysX reads pinned host data immediately; the asynchronous copy must finish first.
wp.synchronize_stream(self.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.

🟡 Warning · Implementation — synchronize_stream is invalid on CPU devices

wp.synchronize_stream(device) resolves Device.stream, which is only defined for CUDA devices. When self.device is "cpu", the public set_masses_index, set_coms_index, and set_inertias_index writes (and the mask variants plus mass/inertia randomization events routed through them) now raise instead of writing. Use wp.synchronize_device(self.device), which is a no-op on CPU, or guard the call on a CUDA device.

"NewtonKaminoManager",
"NewtonMPMManager",
"NewtonManager",
"NewtonQueries",

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.

🔵 Suggestion · Api — Exported NewtonQueries missing from API docs

NewtonQueries is added to the package's public __all__ and stub exports and described as public in the changelog, but docs/source/api/lab_newton/isaaclab_newton.physics.rst was updated only for NewtonBuilderCfg and create_newton_builder. The new query/capture helper is therefore absent from the generated reference. Add it to the autosummary list with a matching autoclass block, or keep it private.

@ooctipus
ooctipus merged commit 7fb621c into isaac-sim:release/3.0.0 Sep 28, 2026
52 checks passed
@ooctipus
ooctipus deleted the backport/8027-release-3.0.0 branch October 14, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant