Skip to content

PhysX RTX Sync fix - #7809

Open
pbarejko wants to merge 2 commits into
isaac-sim:developfrom
pbarejko:pbarejko/physx-rtx-sync
Open

pbarejko wants to merge 2 commits into
isaac-sim:developfrom
pbarejko:pbarejko/physx-rtx-sync

Conversation

@pbarejko

Copy link
Copy Markdown
Collaborator

Description

This PR is an alternative approach to #7138

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Release backport

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

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • 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

@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule issue remains.

Summary

The PR adds scene-revision tracking and a PhysX tensor-view write barrier so tensor pose mutations can be synchronized into Fabric and RTX before an on-demand frame, without advancing the public physics-step counter.

  • Wraps rigid-object, rigid-object-collection, and articulation views to detect successful transform writes.
  • Coalesces same-step pose writes and performs the required native synchronization during forwarding.
  • Integrates revision-aware frame pumping into Isaac RTX and Kit visualizer paths while preserving Kit playback state.
  • Adds unit and integration coverage for write tracking, forwarding cadence, callback behavior, playback restoration, and first-frame pose visibility.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Tensor pose writer] --> B[_PoseTrackingView]
    B --> C[Mark pending PhysX pose write]
    C --> D[Increment scene revision]
    D --> E[Camera or Kit frame requested]
    E --> F[Physics manager forward]
    F --> G[Native PhysX synchronization]
    G --> H[Fabric transform update]
    H --> I[Kit app frame pump]
    I --> J[Mark captured revision rendered]
    J --> K[Read camera or viewport output]
Loading

Reviews (1) · Last reviewed commit: "PhysX RTX Sync fix"

@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 scene-revision invalidation flow addresses same-step RTX refreshes, but the implementation changes the documented PhysX root_view compatibility surface by exposing _PoseTrackingView instead of the native tensor view.

  • Design and architecture: Tracking external pose mutations through render-context revisions cleanly separates invalidation from backend-specific frame pumping. However, placing the tracking proxy directly in each asset’s _root_view and SimulationManager.views leaks an internal synchronization mechanism across the public native-view boundary.
  • API: Finding 0 is supported: RigidObject, RigidObjectCollection, and Articulation now return a delegating Python wrapper through their documented root_view handles. Attribute delegation does not preserve native type identity, isinstance behavior, declared PhysX view types, or compatibility with consumers requiring the underlying pybind object. The native public handle should be preserved while pose-write tracking is implemented without changing its exposed type.
  • Implementation: The revision bookkeeping, pending-write coalescing, exception-safe playback-state restoration, and Kit/RTX frame paths are covered by focused tests. Before merge, the pose-write interception must be moved or otherwise implemented so _root_view and SimulationManager.views retain their native PhysX objects.

Significant concerns. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

_, root_prim_path_expr = resolve_matching_prims_from_source(self.cfg.prim_path, **resolve_kwargs)[0]
# -- object view
self._root_view = self._physics_sim_view.create_rigid_body_view(path_expr_to_glob(root_prim_path_expr))
self._root_view = _PoseTrackingView(

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 · Api — Public root_view now returns delegating wrapper

_root_view is exposed through the documented public root_view property, so callers now receive _PoseTrackingView instead of the native PhysX view (same in rigid_object_collection.py:1361, articulation.py:3862, which also stores the wrapper in SimulationManager.views). __getattr__ forwards attributes but cannot preserve isinstance/exact-type checks, declared physx.RigidBodyView/ArticulationView types, or native APIs requiring the pybind object. Keep the native view public and mark pose writes on the asset writer paths.

@pbarejko

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 15, 2026
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.

1 participant