Repository navigation
Fixes drone navigation, camera benchmark, and kitless shutdown errors… - #5900
Conversation
…isaac-sim#5882) # Description Environment shutdown fix (isaaclab/envs/) All three env classes (DirectRLEnv, DirectMARLEnv, ManagerBasedEnv) had a race condition in __del__: the lazy import sys inside the destructor could fail or produce a spurious traceback once Python's import machinery had already finalized at interpreter shutdown. The fix captures sys.is_finalizing as a default argument at class definition time (before finalization), so the check always works safely. Drone ARL navigation default env count (isaaclab_tasks/) Reduced the default num_envs for Isaac-Navigation-3DObstacles-ARL-Robot-1-v0 from 4096/8192 to 1024 in both the env config and the rl_games PPO config. Users can override with --num_envs or env.scene.num_envs. Camera benchmark fix (scripts/benchmarks/benchmark_cameras.py) Moved prim creation and prim_path assignment to after the camera config object is built, so class_type is resolved from the instantiated config rather than the unresolved camera_cfg callable. Also uses the config's class_type (not the original camera_cfg.class_type) when calling the constructor, fixing a subtle bug when the config overrides the class. ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task -->
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR cherry-picks three independent bug fixes to the release/3.0.0-beta2 branch: (1) a race condition fix in environment destructors during Python interpreter shutdown, (2) a reduction of the default num_envs for the drone ARL navigation task from 4096/8192 to 1024, and (3) a camera benchmark script fix that resolves class_type from the instantiated config rather than the unresolved callable.
Update (6c78a50): The PR scope has expanded significantly beyond the original three cherry-picks. The new commit adds:
- Documentation infrastructure overhaul: New Sphinx extension (
docs/_extensions/isaaclab_docs.py) that provides custom directives (isaaclab-clone-commands,isaaclab-clone-https,isaaclab-kitless-install-snippet,isaaclab-quickstart-install) to DRY up clone/install commands across docs and pin them to the release branch viaisaaclab_latest_branchconfig. - Auto-generated environment table: New tooling (
tools/environ_docs.py,tools/update_environments_rst.py) that regenerates the comprehensive environment list inenvironments.rstfrom the Gym registry. Includes proper test coverage (tools/test/test_environ_docs.py). - Branch reference migration: All docs updated from
develop/mainreferences torelease/3.0.0-beta2— links, installation instructions, Newton backend docs, etc. - MJCF Converter fix: Enables the
isaacsim.asset.importer.mjcfextension automatically before importing, preventing failures when the extension is not pre-loaded. - README updates: Added compatibility warning, updated documentation links to point at
release/3.0.0-beta2, version table updates. - Installation docs restructure: Consolidated selective install documentation into
include/selective_install.rst, simplified pip installation page, removed deprecated warnings about Isaac Sim develop branch compatibility. - CONTRIBUTORS.md: Added Yize Wang.
- Minor fixes: Quadcopter demo uses
robot.data.body_mass.torchinstead of deprecatedroot_view.get_masses(), H1 locomotion demo callshandle_deprecated_rsl_rl_cfg, asset converter docs add--viz kitflag. - Wheel builder: Comment clarification in
python_packages.toml.
Design Assessment
Sphinx Extension (isaaclab_docs.py) — Well-structured extension that eliminates branch-name duplication across documentation. The directives are minimal, composable, and properly registered with Sphinx's parallel read/write safety. The isaaclab_latest_branch config value provides a single source of truth. Good use of nested_parse for generating RST from within directives.
Environment Docs Automation (environ_docs.py) — Solid design with clear separation between data collection, formatting, and RST patching. The PresetTarget-based categorization correctly separates physics/renderer/domain presets. The filtering of physics-backend mirror names from domain presets is a thoughtful detail that prevents confusing duplication in the docs. Test coverage is comprehensive.
MJCF Converter Fix — Clean fix with proper test. Using set_extension_enabled_immediate is the correct approach for enabling extensions at runtime. The test properly validates the behavior by checking extension state before/after converter construction.
Branch Migration — Systematic and consistent. All hardcoded develop/main branch references in docs are updated to release/3.0.0-beta2.
Findings
🟡 Minor Issues
-
docs/source/setup/installation/include/selective_install.rstusescoretoken but the source install page (src_build_isaaclab.rst) references:ref:\installation-selective-install`for details. Thecorevsnonenaming was previously inconsistent — this commit usescore` consistently, which is an improvement. -
environ_docs.py—_infer_implicit_physics_namesimports at function level: This importsPhysxCfg,PhysicsCfg, and task utilities inside the function body. While this avoids circular imports, it means every call tocollect_environment_doc_rowspays repeated import overhead. Acceptable for a docs-generation tool that runs infrequently. -
docs/source/overview/environments.rst— Very large auto-generated section: The generated table is ~800+ lines. The marker-based approach (START-AUTO-GENERATED/END-AUTO-GENERATED) is clean, but reviewers should be aware that diffs touching this file will be noisy in future PRs that add environments. -
Removed DGX Spark JAX limitation note (
docs/source/setup/installation/index.rst): The previous note stated JAX GPU was unavailable on aarch64. The new JAX docs section inrl_existing_scripts.rstnow shows CUDA 13 wheel support for aarch64 — this is a genuine improvement that reflects JAX's expanded platform support. -
tools/update_environments_rst.pyhas experimental import: Thewith contextlib.suppress(ImportError): import isaaclab_tasks_experimentalpattern is forward-looking but the comment says "PLACEHOLDER: Extension template (do not remove this comment)" — this seems like scaffolding that should be documented or removed before merging to a release branch.
🟢 No Issues
-
Original three fixes remain intact — The shutdown fix, drone num_envs reduction, and camera benchmark fix from the previous review are unchanged.
-
Test coverage —
test_environ_docs.pyprovides good unit test coverage for the documentation generation helpers.test_mjcf_converter.pyproperly tests the auto-enable behavior. -
Copy button CSS — Making
sphinx-copybuttonalways visible (opacity: 1) is a UX improvement for code blocks in docs.
Test Coverage
The new changes include:
tools/test/test_environ_docs.py— 12 test functions covering the environment docs generation pipelinesource/isaaclab/test/sim/test_mjcf_converter.py— New test for extension auto-enabling
Verdict
No blocking issues — The PR has grown substantially from a simple cherry-pick to include significant documentation infrastructure improvements. All changes are well-structured and properly tested. The documentation overhaul is a valuable improvement for the release branch, ensuring installation instructions and environment listings stay in sync with the codebase. Safe to merge.
Greptile SummaryThis PR bundles three bug fixes: a race-condition in
Confidence Score: 4/5Safe to merge — all three fixes address real, reproducible defects and the changes are narrow in scope. The env destructor pattern is a well-established CPython idiom and works correctly. The drone nav default change is a simple integer override with no downstream logic impact. The camera benchmark fix correctly moves the validity guard before side-effecting prim creation and resolves the class_type lookup from the instantiated config. The only lingering gap is that create_ray_caster_cameras still creates prims before its own validity guard, and the _get_camera_class_name dictionary access raises KeyError rather than AttributeError for a missing field. Both are minor benchmark-script-only issues that don't affect production training paths. scripts/benchmarks/benchmark_cameras.py warrants a second look for the two style inconsistencies noted; all other changed files look straightforward. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["create_camera_base(camera_cfg, num_cams, ...)"] --> B{num_cams<=0 or\ndata_types empty or\nheight/width<=0?}
B -- Yes --> C[return None]
B -- No --> D["_get_camera_class_name(camera_cfg)\n→ reads __dataclass_fields__"]
D --> E["cfg = camera_cfg(prim_path, height, width, ...)"]
E --> F{instantiate?}
F -- Yes --> G["create_prim x num_cams\n/World/{name}_{idx:02d}"]
G --> H["return cfg.class_type(cfg=cfg)\n← uses instance class_type"]
F -- No --> I["return cfg\n(config only, no prims)"]
subgraph Env Shutdown Fix
J["class DirectRLEnv:\n def __del__(self,\n _sys_is_finalizing=sys.is_finalizing):"]
J --> K["if not _sys_is_finalizing(): self.close()"]
end
|
| class_type_field = camera_cfg.__dataclass_fields__["class_type"] | ||
| if class_type_field.default is not MISSING: |
There was a problem hiding this comment.
Accessing
__dataclass_fields__["class_type"] with a plain dict lookup raises KeyError (not AttributeError) if the field is absent, which breaks the except AttributeError contract implied by the raise on the last line and may confuse callers. Using .get() with an explicit check gives a cleaner error path.
| class_type_field = camera_cfg.__dataclass_fields__["class_type"] | |
| if class_type_field.default is not MISSING: | |
| class_type_field = camera_cfg.__dataclass_fields__.get("class_type") | |
| if class_type_field is None: | |
| raise AttributeError(f"{camera_cfg.__name__} has no 'class_type' dataclass field.") | |
| if class_type_field.default is not MISSING: |
|
Re-review Update (6c78a50): Reviewed 3 new commits since my last review. Previous concern status:
New changes reviewed:
No new issues found in the incremental changes. The existing inline comment on |
… (#5882)
Description
Environment shutdown fix (isaaclab/envs/) All three env classes (DirectRLEnv, DirectMARLEnv, ManagerBasedEnv) had a race condition in del: the lazy import sys inside the destructor could fail or produce a spurious traceback once Python's import machinery had already finalized at interpreter shutdown. The fix captures sys.is_finalizing as a default argument at class definition time (before finalization), so the check always works safely.
Drone ARL navigation default env count (isaaclab_tasks/) Reduced the default num_envs for Isaac-Navigation-3DObstacles-ARL-Robot-1-v0 from 4096/8192 to 1024 in both the env config and the rl_games PPO config. Users can override with --num_envs or env.scene.num_envs.
Camera benchmark fix (scripts/benchmarks/benchmark_cameras.py) Moved prim creation and prim_path assignment to after the camera config object is built, so class_type is resolved from the instantiated config rather than the unresolved camera_cfg callable. Also uses the config's class_type (not the original camera_cfg.class_type) when calling the constructor, fixing a subtle bug when the config overrides the class.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists thereDescription
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there