Skip to content

[Tasks] Fix surface gripper observation shapes - #7583

Merged
kellyguo11 merged 4 commits into
isaac-sim:developfrom
StafaH:fix/surface-gripper-observation-shape
Sep 7, 2026
Merged

kellyguo11 merged 4 commits into
isaac-sim:developfrom
StafaH:fix/surface-gripper-observation-shape

Conversation

@StafaH

@StafaH StafaH commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fix surface-gripper stack observations so object_grasped and object_stacked return one boolean per environment. The surface-gripper state was reshaped to (num_envs, 1) before being combined with an (num_envs,) predicate, which caused PyTorch to broadcast the result to (num_envs, num_envs) while stepping the environment.

No new dependencies are required.

Reported in TC_146506 for IsaacContrib-Stack-Cube-UR10-Long-Suction-IK-Rel with the Newton Kamino backend.

Type of change

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

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable; this corrects an observation tensor shape.

Validation

  • uv run python tools/changelog/cli.py check --include-worktree develop
  • uv run isaaclab -f

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • Documentation changes are not required for this internal shape correction
  • My changes generate no new warnings
  • I have added a changelog fragment under source/isaaclab_tasks/changelog.d/
  • My name already exists in CONTRIBUTORS.md

@StafaH
StafaH requested a review from a team September 4, 2026 20:47
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 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.

Isaac Lab Review Bot

The patch corrects unintended cross-environment broadcasting in the surface-gripper branches of object_grasped and object_stacked by flattening gripper state to one value per environment. The focused regression test covers both predicates across three distinct environment states, and the user-visible fix has an appropriate changelog fragment.

  • Design and architecture: The change preserves the existing observation and scene-access structure while aligning surface-gripper predicates with the flat per-environment tensors already produced by the geometry and joint-gripper paths. No new abstraction or dependency is introduced.
  • API: Function signatures, configuration inputs, and boolean result dtype remain unchanged. The corrected return shape is (num_envs,) rather than the accidentally broadcast (num_envs, num_envs), restoring the intended per-environment observation behavior.
  • Implementation: The changed reshape directly prevents PyTorch from broadcasting (num_envs, 1) against (num_envs,). The test independently distinguishes gripper states and object geometry, validating expected values as well as shape for both predicates. Its mocked Warp conversion is appropriately focused on tensor-combination semantics, though integration with the real Warp state layout remains outside this test's scope.

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.

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes unintended cross-environment broadcasting in two surface-gripper stack observations.

  • Flattens surface-gripper state to one scalar per environment before combining predicates.
  • Adds a three-environment regression test with distinct gripper states and object geometry.
  • Adds a changelog fragment describing the corrected observation shape.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

The new one-dimensional reshape matches the surface-gripper state contract and prevents the documented quadratic broadcast, while the regression test covers both affected predicates.

Important Files Changed

Filename Overview
source/isaaclab_tasks/isaaclab_tasks/contrib/stack/mdp/observations.py Corrects surface-gripper state reshaping in object_grasped and object_stacked to preserve the environment batch.
source/isaaclab_tasks/test/contrib/stack/test_observations.py Adds a simulation-independent regression test verifying per-environment shapes and predicate values.

Reviews (1): Last reviewed commit: "Fix surface gripper observation shapes" | Re-trigger Greptile

@StafaH StafaH changed the title Fix surface gripper observation shapes [Tasks] Fix surface gripper observation shapes Sep 4, 2026
@StafaH

StafaH commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 4, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 7, 2026
@kellyguo11
kellyguo11 merged commit 1ae7125 into isaac-sim:develop Sep 7, 2026
83 of 84 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as f61d8d4.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 7, 2026
# Description

Fix surface-gripper stack observations so `object_grasped` and
`object_stacked` return one boolean per environment. The surface-gripper
state was reshaped to `(num_envs, 1)` before being combined with an
`(num_envs,)` predicate, which caused PyTorch to broadcast the result to
`(num_envs, num_envs)` while stepping the environment.

No new dependencies are required.

Reported in TC_146506 for
`IsaacContrib-Stack-Cube-UR10-Long-Suction-IK-Rel` with the Newton
Kamino backend.

## Type of change

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

## Release backport

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

## Screenshots

Not applicable; this corrects an observation tensor shape.

## Validation

- `uv run python tools/changelog/cli.py check --include-worktree
develop`
- `uv run isaaclab -f`

## 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 with `uv run isaaclab -f`
- [x] Documentation changes are not required for this internal shape
correction
- [x] My changes generate no new warnings
- [x] I have added a changelog fragment under
`source/isaaclab_tasks/changelog.d/`
- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Kelly Guo <[email protected]>

(cherry picked from commit 1ae7125)
@StafaH
StafaH deleted the fix/surface-gripper-observation-shape branch September 13, 2026 12:10
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.

2 participants