Repository navigation
Add backend selection to standalone scripts - #6682
kellyguo11 merged 1 commit into
Conversation
Greptile SummaryThis PR introduces a discovery-driven smoke-test matrix for all standalone demos and tutorials, supervising each declared physics/renderer/visualizer combination via a subprocess harness, and fixes several root causes exposed by the full matrix run.
Confidence Score: 4/5Safe to merge; all three findings are observability or test-reliability concerns with no impact on production simulation paths. The core smoke harness, Newton standalone-scene path, and rigid-object pattern fix are all well-tested and logically sound. Two findings affect the test infrastructure itself: a screenshot RuntimeError that can escape the supervisor instead of producing a clean test failure, and a regex in the showroom sync test that includes trailing paragraph text for the last table entry, potentially masking a missing visualizer entry in future edits. The third finding is that the empty-builder INFO message no longer surfaces the clue most useful for diagnosing cloned scenes where Newton schemas failed to parse. standalone_script_cases.py (screenshot error propagation) and test_standalone_scripts.py (showroom sync regex for last table row) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[discover_specs AST walk] --> B[ScriptSpec physics renderer visualizer]
B --> C[build_cases cartesian product]
C --> D{skip_reason?}
D -->|yes| E[pytest.skip]
D -->|no| F{backend available?}
F -->|no| E
F -->|yes| G[LaunchCase.command]
G --> H[run_until_ready subprocess.Popen]
H --> I{readiness pattern found?}
I -->|yes then soak| J[SIGTERM process group]
I -->|fatal pattern seen| K[record in fatal_patterns set]
I -->|startup timeout| J
J --> L[assert_smoke_passed]
K --> L
M[_ensure_visualization_model] --> N{World/envs exists?}
N -->|yes| O[collect env_paths sorted]
N -->|no| P[env_paths empty num_envs=1]
O --> Q[build_visualization_builder]
P --> Q
Q --> R{clone_plan None or empty env_paths?}
R -->|yes| S[builder.add_usd full stage]
R -->|no| T[clone-plan per-env layout]
Reviews (1): Last reviewed commit: "Merge branch 'develop' into kellyg/stand..." | Re-trigger Greptile |
| if ( | ||
| screenshot_path is not None | ||
| and ready_at is not None | ||
| and not screenshot_captured | ||
| and now - ready_at >= min(screenshot_delay, soak_time / 2.0) | ||
| ): | ||
| _capture_screenshot(screenshot_path) | ||
| screenshot_captured = True |
There was a problem hiding this comment.
Screenshot RuntimeError escapes the supervisor
_capture_screenshot raises RuntimeError on display failure or an empty image file. Because it is called inside the main try block without a local except, that exception propagates through the finally cleanup (which kills the subprocess correctly) and then escapes run_until_ready entirely. The caller receives an unexpected RuntimeError rather than a SmokeResult whose ready/returncode fields can be asserted on normally. Wrapping the call or logging the failure and setting screenshot_captured = True would keep the supervisor's contract intact even when the display is flaky.
| for match in re.finditer( | ||
| r"(?ms)^ \* - ``(?P<path>scripts/demos/[^`]+\.py)``.*?(?=^ \* - ``scripts/demos/|\nA few quick)", | ||
| showroom, | ||
| ) | ||
| } | ||
| demo_specs = {spec.relative_path: spec for spec in SPECS if spec.relative_path.startswith("scripts/demos/")} | ||
| assert rows.keys() == demo_specs.keys() | ||
| for path, spec in demo_specs.items(): | ||
| row = rows[path] | ||
| for _, backend in (*spec.physics_backends, *spec.rendering_backends): | ||
| if backend != "default": | ||
| assert f"``{backend}``" in row, f"{path} does not document {backend!r}" | ||
| for visualizer in spec.visualizers: | ||
| assert f"``{visualizer}``" in row, f"{path} does not document {visualizer!r}" |
There was a problem hiding this comment.
Showroom sync test can false-positive on the last table row
The lookahead |\nA few quick causes the match for the final table entry (tacsl_sensor.py) to consume all text up to "A few quick showroom scripts to run…", including the "Visualizer selection is independent…" paragraph. That paragraph contains backtick-quoted names like newton , rerun , viser , kit , and none . So assert f"``{visualizer}``" in row will pass for tacsl_sensor.py even if its actual table cells no longer list those visualizers, because the match text includes the surrounding paragraph. Changing the termination to also stop at \nVisualizer or using a lookahead anchored to the RST list-item indent would keep only the row's own cells in scope.
| if builder.body_count == 0: | ||
| logger.error( | ||
| "[NewtonManager] USD stage walk produced no Newton bodies; the shadow " | ||
| "Newton model for visualization will be empty. Common causes: the cloned " | ||
| "envs are not yet on the stage, or PhysX schemas could not be parsed by " | ||
| "Newton's add_usd. Check that /World/envs/env_<id> prims exist when the " | ||
| "renderer is initialized." | ||
| logger.info( | ||
| "[NewtonManager] USD stage walk produced no Newton bodies; finalizing an " | ||
| "empty visualization model for marker-only or geometry-only scenes." | ||
| ) |
There was a problem hiding this comment.
INFO downgrade loses visibility for misconfigured cloned scenes
The previous ERROR log included a detailed diagnostic ("Common causes: the cloned envs are not yet on the stage…") that is helpful when body_count == 0 is unexpected — e.g., the /World/envs prims exist but Newton schemas weren't parsed. The replacement INFO message says "marker-only or geometry-only scenes", which is accurate for the new valid case but gives no hint for genuine mis-configurations. Raising to WARNING with a note that this is expected for marker-only scenes, or including the old diagnostic clue alongside the new message, would preserve observability without over-alarming.
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!
80800ff to
7405f32
Compare
Document each demo's supported backends and update the standalone scripts to select their compatible physics, renderer, and visualizer implementations.
330631d to
612be92
Compare
# Description Adds a parameterized smoke-test framework for standalone demo and tutorial scripts across their declared physics, renderer, and visualizer combinations. The matrix validates CLI declarations, launches supported combinations with bounded timeouts, checks readiness and fatal output, and captures visualizer screenshots when requested. A dedicated `standalone demos (headless)` GPU CI job now runs every demo with the `none` visualizer across all declared physics and renderer combinations. GUI visualizer slices remain available for local validation with a display server. The expanded coverage exposed three Newton compatibility issues, fixed here: - PhysX-backed standalone and marker-only scenes can build a shadow Newton model for external visualizers without requiring `/World/envs/env_<id>`. - Newton implicit MPM accepts imported convex-mesh rigid colliders through its triangle-mesh geometry path. - Newton rigid-object collections match configured prim paths exactly instead of selecting unrelated sibling assets. Review follow-ups also: - made the MPM particle-pour asset path genuinely kitless by relying on the standard `UsdFileCfg` asset localization path; - made scoped smoke runs independent of unrelated raycaster cases; and - strengthened the MPM regression to finalize the CUDA model and construct `SolverImplicitMPM`. ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking test and CI infrastructure) ## Validation - `uv run python -m pytest source/isaaclab/test/app/test_standalone_scripts.py -q` — 27 passed, 280 skipped launch cases - CI-scoped MPM launch matrix (`demos/mpm`, visualizer `none`) — 2 passed - `uv run python scripts/demos/mpm/particle_pour.py --device cuda:0 --visualizer none --max-steps 2` — passed without launching Kit - `uv run python -m pytest source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py -q` — 83 passed - Regression negative checks reproduced `StopIteration` for the old scoped selection and `NotImplementedError: Shape type 10 not supported` for the old MPM conversion test - `uv run isaaclab -f` ## Screenshots Runtime screenshots were inspected while validating the Kit and Newton visualizer combinations in the backend-selection PR. The user-facing demo screenshots and documentation landed in #6682. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] Corresponding documentation landed in #6682 - [x] My changes generate no new warnings - [x] I have added tests that prove the fixes are effective - [x] I have added changelog fragments for every touched package - [ ] I have added my name to `CONTRIBUTORS.md` or my name already exists there
## Description Documents the supported physics, renderer, and visualizer options alongside each standalone demo shown on the showroom page, and updates the corresponding demo and tutorial scripts so those selections are exposed consistently. The script changes: - add `newton_mjwarp` support where the existing scene configuration is compatible, including the multi-asset and multi-mesh raycaster demos; - allow supported external visualizers instead of unnecessarily restricting scripts to Kit; - make the Newton MPM demos safe to launch headlessly; - align selector names with the preset APIs by using `newton_mjwarp` for Newton MJWarp physics and `newton_renderer` for the Newton renderer; - update the deformable tutorial for its Newton VBD variant; - fix the heterogeneous-scene launcher arguments and task identifier; - fix the Franka arms asset URL and remote PPISP scene localization. The standalone smoke-test framework, focused regression tests, and Newton core compatibility changes were split into dependent draft PR isaac-sim#6704. ## Type of change - [x] New feature - [x] Bug fix - [x] Breaking change - [x] Documentation update ## Testing - Full Sphinx documentation build succeeded without warnings. - Modified demo and tutorial scripts passed Python compilation. - All-file pre-commit hooks passed. - The supported backend and visualizer combinations were exercised during development; the reusable test matrix and core regression coverage are in isaac-sim#6704. - Graphical outputs were captured and visually inspected for the available Kit and Newton visualizers. ## Checklist - [x] I have read and understood the contribution guidelines. - [x] I have run the formatter and all pre-commit checks. - [x] I have updated the documentation and changelog fragments. - [x] I have verified every showcased demo lists options synchronized with its executable script. - [x] Corresponding automated tests are included in dependent PR isaac-sim#6704. - [ ] I have added my name to `CONTRIBUTORS.md` or my name already exists there.
# Description Adds a parameterized smoke-test framework for standalone demo and tutorial scripts across their declared physics, renderer, and visualizer combinations. The matrix validates CLI declarations, launches supported combinations with bounded timeouts, checks readiness and fatal output, and captures visualizer screenshots when requested. A dedicated `standalone demos (headless)` GPU CI job now runs every demo with the `none` visualizer across all declared physics and renderer combinations. GUI visualizer slices remain available for local validation with a display server. The expanded coverage exposed three Newton compatibility issues, fixed here: - PhysX-backed standalone and marker-only scenes can build a shadow Newton model for external visualizers without requiring `/World/envs/env_<id>`. - Newton implicit MPM accepts imported convex-mesh rigid colliders through its triangle-mesh geometry path. - Newton rigid-object collections match configured prim paths exactly instead of selecting unrelated sibling assets. Review follow-ups also: - made the MPM particle-pour asset path genuinely kitless by relying on the standard `UsdFileCfg` asset localization path; - made scoped smoke runs independent of unrelated raycaster cases; and - strengthened the MPM regression to finalize the CUDA model and construct `SolverImplicitMPM`. ## Type of change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking test and CI infrastructure) ## Validation - `uv run python -m pytest source/isaaclab/test/app/test_standalone_scripts.py -q` — 27 passed, 280 skipped launch cases - CI-scoped MPM launch matrix (`demos/mpm`, visualizer `none`) — 2 passed - `uv run python scripts/demos/mpm/particle_pour.py --device cuda:0 --visualizer none --max-steps 2` — passed without launching Kit - `uv run python -m pytest source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py -q` — 83 passed - Regression negative checks reproduced `StopIteration` for the old scoped selection and `NotImplementedError: Shape type 10 not supported` for the old MPM conversion test - `uv run isaaclab -f` ## Screenshots Runtime screenshots were inspected while validating the Kit and Newton visualizer combinations in the backend-selection PR. The user-facing demo screenshots and documentation landed in isaac-sim#6682. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks - [x] Corresponding documentation landed in isaac-sim#6682 - [x] My changes generate no new warnings - [x] I have added tests that prove the fixes are effective - [x] I have added changelog fragments for every touched package - [ ] I have added my name to `CONTRIBUTORS.md` or my name already exists there
Description
Documents the supported physics, renderer, and visualizer options alongside
each standalone demo shown on the showroom page, and updates the corresponding
demo and tutorial scripts so those selections are exposed consistently.
The script changes:
newton_mjwarpsupport where the existing scene configuration iscompatible, including the multi-asset and multi-mesh raycaster demos;
scripts to Kit;
newton_mjwarpforNewton MJWarp physics and
newton_rendererfor the Newton renderer;The standalone smoke-test framework, focused regression tests, and Newton core
compatibility changes were split into dependent draft PR #6704.
Type of change
Testing
development; the reusable test matrix and core regression coverage are in
Add standalone script backend test infrastructure #6704.
and Newton visualizers.
Checklist
executable script.
CONTRIBUTORS.mdor my name already existsthere.