Repository navigation
Fix PhysX simulation lifecycle ownership - #6588
AntoineRichard merged 4 commits into
Conversation
Record the import-order regression introduced by removing Kit extension manifests and define the backend-owned initialization fix and regression coverage.
Define the red-green regression workflow, focused implementation, validation gates, and separate pull request steps.
Retry the SimulationManager compatibility takeover when PhysxManager initializes so early backend config imports cannot leave Isaac Sim callbacks subscribed.
Keep the public pull request focused on the PhysX fix, regression test, and changelog while retaining the local planning history in earlier commits.
Greptile SummaryFixes a regression introduced by PR #6505 where early imports of
Confidence Score: 4/5The production code change is minimal (4 lines in initialize()) and reuses an already-tested, idempotent helper; safe to merge after resolving the docs artifacts. The fix is surgical and well-scoped, the integration test exercises the exact broken import order, and the double-call path is safe by design. The two docs/superpowers/ files are planning artifacts that were committed alongside the fix and warrant a second look before merging. docs/superpowers/plans/2026-07-17-physx-simulation-manager-lifecycle.md and docs/superpowers/specs/2026-07-17-physx-simulation-manager-lifecycle-design.md appear to be internal agentic planning artifacts and should be reviewed for intentional inclusion. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UserScript
participant isaaclab_physx as isaaclab_physx.__init__
participant Kit
participant SimMgr as isaacsim SimulationManager
participant PhysxMgr as PhysxManager
Note over UserScript,PhysxMgr: Pre-Kit import (e.g. task config resolution)
UserScript->>isaaclab_physx: import PhysxCfg
isaaclab_physx->>isaaclab_physx: _patch_isaacsim_simulation_manager()
isaaclab_physx-->>isaaclab_physx: no-op (isaacsim not in sys.modules yet)
Note over UserScript,PhysxMgr: Kit startup
UserScript->>Kit: "AppLauncher(headless=True)"
Kit->>SimMgr: load and register PLAY/STOP/stage callbacks
Note over UserScript,PhysxMgr: SimulationContext creation (post-Kit)
UserScript->>PhysxMgr: "SimulationContext(physics=PhysxCfg())"
PhysxMgr->>PhysxMgr: initialize()
PhysxMgr->>isaaclab_physx: _patch_isaacsim_simulation_manager() [retry]
isaaclab_physx->>SimMgr: enable_all_default_callbacks(False)
isaaclab_physx->>SimMgr: "SimulationManager = PhysxManager"
Note over SimMgr: Original STOP callback disabled
PhysxMgr->>PhysxMgr: _setup_subscriptions(), _configure_physics(), ...
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UserScript
participant isaaclab_physx as isaaclab_physx.__init__
participant Kit
participant SimMgr as isaacsim SimulationManager
participant PhysxMgr as PhysxManager
Note over UserScript,PhysxMgr: Pre-Kit import (e.g. task config resolution)
UserScript->>isaaclab_physx: import PhysxCfg
isaaclab_physx->>isaaclab_physx: _patch_isaacsim_simulation_manager()
isaaclab_physx-->>isaaclab_physx: no-op (isaacsim not in sys.modules yet)
Note over UserScript,PhysxMgr: Kit startup
UserScript->>Kit: "AppLauncher(headless=True)"
Kit->>SimMgr: load and register PLAY/STOP/stage callbacks
Note over UserScript,PhysxMgr: SimulationContext creation (post-Kit)
UserScript->>PhysxMgr: "SimulationContext(physics=PhysxCfg())"
PhysxMgr->>PhysxMgr: initialize()
PhysxMgr->>isaaclab_physx: _patch_isaacsim_simulation_manager() [retry]
isaaclab_physx->>SimMgr: enable_all_default_callbacks(False)
isaaclab_physx->>SimMgr: "SimulationManager = PhysxManager"
Note over SimMgr: Original STOP callback disabled
PhysxMgr->>PhysxMgr: _setup_subscriptions(), _configure_physics(), ...
|
# Description PR isaac-sim#6505 removed the Kit extension startup that previously re-imported `isaaclab_physx` after Kit loaded. When task configuration imports the PhysX package before Kit, the compatibility hook returns early and is never retried. The original Isaac Sim `SimulationManager` STOP callback then invalidates the tensor view shared with `PhysxManager`, causing Franka and other PhysX articulation environments to fail during their first reset. This PR retries the existing idempotent compatibility takeover from `PhysxManager.initialize()`, where Kit is available and PhysX is the selected backend. It also updates the import-order contract and adds an integration regression test that imports `PhysxCfg` before launching Kit. This fix is independent of isaac-sim#6337. ## Type of change - Bug fix (non-breaking change which fixes an issue) - Documentation update ## Screenshots N/A ## Validation - Regression RED on unmodified develop: module alias remained the original Isaac Sim `SimulationManager` after `SimulationContext` initialization. - Regression GREEN: `1 passed`. - `Isaac-Reach-Franka`, 16 environments, PhysX: environment creation, reset, and first step completed with exit code 0 and without invalidated-view errors. - `./isaaclab.sh -p tools/changelog/cli.py check develop` - `./isaaclab.sh -f` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `./isaaclab.sh -f` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove the fix is effective - [x] I have added a changelog fragment for every touched package - [x] My name already exists in `CONTRIBUTORS.md`
Description
PR #6505 removed the Kit extension startup that previously re-imported
isaaclab_physxafter Kit loaded. When task configuration imports the PhysX package before Kit, the compatibility hook returns early and is never retried. The original Isaac SimSimulationManagerSTOP callback then invalidates the tensor view shared withPhysxManager, causing Franka and other PhysX articulation environments to fail during their first reset.This PR retries the existing idempotent compatibility takeover from
PhysxManager.initialize(), where Kit is available and PhysX is the selected backend. It also updates the import-order contract and adds an integration regression test that importsPhysxCfgbefore launching Kit.This fix is independent of #6337.
Type of change
Screenshots
N/A
Validation
SimulationManagerafterSimulationContextinitialization.1 passed.Isaac-Reach-Franka, 16 environments, PhysX: environment creation, reset, and first step completed with exit code 0 and without invalidated-view errors../isaaclab.sh -p tools/changelog/cli.py check develop./isaaclab.sh -fChecklist
./isaaclab.sh -fCONTRIBUTORS.md