Repository navigation
Fix --visualizer newton (deprecated alias) always raising RuntimeError - #7960
Conversation
_resolve_visualizer_cfgs raised the same generic "could not be configured" message whether a CLI-explicit visualizer type was unknown, its isaaclab_visualizers package wasn't installed, a backend's own third-party dependency was missing, or its import/construction failed for another reason. Diagnosing a failure required scrolling up through logs instead of reading the raised exception. Thread a per-type reason through _create_default_visualizer_configs (now returning tuple[list, dict[str, str]]) and surface it directly in the raised RuntimeError. The missing-package classification uses ModuleNotFoundError.name -- set by the import system to the exact module that could not be found -- rather than matching text in the exception message, so an installed-but-broken visualizer package (e.g. a partially-initialized or circularly-imported module) is not misreported as simply not installed. Also fixes two issues found while implementing this: - --visualizer newton (the deprecated alias for newton_gl) always raised this RuntimeError even though it resolved successfully, because the raw CLI string was compared against the resolved config's canonical visualizer_type. Every such comparison in _resolve_visualizer_cfgs now goes through the alias mapping. - The "failed to import"/"failed to construct" reasons had dropped the install hint that the prior unconditional message always included; it is now appended to every reason. Addresses the narrowed scope of isaac-sim#7403 after the originally reported crash (script-default visualizers on --headless/HEADLESS=1) was found not to reproduce on a healthy install.
|
run-ci |
There was a problem hiding this comment.
Isaac Lab Review Bot
The per-type failure-reason flow and deprecated-alias canonicalization are consistent, but the missing-module classifier can report that the entire optional package is absent when only a backend submodule is missing.
- Design and architecture: Keeping failure classification beside backend import and surfacing the recorded reason at the existing RuntimeError site is appropriately scoped. Raw CLI names and canonical aliases remain correctly separated during resolution.
- API: The private helper’s tuple return contract is documented and both in-repository callers are updated. Observable behavior is limited to richer RuntimeError text and correct handling of the deprecated
newtonalias, but one error classification needs more precise wording. - Implementation: The branch accepting any
ModuleNotFoundError.namebeginning withisaaclab_visualizers.incorrectly concludes that the wholeisaaclab_visualizerspackage is not installed. Only an exact missing name ofisaaclab_visualizersproves that; a missing descendant such asisaaclab_visualizers.rerunshould be reported by its own module name through the neighboring missing-dependency path.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| # happen to contain "isaaclab_visualizers") for a module that is simply missing. | ||
| missing_module = exc.name if isinstance(exc, ModuleNotFoundError) else None | ||
| if missing_module is not None and ( | ||
| missing_module == "isaaclab_visualizers" or missing_module.startswith("isaaclab_visualizers.") |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — Submodule miss reported as package not installed
When isaaclab_visualizers is importable but the requested backend submodule is absent, the import system sets ModuleNotFoundError.name to isaaclab_visualizers.rerun, and this prefix branch reports "the 'isaaclab_visualizers' package is not installed" — the exact misclassification this change sets out to remove. Only missing_module == "isaaclab_visualizers" proves the distribution is absent; report a missing descendant module by its own name via the neighbouring branch.
|
| if missing_module is not None and ( | ||
| missing_module == "isaaclab_visualizers" or missing_module.startswith("isaaclab_visualizers.") | ||
| ): | ||
| # isaaclab_visualizers is optional; log once at warning level | ||
| logger.warning( | ||
| "[SimulationContext] Visualizer '%s' skipped: isaaclab_visualizers is not installed. %s", | ||
| viz_type, | ||
| _get_visualizer_install_hint(viz_type), | ||
| hint, | ||
| ) | ||
| failure_reasons[requested_type] = f"the 'isaaclab_visualizers' package is not installed. {hint}" |
There was a problem hiding this comment.
Missing submodules misreported as uninstalled
If an installed isaaclab_visualizers.rerun cannot import its internal rerun_visualizer_cfg module, this prefix check reports that the entire package is not installed and discards the missing module’s name. This leaves the diagnostic distinction incomplete and can send users toward the wrong remedy. Reserve the package-not-installed message for the root package and preserve the exact missing submodule in other cases.
| def test_explicit_deprecated_alias_alone_does_not_raise(): | ||
| """Requesting only the deprecated 'newton' alias resolves successfully and does not raise, | ||
| even though the resolved cfg carries the canonical 'newton_gl' type.""" | ||
| settings = { | ||
| "/isaaclab/visualizer/types": "newton", | ||
| "/isaaclab/visualizer/explicit": True, | ||
| "/isaaclab/visualizer/disable_all": False, | ||
| "/isaaclab/visualizer/max_visible_envs": None, | ||
| } | ||
| ctx = _make_context_with_settings(settings) |
There was a problem hiding this comment.
Existing-config merge path lacks coverage
The new regression tests all leave visualizer_cfgs empty, so they do not exercise the separately rewritten branch that filters existing configs and merges additional defaults and failure reasons. Add cases with a customized existing newton_gl config selected through newton, and with an existing config plus an additional failing requested type. Assert that the original customized config is retained and that the additional failure reaches the RuntimeError; otherwise regressions in these changed comparisons and extra_failures propagation can pass the new suite.
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!
The "package is not installed" reason matched any ModuleNotFoundError.name that started with "isaaclab_visualizers.", which misreported a missing backend submodule (e.g. isaaclab_visualizers.rerun failing to import its own internals) as the entire isaaclab_visualizers distribution being absent. Only an exact "isaaclab_visualizers" name proves the distribution itself is missing; route everything else, including a missing descendant module, through the existing "required package '<name>'" reason so it is reported by its own name. Also adds regression coverage for the branch that merges CLI-explicit selection with pre-existing cfg.visualizer_cfgs entries, which the prior tests never exercised (they all left visualizer_cfgs empty): a customized pre-existing config selected through its deprecated alias is returned as-is, and a pre-existing config alongside an additional unresolvable requested type still raises for the failure without losing the satisfied one. Found by review on the previous commit.
Shortened several multi-line explanatory comments in simulation_context.py and the test file down to one or two lines each, keeping the "why" but cutting the exposition. Reverted uv.lock to develop's content -- its per-package version bumps are a mechanical side effect of adding the changelog fragment, not a hand-authored change, so they don't need to be part of this diff. Note this will re-dirty locally the next time any uv command runs in this working tree, since package versions here are derived from changelog.d fragment state rather than a static version field; that's expected and not meant to be re-committed.
|
run-ci |
Reviewer feedback: distinguishing "unknown type" from "package not installed" from "package installed but broken" for an explicitly requested visualizer is more machinery than the problem needs -- a missing/broken Python module is already obvious to anyone running --visualizer from a CLI, and the install path is already documented. The classification also needed two follow-up fixes to get right (the substring-match misclassification, then the submodule-vs-whole- package misclassification), which is itself a sign it was solving a narrower problem with more mechanism than it's worth. Reverts _create_default_visualizer_configs and the RuntimeError message in _resolve_visualizer_cfgs to their original generic text. Keeps the one fix that isn't about message wording: --visualizer newton (the deprecated alias for newton_gl) always raised this RuntimeError even though it resolved successfully, because the raw CLI string was compared against the resolved config's canonical visualizer_type. That comparison still goes through the alias mapping. Also keeps the regression tests for the alias fix, including coverage of the branch that merges CLI selection with pre-existing cfg.visualizer_cfgs entries.
|
run-ci |
|
Backported to |
#7960) ## Description Part of #7403 `_resolve_visualizer_cfgs` compared the raw, possibly-deprecated-alias CLI string (e.g. `"newton"`) against each resolved config's canonical `visualizer_type` (e.g. `"newton_gl"`). Requesting `--visualizer newton` succeeded in creating a `NewtonGLVisualizerCfg`, but the alias itself was never present in the set of canonical resolved types, so it was reported as missing and `RuntimeError: Explicitly requested visualizer(s) ['newton'] could not be configured` fired anyway — even though the visualizer resolved and worked fine. Every CLI-requested-vs-resolved comparison in `_resolve_visualizer_cfgs` now routes through the existing `_VISUALIZER_ALIASES` mapping. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective - [x] I have added a changelog fragment under `source/isaaclab/changelog.d/` ## Test plan - `uv run --extra test --extra rerun --extra viser pytest source/isaaclab/test/sim/test_simulation_context_visualizers.py -q` — 45 passed, including new coverage for the deprecated-alias-alone case and the branch that merges CLI selection with pre-existing `cfg.visualizer_cfgs` entries (a customized existing config selected via its alias is returned as-is; an existing config alongside an additional unresolvable type still raises for just the failure) - `uv run --extra test --extra rerun --extra viser pytest source/isaaclab/test/visualizers/test_visualizer.py source/isaaclab/test/app/test_app_launcher_argv.py -q` — 35 passed - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` (cherry picked from commit 53a7f1c)
…ng docs (#7957) Backports the three changes from the September 20–23 `develop` audit that are missing from `release/3.0.0`, alongside the existing cloning-guide backport: - #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction instead of silently discarding its configuration. Includes the original fixture cleanup and regression coverage. - #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating its live configuration. - #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation version in deployment and local multi-version builds. - #7129 (`354168560f`): clarify that `replicate_physics=False` skips the active physics context while other declared replication contexts still run. **Compatibility:** repeated `SimulationContext(...)` calls now raise. Retrieve the live context with `SimulationContext.instance()`, or call `clear_instance()` before constructing a replacement. The original major changelog fragment includes this migration. The runtime and test files match current `develop`. The docs-default backport adapts the release branch's existing redirect template, validates the target page, and preserves explicit overrides. The cloning-guide backport preserves the current release APIs; its obsolete sections were already removed. ## Release audit Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18 UTC** through `cff81e8473` (September 23), against release head `5d3e0b695e`. **32 are already covered; the remaining three are included here.** Git history, patch equivalence, GitHub's merged PR list, and remaining file differences were checked. Branch-specific version/changelog compilation and existing release-only changes are preserved. <details> <summary>Already covered PRs</summary> 26 have an equivalent patch in release: #7919, #7922, #7923, #7924, #7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929, #7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961, #7970, #7958. Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in #7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation differences were checked against the current release tree. </details> ## Validation - **276 tests passed**: SimulationContext (51, including CPU/CUDA), headless context construction (15), nine schema/fragment suites (165), four manager suites (38), and DelayBuffer (7). - Both backported regressions reproduce with the original release implementations. - Docs redirect recipe: local/deployment EA defaults, explicit override, and missing-target rejection passed with a stubbed Sphinx builder. - All 22 changed files match the intended backport scope; `uv run isaaclab -f` and `git diff --check` passed. - Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without warnings, excluding static assets as the HTML builder does. Full HTML documentation CI is running. Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim 6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings occurred; the CI jobs validate the pinned environments. The previous [docs CI failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281) was an external connection reset fetching the Omniverse intersphinx inventory, producing one warning under `-W`. That URL returned HTTP 200 when rechecked. This update starts a fresh docs build. --------- Co-authored-by: hujc <[email protected]> Co-authored-by: Zihan Xu <[email protected]>
Description
Part of #7403
_resolve_visualizer_cfgscompared the raw, possibly-deprecated-alias CLI string (e.g."newton") against each resolved config's canonicalvisualizer_type(e.g."newton_gl"). Requesting--visualizer newtonsucceeded in creating aNewtonGLVisualizerCfg, but the alias itself was never present in the set of canonical resolved types, so it was reported as missing andRuntimeError: Explicitly requested visualizer(s) ['newton'] could not be configuredfired anyway — even though the visualizer resolved and worked fine.Every CLI-requested-vs-resolved comparison in
_resolve_visualizer_cfgsnow routes through the existing_VISUALIZER_ALIASESmapping.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/isaaclab/changelog.d/Test plan
uv run --extra test --extra rerun --extra viser pytest source/isaaclab/test/sim/test_simulation_context_visualizers.py -q— 45 passed, including new coverage for the deprecated-alias-alone case and the branch that merges CLI selection with pre-existingcfg.visualizer_cfgsentries (a customized existing config selected via its alias is returned as-is; an existing config alongside an additional unresolvable type still raises for just the failure)uv run --extra test --extra rerun --extra viser pytest source/isaaclab/test/visualizers/test_visualizer.py source/isaaclab/test/app/test_app_launcher_argv.py -q— 35 passedBackport this pull request to the active release branch after it merges into
develop