Skip to content

Fixes branch name in docs - #5953

Merged
kellyguo11 merged 2 commits into
isaac-sim:developfrom
kellyguo11:clone-branch-doc-develop
Jun 4, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:developfrom
kellyguo11:clone-branch-doc-develop

Conversation

@kellyguo11

Copy link
Copy Markdown
Contributor

Description

Fixes issue in built docs where doc names in clone command didn't follow the actual version of the doc.

Previously, when develop triggered a multiversion docs deploy, even the release/3.0.0-beta2 generated pages used develop.
Now:

  • multiversion docs use smv_current_version
  • single-version/local docs fall back to isaaclab_latest_branch

Type of change

  • Documentation update

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • 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

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Jun 4, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment •

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.

Review — PR #5953: Fixes branch name in docs

Summary

The documentation extension change (docs/_extensions/isaaclab_docs.py) correctly addresses the stated goal: multiversion docs now use smv_current_version so that each versioned page shows the correct branch in clone commands, with a sensible fallback to isaaclab_latest_branch.

However, this PR appears to bundle unrelated changes alongside the docs fix:

Observations

1. docs/_extensions/isaaclab_docs.py ✅

The logic is clean — prioritize smv_current_version (set by sphinx-multiversion), fall back to isaaclab_latest_branch. The docstring update from "release branch" to "branch or tag" is accurate.

2. docs/source/features/multi_gpu.rst ⚠️ Unrelated content

A new "Troubleshooting NCCL Errors" section is added. While useful, this is unrelated to the branch-name fix described in the PR title/description.

3. source/isaaclab_rl/isaaclab_rl/rsl_rl/utils.py ⚠️ Unrelated code change

A new handle_deprecated_rsl_rl_checkpoint() function is added to convert pre-5.0 rsl-rl checkpoints to the new split actor/critic layout. This is production code unrelated to the docs fix.

Code quality note: The implementation itself looks solid — proper version gating, clear key remapping logic, sibling file output to avoid overwriting the original, and a helpful error message for unrecognized keys.

4. source/isaaclab_rl/test/test_rsl_rl_cfg_deprecation.py ⚠️ Unrelated tests

Tests for the checkpoint conversion utility above. Well-structured (covers conversion, passthrough for new layout, passthrough for old rsl-rl, and error case).

Recommendation

The PR title and description only mention the branch-name fix, but 3 of the 4 changed files are unrelated (NCCL troubleshooting docs + rsl-rl checkpoint migration utility). Consider either:

  • Updating the PR description to cover all changes, or
  • Splitting the unrelated changes into separate PRs for clearer review history

CI Status

  • ✅ pre-commit, Build Wheel, Check for Broken Links — passing
  • ❌ Check changelog fragments — failing (expected: no changelog fragment added)
  • ⏳ Several checks still pending (docs build, installation tests)

No blocking issues found in the code itself.


Update (c2aa03e)

✅ Addressed: The unrelated changes (NCCL troubleshooting docs, handle_deprecated_rsl_rl_checkpoint utility, and associated tests) have been removed from this PR. The PR now contains only the docs branch-name fix as described in the title.

No new issues found. LGTM 👍

@greptile-apps

greptile-apps Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bundles three distinct changes: the documented fix that makes multiversion Sphinx builds use smv_current_version for git clone commands (so release pages no longer show develop), a new handle_deprecated_rsl_rl_checkpoint utility that converts pre-5.0 rsl-rl checkpoints to the actor/critic split layout expected by rsl-rl ≥ 5.0, and a new NCCL troubleshooting section in the multi-GPU docs.

  • docs/_extensions/isaaclab_docs.py: _branch() now checks smv_current_version first and falls back to isaaclab_latest_branch, directly fixing the reported multiversion clone-command issue.
  • source/isaaclab_rl/isaaclab_rl/rsl_rl/utils.py: handle_deprecated_rsl_rl_checkpoint() remaps actor.*/critic.*/std keys to the new actor_state_dict/critic_state_dict split, saves a sibling _rslrl5 file, and raises ValueError for unrecognized keys.
  • docs/source/features/multi_gpu.rst: Adds an NCCL troubleshooting section documenting NCCL_SHM_DISABLE, NCCL_IB_DISABLE, and NCCL_ALGO=Ring workarounds for illegal-memory-access errors during communicator initialization.

Confidence Score: 4/5

Safe to merge; the core docs fix is straightforward and the new checkpoint converter is well-tested, with only minor hardening opportunities.

The branch-name fix in the Sphinx extension is a clean, targeted change. The checkpoint converter introduces weights_only=False unconditionally (a well-known PyTorch footgun for untrusted files) and writes the converted file without an existence check, which could cause a partial-read race under concurrent callers. Neither is blocking, but both are worth addressing before wider adoption of the utility.

source/isaaclab_rl/isaaclab_rl/rsl_rl/utils.py — the new handle_deprecated_rsl_rl_checkpoint function around the torch.load call and the output-file write.

Important Files Changed

Filename Overview
docs/_extensions/isaaclab_docs.py Adds smv_current_version priority in _branch() so multiversion builds use the correct per-version branch name instead of always returning develop.
docs/source/features/multi_gpu.rst Adds a new NCCL troubleshooting section with env-var workarounds for illegal memory access errors on multi-GPU Linux systems.
source/isaaclab_rl/isaaclab_rl/rsl_rl/utils.py Adds handle_deprecated_rsl_rl_checkpoint() to convert pre-5.0 combined model_state_dict checkpoints to the separate actor/critic layout expected by rsl-rl >= 5.0; uses weights_only=False which allows arbitrary code execution on untrusted checkpoint files.
source/isaaclab_rl/test/test_rsl_rl_cfg_deprecation.py Adds TestHandleDeprecatedRslRlCheckpoint covering conversion, passthrough for new-layout and old-rsl-rl-version, and ValueError on unrecognized keys.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[handle_deprecated_rsl_rl_checkpoint called] --> B{installed_version < 5.0?}
    B -- Yes --> C[Return checkpoint_path unchanged]
    B -- No --> D[torch.load checkpoint]
    D --> E{Is dict AND has model_state_dict AND lacks actor_state_dict?}
    E -- No --> F[Return checkpoint_path unchanged]
    E -- Yes --> G[Iterate model_state_dict keys]
    G --> H{key == 'std'?}
    H -- Yes --> I[actor_state_dict: distribution.std_param]
    H -- No --> J{key starts with 'actor.'?}
    J -- Yes --> K[actor_state_dict: mlp.X]
    J -- No --> L{key starts with 'critic.'?}
    L -- Yes --> M[critic_state_dict: mlp.X]
    L -- No --> N[raise ValueError]
    I & K & M --> O[Build converted dict]
    O --> P[torch.save to _rslrl5 path]
    P --> Q[Return converted_path]
Loading

Reviews (1): Last reviewed commit: "Fixes branch name in docs" | Re-trigger Greptile

if version.parse(str(installed_version)) < _V5_0_0:
return checkpoint_path

loaded = torch.load(checkpoint_path, weights_only=False, map_location="cpu")

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 Using weights_only=False allows arbitrary Python code to execute during unpickling if the checkpoint file is malicious or tampered with. For legacy checkpoints that only contain tensors and built-in Python types (dicts, lists, ints), PyTorch's weights_only=True can still load them safely in recent versions. Falling back to weights_only=False only when the first attempt fails would prevent silent arbitrary-code-execution on any checkpoint path accepted from user input.

Suggested change
loaded = torch.load(checkpoint_path, weights_only=False, map_location="cpu")
try:
loaded = torch.load(checkpoint_path, weights_only=True, map_location="cpu")
except Exception:
loaded = torch.load(checkpoint_path, weights_only=False, map_location="cpu")

Comment on lines +259 to +262
root, ext = os.path.splitext(checkpoint_path)
converted_path = f"{root}_rslrl5{ext}"
torch.save(converted, converted_path)
print(f"[INFO]: Converted deprecated rsl-rl checkpoint to '{converted_path}'.")

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 No idempotency guard on the output file

The function unconditionally overwrites converted_path every time it is called. While the conversion is deterministic so overwriting is safe for a single process, if two workers simultaneously convert the same checkpoint one may read a partially-written file from the other. A lightweight guard — checking whether converted_path already exists before calling torch.save — would make the function safe under concurrent usage (e.g., multi-process data loaders or parallel eval runs).

@kellyguo11
kellyguo11 merged commit 480783a into isaac-sim:develop Jun 4, 2026
37 checks passed
kellyguo11 added a commit that referenced this pull request Jun 4, 2026
# Description

Fixes issue in built docs where doc names in clone command didn't follow
the actual version of the doc.

Previously, when develop triggered a multiversion docs deploy, even the
release/3.0.0-beta2 generated pages used develop.
Now:

- multiversion docs use smv_current_version
- single-version/local docs fall back to isaaclab_latest_branch

## Type of change

- Documentation update

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

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

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)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## 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)
- New feature (non-breaking change which adds functionality)
- Breaking change (existing functionality will not work without user
modification)
- Documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [ ] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] I have made corresponding changes to the documentation
- [ ] 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
-->
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant