Skip to content

[Tasks] Sample keyboard reset-buffer batches across all environments - #8047

Merged
ooctipus merged 1 commit into
isaac-sim:developfrom
ooctipus:ooctipus/grouped-clone-default
Sep 27, 2026
Merged

ooctipus merged 1 commit into
isaac-sim:developfrom
ooctipus:ooctipus/grouped-clone-default

Conversation

@ooctipus

@ooctipus ooctipus commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Keyboard reset-buffer construction used the first n environments for partial batches. With contiguous clone groups, this can exclude later keyboard variants from the saved reset states.

Sample n distinct environments from the full scene instead, and use the same indices for commands, snapshots, and reach measurements. Buffer capacity and full-batch selection are unchanged.

The cloning optimizations are already on develop through #8045 and are no longer part of this PR. Only the keyboard sampling fix and its changelog remain: 2 files, +13 / -7 lines.

Validation

  • Local CPU checks of the command's buffer-building method, with IK and snapshot capture mocked: full, partial, and full-plus-tail batches passed. Without the fix, both partial-batch cases failed; the full-batch case passed.
  • uv run isaaclab -f passed, including changelog validation.
  • No simulator or training benchmark was run for this sampling-only change.

Type of change

  • Bug fix (non-breaking)

Release backport

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

@ooctipus
ooctipus requested a review from a team September 25, 2026 22:15
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 25, 2026
@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes default cloning strategy and adds batching optimization.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR makes grouped variant assignment the default, batches contiguous homogeneous Newton worlds, and adjusts SO101 reset-cache coverage. It retains explicit round-robin assignment and serial construction paths.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Clone combinations] --> B[Assignment strategy]
  B --> C[Clone plan]
  C --> D{Newton run eligible for batching?}
  D -- Yes --> E[Build one-world template]
  E --> F[Replicate contiguous run]
  D -- No --> G[Append worlds individually]
Loading

Reviews (1) · Last reviewed commit: "Group clone variants and batch homogeneo..."

@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 grouped clone default, compatibility strategy, and guarded Newton batching are coherently integrated, but the batched root-site color repair introduces a dependency on a private Newton API that should be removed before merge.

  • Design and architecture: The grouped strategy is applied consistently across the configuration, planner, and session entry points. Newton batching remains guarded so hooks, particle callbacks, and particle-bearing sources retain the serial construction path. The remaining concern is coupling the cloner to an external builder implementation detail for site coloring.
  • API: The public grouped and round_robin strategies are exported and documented, while sequential retains its prior behavior and provides a migration path for the changed default. The optional create_builder parameter preserves existing callers. However, the implementation relies on Newton's private _shape_palette_color member, which is not a stable API surface.
  • Implementation: The grouped count calculation, contiguous-run batching, transform composition, site remapping, and reset-buffer indexing are supported by the patch and tests. At newton_clone_utils.py:432, replace the direct call to builder._shape_palette_color(...) with a public or locally preserved color path so an external private-member change cannot break cloning at startup.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

for col in range(start, end):
offset = base_shape + (col - start) * template.shape_count
for local in range(len(env_root_sites)):
builder.shape_color[offset + local] = builder._shape_palette_color(offset + local)

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.

🔵 Suggestion · Implementation — Batch path calls private Newton builder helper

The batched run repairs root-site colors via builder._shape_palette_color(...), a private member of the external Newton ModelBuilder. Every other builder interaction here uses public API (add_site, add_builder, replicate, shape_color). If Newton renames or removes this helper, cloning fails with AttributeError at startup instead of degrading. Prefer reading the color the serial add_site path produced on the template, or accept the replicated color.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed the recoloring loop in 0cbdd92. These env-root sites are created hidden, so they can retain the prototype colors copied by Newton. The existing comparison still checks visible shape colors, site transforms and indices; it no longer requires hidden palette colors to depend on final shape indices.

@ooctipus

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 26, 2026
@ooctipus
ooctipus force-pushed the ooctipus/grouped-clone-default branch from 0053143 to 60edfc9 Compare September 26, 2026 00:44
@ooctipus

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 26, 2026
@ooctipus

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 26, 2026
def sequential(combinations: np.ndarray, num_clones: int) -> np.ndarray:
"""Assign identical prototype combinations to consecutive environments.

Counts match :func:`round_robin` exactly, including duplicate rows used as weights

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.

Do we need such large docstring?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, shortened it in 0cbdd92. It now states the ordering/count contract and array shapes. I also removed the repeated explanations from the planner/config/session docstrings; the examples and migration guidance stay in the cloning guide and changelog.

template.gravity = builder.gravity
template_sites: dict[str, list[list[int]]] = {}
append_world(template, start, template_sites)
template.gravity = wp.vec3(template.world_gravity[0])

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.

gravity is changing twice, once before and once after?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I checked Newton's implementation: begin_world() takes the builder's default gravity, but add_builder() overwrites the active world's gravity with the imported source's value. replicate() then reads the builder default, not world_gravity. So the first assignment covers empty worlds, and the second preserves the imported world's gravity when batching. Kept both and added a short comment; the existing empty-world, scalar-gravity and serial-versus-batched tests pass.

@ooctipus

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 26, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator Author

don't merge yet!!!!

@ooctipus
ooctipus force-pushed the ooctipus/grouped-clone-default branch from 0cbdd92 to 2997234 Compare September 27, 2026 00:41
@ooctipus ooctipus changed the title [Cloner] Group variants and batch homogeneous Newton clones [Tasks] Sample keyboard reset-buffer batches across all environments Sep 27, 2026
@ooctipus

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 27, 2026
@ooctipus
ooctipus merged commit f58afd0 into isaac-sim:develop Sep 27, 2026
53 of 54 checks passed
@ooctipus
ooctipus deleted the ooctipus/grouped-clone-default branch September 27, 2026 04:25
@isaaclab-bot

isaaclab-bot Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 0be72e0.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 27, 2026
…8047)

## Description

Keyboard reset-buffer construction used the first `n` environments for
partial batches. With contiguous clone groups, this can exclude later
keyboard variants from the saved reset states.

Sample `n` distinct environments from the full scene instead, and use
the same indices for commands, snapshots, and reach measurements. Buffer
capacity and full-batch selection are unchanged.

The cloning optimizations are already on `develop` through #8045 and are
no longer part of this PR. Only the keyboard sampling fix and its
changelog remain: **2 files, +13 / -7 lines**.

## Validation

- Local CPU checks of the command's buffer-building method, with IK and
snapshot capture mocked: full, partial, and full-plus-tail batches
passed. Without the fix, both partial-batch cases failed; the full-batch
case passed.
- `uv run isaaclab -f` passed, including changelog validation.
- No simulator or training benchmark was run for this sampling-only
change.

## Type of change

- Bug fix (non-breaking)

## Release backport

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

(cherry picked from commit f58afd0)
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.

2 participants