Cherry-picks pyglet and visualizer fixes from develop#6180
Conversation
## Summary - Initializes first-time visualizers after `physics_manager.reset()` has created PhysX tensor views, but before `physics_manager.play()` pumps Kit timeline events. - Prevents Newton visualizer initialization from seeing a PhysX scene-data backend whose tensor view was invalidated by a STOP event processed during the play event pump. - Adds a focused unit test that locks the reset ordering to `reset -> initialize_visualizers -> play` for first-time visualizers. ## Root cause The reported command selects the Newton visualizer, but not Newton physics, so the failing path is PhysX simulation feeding the Newton visualizer through the scene-data provider. `PhysxManager.reset()` creates the PhysX tensor simulation view and stores it in the scene-data backend. `SimulationContext.reset()` then called `physics_manager.play()` before creating visualizers. `PhysxManager.play()` calls `omni.kit.app.get_app().update()`, which can process timeline events. On the failing Windows/Kit path, a STOP event is processed there, and `PhysxManager._on_stop()` invalidates the freshly created tensor views. The Newton visualizer is then initialized after that invalidation and asks scene data for `transform_paths`, which reaches `RigidBodyView.prim_paths` on an invalid PhysX view and crashes with `NoneType.prim_paths`. The correct fix is to initialize visualizers before the play event pump, not to make scene-data consumers tolerate already-invalid views. ## Validation - `python3 -m py_compile source/isaaclab/isaaclab/sim/simulation_context.py source/isaaclab/test/sim/test_simulation_context_visualizers.py` - `python3 tools/changelog/cli.py check develop` - `git diff --cached --check` - `pre-commit run --files source/isaaclab/isaaclab/sim/simulation_context.py source/isaaclab/test/sim/test_simulation_context_visualizers.py source/isaaclab/changelog.d/zhengyuz-sim-reset-visualizer-before-play.rst` Focused pytest was attempted locally, but this shell lacks runtime deps (`lazy_loader`) needed to import the visualizer test module.
- Add explicit `pyglet>=2.1.6,<3` dependencies for Newton GL visualizer/video extras. - Update the `newton` extra install message to include pyglet. - Document the `glCreateShader` failure mode as an OpenGL-context/session problem rather than a task or Newton physics failure. Newton ViewerGL requires pyglet/OpenGL, but Isaac Lab's Newton GL packages did not declare pyglet directly. Separately, the reported Windows stack means pyglet obtained an OpenGL context that does not expose OpenGL 2.0 shader functions; an RTX PRO 6000 driver should expose that, so the process is not receiving the NVIDIA OpenGL context in that automation/display session. - `pre-commit run --files docs/source/overview/core-concepts/visualization.rst source/isaaclab/isaaclab/cli/commands/install.py source/isaaclab_newton/pyproject.toml source/isaaclab_visualizers/pyproject.toml source/isaaclab/changelog.d/zhengyuz-newton-pyglet-install-message.rst source/isaaclab_newton/changelog.d/zhengyuz-newton-gl-pyglet-dependency.rst source/isaaclab_visualizers/changelog.d/zhengyuz-newton-pyglet-dependency.rst` - `python3 tools/changelog/cli.py check develop` - `git diff --check`
Greptile SummaryThis cherry-pick backports two fixes from
Confidence Score: 5/5Safe to merge — the reset ordering fix is narrowly scoped, well-tested, and the dependency additions are additive-only with a pinned lower-bound and a conservative upper bound that excludes the unreleased pyglet 3.x series. Both changes are straightforward: a two-line reorder in reset() backed by a new event-log test that exercises the exact failure scenario, and two additive setup.py lines that make an already-required runtime package explicit. No logic is removed, no existing tests are modified, and the version constraint for pyglet is consistent across both packages. No files require special attention. The only behavioural change is in simulation_context.py, and the new test covers the corrected ordering directly. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Caller
participant SC as SimulationContext.reset()
participant PM as PhysicsManager
participant VI as initialize_visualizers()
participant VZ as Visualizer.reset()
C->>SC: "reset(soft=False)"
SC->>PM: reset(soft)
Note over PM: PhysX tensor views created/ready
alt _visualizers not empty
SC->>VZ: viz.reset(soft) for each viz
else _visualizers empty (first call)
SC->>VI: initialize_visualizers()
Note over VI: Visualizers access PhysX views safely
VI-->>SC: _visualizers populated
end
SC->>PM: play()
Note over PM: Timeline events pumped
SC-->>C: "_is_playing=True, _is_stopped=False"
Reviews (1): Last reviewed commit: "Declare pyglet for Newton GL features (#..." | Re-trigger Greptile |
Description
Cherry pick visualizer fixes from develop: