Skip to content

Add backend selection to standalone scripts - #6682

Merged
kellyguo11 merged 1 commit into
isaac-sim:developfrom
kellyguo11:kellyg/standalone-script-smoke-tests
Jul 24, 2026
Merged

kellyguo11 merged 1 commit into
isaac-sim:developfrom
kellyguo11:kellyg/standalone-script-smoke-tests

Conversation

@kellyguo11

@kellyguo11 kellyguo11 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

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 #6704.

Type of change

  • New feature
  • Bug fix
  • Breaking change
  • 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
    Add standalone script backend test infrastructure #6704.
  • Graphical outputs were captured and visually inspected for the available Kit
    and Newton visualizers.

Checklist

  • I have read and understood the contribution guidelines.
  • I have run the formatter and all pre-commit checks.
  • I have updated the documentation and changelog fragments.
  • I have verified every showcased demo lists options synchronized with its
    executable script.
  • Corresponding automated tests are included in dependent PR Add standalone script backend test infrastructure #6704.
  • I have added my name to CONTRIBUTORS.md or my name already exists
    there.

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-sim Related to Isaac Sim team isaac-lab Related to Isaac Lab team labels Jul 23, 2026
@kellyguo11
kellyguo11 marked this pull request as ready for review July 23, 2026 04:49
@kellyguo11
kellyguo11 requested a review from a team July 23, 2026 04:49
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • New smoke harness (standalone_script_cases.py, test_standalone_scripts.py): AST-based discovery extracts literal argparse choices, expands a Cartesian product of backends and visualizers, and supervises each script with output-bounded fatal-pattern tracking, configurable soak time, and optional screenshot capture. A showroom synchronization test enforces that the RST backend-support table stays aligned with discovered scripts.
  • Newton standalone-scene support (newton_manager.py, visualization_builder.py): _ensure_visualization_model now handles scenes without /World/envs by passing empty env_paths and treating them as a single visualization world; build_visualization_builder_from_stage_envs adds a clone_plan is None fast-path that calls add_usd on the full stage.
  • Bug fixes: Newton batched rigid-object pattern matching now retains common prefix/suffix instead of wildcarding an entire segment (with a count validation guard), MPM demos add null-guards for args_cli.visualizer, the OVRTX camera demo switches from index-based to prim-discovery env iteration, selector names are aligned to newton_mjwarp/newton_renderer/newton_vbd, and the Franka arms asset URL is updated.

Confidence Score: 4/5

Safe 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

Filename Overview
source/isaaclab/test/app/standalone_script_cases.py New discovery/supervision harness: well-structured AST-based spec discovery, subprocess supervisor with output-bounded fatal-pattern tracking, and ImageMagick screenshot capture. One edge case: _capture_screenshot exceptions are not caught in the main loop and propagate as RuntimeError.
source/isaaclab/test/app/test_standalone_scripts.py Comprehensive unit tests for the smoke harness, including showroom synchronization check. The regex for the last table row bleeds into the 'Visualizer selection is independent...' paragraph, making the last entry's backend assertions potentially permissive.
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Extends _ensure_visualization_model to handle standalone scenes (no /World/envs). Correctly falls back to num_envs=1 and calls build_visualization_builder_from_stage_envs with empty env_paths. ERROR to INFO downgrade for empty builder loses visibility for misconfigured cloned scenes.
source/isaaclab_newton/isaaclab_newton/assets/rigid_object_collection/rigid_object_collection.py Adds count_per_world validation and smarter prefix/suffix-aware pattern generation in _build_combined_pattern. The count check provides a reliable safety net for over-broad patterns. Logic is correct.
source/isaaclab_newton/isaaclab_newton/physics/visualization_builder.py Adds a standalone (no clone plan / empty env_paths) fast-path that calls builder.add_usd directly on the full stage. Clean, well-documented change.
scripts/demos/sensors/ppisp_camera_ovrtx.py Switches scene localization from index-based env iteration to prim-discovery via find_matching_prims; resolves the input_scene path via retrieve_file_path before opening the USD stage. Removes deprecated --disable_ovrtx_cloning flag.
source/isaaclab_newton/test/assets/test_rigid_object_collection.py Adds test_initialization_ignores_unrelated_sibling_rigid_objects and spawn_unrelated_sibling fixture parameter to verify the new pattern-matching fix.
source/isaaclab/test/sim/test_newton_manager_visualization_state.py Adds sentinel _DEFAULT to allow passing clone_plan=None in tests, adds _make_standalone_stage helper, and adds test for single-world standalone scene. Sentinel pattern is correct.
scripts/demos/markers.py Removes the ineffective choices=['kit'] restriction (add_launcher_args would have overridden it via conflict_handler='resolve') and the accompanying comment. Now uses set_defaults for the default visualizer only.
scripts/demos/mpm/newton_mpm_granular.py Adds defensive (args_cli.visualizer or []) null-checks for visualizer membership tests and adds UsdPhysicsRigidBodyMaterialCfg to the ground plane for Kit-visualizer compatibility.

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]
Loading

Reviews (1): Last reviewed commit: "Merge branch 'develop' into kellyg/stand..." | Re-trigger Greptile

Comment on lines +349 to +356
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

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.

P2 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.

Comment on lines +82 to +95
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}"

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.

P2 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.

Comment on lines 2199 to 2203
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."
)

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.

P2 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!

@kellyguo11
kellyguo11 force-pushed the kellyg/standalone-script-smoke-tests branch from 80800ff to 7405f32 Compare July 23, 2026 05:32
Document each demo's supported backends and update the standalone scripts to select their compatible physics, renderer, and visualizer implementations.
@kellyguo11
kellyguo11 force-pushed the kellyg/standalone-script-smoke-tests branch from 330631d to 612be92 Compare July 24, 2026 03:48
@kellyguo11 kellyguo11 changed the title Add standalone script backend smoke tests Add backend selection to standalone scripts Jul 24, 2026
@kellyguo11
kellyguo11 merged commit 2d6a990 into isaac-sim:develop Jul 24, 2026
38 checks passed
kellyguo11 added a commit that referenced this pull request Jul 28, 2026
# 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
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
## 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.
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
# 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
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 isaac-sim Related to Isaac Sim team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant