Skip to content

Fix backend propagation in nested dictionary conversion - #7118

Merged
kellyguo11 merged 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/nested-backend-conversion
Aug 21, 2026
Merged

kellyguo11 merged 3 commits into
isaac-sim:developfrom
sylvesterkaczmarek:fix/nested-backend-conversion

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Description

convert_dict_to_backend() recursively processed nested dictionaries without forwarding backend or array_types. Nested values therefore silently reverted to the default NumPy backend.

This forwards the caller's conversion settings through recursion, adds regression coverage, and includes a changelog fragment.

Type of change

  • Bug fix

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team August 15, 2026 23:03
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Aug 15, 2026
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes recursive dictionary conversion so nested values retain the caller-selected backend and source array types.

  • Forwards backend and array_types through recursive convert_dict_to_backend() calls.
  • Adds regression coverage for nested NumPy-to-Torch conversion.
  • Adds a changelog fragment documenting the fix.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable defects identified in the changed behavior.

The recursive call now preserves the same backend and source-type filter used at the parent level, and the regression test directly covers the previously broken nested conversion.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/utils/dict.py Correctly propagates conversion settings into nested dictionaries without changing default-call behavior.
source/isaaclab/test/utils/test_nested_backend_conversion.py Adds focused regression coverage demonstrating that nested NumPy arrays convert to Torch tensors.
source/isaaclab/changelog.d/sylvesterkaczmarek-fix-nested-backend-conversion.rst Accurately documents the nested backend propagation fix.

Reviews (1): Last reviewed commit: "docs: note nested backend conversion fix" | Re-trigger Greptile

@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 change correctly forwards backend and array_types during recursive dictionary conversion, aligning nested values with the caller’s requested conversion settings. The regression test and changelog fragment cover the corrected behavior.

  • Design and architecture: The recursive path now uses the same conversion configuration as the top-level call without changing ownership, state, or control flow. Re-validating conversion settings at each nesting level is a minor existing tradeoff, not a merge concern.
  • API: The public signature, defaults, return shape, and exports remain unchanged. The patch corrects nested behavior to match the existing parameter contract, so no deprecation or migration guidance is needed.
  • Implementation: The changed recursive call directly fixes the demonstrated fallback to default settings. The test exercises nested NumPy-to-Torch conversion and would distinguish the fixed behavior from the prior implementation. Although the new test could potentially be consolidated into existing dictionary utility coverage, that is non-blocking.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix/nested-backend-conversion branch 2 times, most recently from 31e46dc to 1f1a282 Compare August 16, 2026 10:09
@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix/nested-backend-conversion branch from 1f1a282 to 79ae3fc Compare August 16, 2026 10:33

@AntoineRichard AntoineRichard left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sylvesterkaczmarek thanks a lot for taking the time to open all these PRs. Could you kindly take the time to look into the following:

"the new test lives in a standalone file (test_nested_backend_conversion.py) that duplicates the scope of the existing source/isaaclab/test/utils/test_dict.py, which already covers convert_dict_to_backend. Consider folding this as a test case into that existing file instead, for discoverability and to avoid splitting coverage for the same function across files."

LGTM otherwise!

Addresses maintainer feedback by keeping convert_dict_to_backend coverage in the existing test_dict.py module.

Signed-off-by: Sylvester Kaczmarek <[email protected]>
Coverage now lives with the existing convert_dict_to_backend tests as requested by the maintainer.

Signed-off-by: Sylvester Kaczmarek <[email protected]>

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the changes (and all the PRs) LGTM! @kellyguo11 @StafaH can I get another approval?

@kellyguo11
kellyguo11 merged commit 0f204e9 into isaac-sim:develop Aug 21, 2026
74 of 77 checks passed
kellyguo11 added a commit that referenced this pull request Aug 21, 2026
…#7234)

## Summary

Cherry-picks the following merged PRs from `develop` onto
`release/3.0.0`, preserving each as an individual commit with `-x`
provenance:

- #7070 — Bump the Isaac Sim CI image to digest `e7cd73cd7a9a`
- #7118 — Fix backend propagation in nested dictionary conversion

The commits are applied in their `develop` history order. Both
cherry-picks completed without conflicts.

## Validation

- Verified both backported commits have patch IDs identical to their
source squash commits and retain their `cherry picked from` footers.
- `git diff --check upstream/release/3.0.0..HEAD`
- `uv run --extra test --frozen python -m pytest
source/isaaclab/test/utils/test_dict.py -q --disable-warnings` — **10
passed**
- Parsed `.github/workflows/config.yaml` and verified the exact
`e7cd73cd7a9a...` Isaac Sim digest.
- Changelog validation against `release/3.0.0` passed.
- `uv run isaaclab -f` passed all code, formatting, whitespace,
YAML/TOML, license, and safety hooks. Its changelog hook reported
pre-existing release-only fragments (`ant-direct-device-mask-reset.rst`
and `omniverse-client-2-72-1-update.rst`) followed by the known Windows
CP1252 reporting error; the targeted release-base changelog check
passed.

---------

Signed-off-by: Sylvester Kaczmarek <[email protected]>
Co-authored-by: isaaclab-bot[bot] <282401363+isaaclab-bot[bot]@users.noreply.github.com>
Co-authored-by: Sylvester Kaczmarek <[email protected]>
@sylvesterkaczmarek
sylvesterkaczmarek deleted the fix/nested-backend-conversion branch December 2, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants