Skip to content

[Backport] PR #7646 to release/3.0.0 - #7720

Merged
kellyguo11 merged 1 commit into
release/3.0.0from
backport/release/3.0.0/pr-7646
Sep 10, 2026
Merged

kellyguo11 merged 1 commit into
release/3.0.0from
backport/release/3.0.0/pr-7646

Conversation

@isaaclab-bot

@isaaclab-bot isaaclab-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Backports #7646 to release/3.0.0.

The original cherry-pick conflicted. An NVIDIA inference model proposed this resolution, and deterministic validation confirmed that it changes no paths outside the original PR. Because conflict resolution cannot be certified as an exact patch replay, this PR is intentionally a draft and requires release-maintainer review.

Field Commit
Original merged change f023d8c5e386c1b05a233e437ad524633c16d1de
Release base used 130c7f1e16220cf200896b3cda031790e446fcde
Proposed backport bfecc63d0c29f410d1b78caf60f8c3159a002656

`isaaclab/utils/__init__.py` attaches its exports lazily from
`__init__.pyi`. One of those exports,
`configclass`, has the same name as the sub-module that defines it,
`isaaclab.utils.configclass`.
Whenever that sub-module is imported, the import machinery binds the
module object onto
`isaaclab.utils`, which shadows the lazily attached decorator. From that
point on:

```python
from isaaclab.utils import configclass  # -> <module 'isaaclab.utils.configclass'>

@configclass
class MyCfg:
    value: int = 1
```

Which object the name resolves to depends only on which of the two was
imported first, so downstream
code breaks without ever importing the sub-module itself. Importing
`isaaclab_rl`, `isaaclab_newton`,
`isaaclab_contrib` or `isaaclab_teleop` is enough, since they all use
`from isaaclab.utils.configclass import configclass` internally:

```python
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg
from isaaclab.utils import configclass  # now a module

@configclass
class MyAgentCfg:  # TypeError: 'module' object is not callable
    ...
```

`configclass` is a documented export of `isaaclab.utils` —
`docs/source/api/lab/isaaclab.utils.rst`
lists it under the module's *Functions* rubric — and this is the import
form Isaac Lab 1.x/2.x code
uses, so downstream projects hit this while porting to 3.0 and have to
rewrite every `configclass`
import. `lazy_loader` guards against this collision, but only when the
attribute happens to be
resolved before the sub-module is imported, so the mitigation is
order-dependent.

The mirror image is broken today too: resolving the decorator first
makes `lazy_loader` write it
into the package `__dict__`, after which the sub-module is unreachable
as an attribute of
`isaaclab.utils` — `import isaaclab.utils.configclass as m` binds the
function, and
`isaaclab.utils.configclass._field_module_dir` raises `AttributeError`.
One attribute slot cannot
hold two objects, so whichever import runs first wins and the other form
breaks.

This PR makes them one object. `isaaclab.utils.configclass` gets a
`ModuleType` subclass that
forwards `__call__` to the decorator, and `isaaclab.utils.__getattr__`
always hands out that
sub-module rather than letting `lazy_loader` cache the bare function.
The attribute is then the same
object regardless of import order, and it is both a module and callable,
so the decorator, aliased
imports, dotted attribute access, `from isaaclab.utils.configclass
import ...`,
`importlib.import_module`, `mock.patch` and `string_to_callable` all
work in either order. Nothing
that works on `develop` stops working, so no migration is required.

`configclass` is currently the only name in the repository where a
`.pyi` stub export collides with a
sibling sub-module of the same name, so nothing else changes behaviour.

Fixes # (issue)

- Bug fix (non-breaking change which fixes an issue)

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

- [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
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

---------

Signed-off-by: Kelly Guo <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Kelly Guo <[email protected]>

(cherry picked from commit f023d8c)
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-mimic Related to Isaac Mimic team infrastructure labels Sep 10, 2026
@kellyguo11
kellyguo11 marked this pull request as ready for review September 10, 2026 03:30
@kellyguo11
kellyguo11 requested a review from a team September 10, 2026 03:30
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (535 files, 100 file limit).

@kellyguo11

Copy link
Copy Markdown
Contributor

run-ci

@isaaclab-bot isaaclab-bot Bot added the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Sep 10, 2026
@isaaclab-bot isaaclab-bot Bot removed the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Sep 10, 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.

Isaac Lab Review Bot

The backport consistently routes configclass imports through isaaclab.utils and resolves the module-versus-decorator shadowing by making the submodule callable. One API compatibility gap remains: the callable-module shim does not preserve the decorator function's keyword-argument contract.

  • Design and architecture: Using a callable isaaclab.utils.configclass module provides import-order-independent behavior while retaining access to submodule members. However, the module wrapper must fully delegate the existing callable interface rather than expose a narrower call signature.
  • API: The underlying public function accepts configclass(cls, **kwargs) and forwards options to dataclass, but _CallableModule.__call__ accepts only cls. Consequently, the newly recommended from isaaclab.utils import configclass path rejects valid calls such as configclass(MyCfg, kw_only=True). Forward *args and **kwargs to the underlying function.
  • Implementation: The fresh-interpreter regression test verifies both import orders, bare decorator use, and submodule member access, but it does not exercise decorator keyword arguments. Extend the callable shim and test coverage to preserve that existing behavior.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

``import isaaclab.utils.configclass as ...`` and dotted attribute access.
"""

def __call__(self, cls: type) -> type:

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.

🟡 Warning · Api — Callable module drops configclass keyword arguments

configclass(cls, **kwargs) documents forwarding extra arguments to dataclass, and isaaclab/utils/__init__.pyi still exports it as that function. After this change from isaaclab.utils import configclass yields the module, whose __call__ accepts only cls, so configclass(MyCfg, kw_only=True) raises TypeError on the very import path this PR migrated all call sites to. Accept and forward *args, **kwargs.

@kellyguo11
kellyguo11 merged commit 12a31ab into release/3.0.0 Sep 10, 2026
53 checks passed
@kellyguo11
kellyguo11 deleted the backport/release/3.0.0/pr-7646 branch September 10, 2026 05:57
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 infrastructure isaac-mimic Related to Isaac Mimic team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants