[Tasks] Sample keyboard reset-buffer batches across all environments - #8047
Conversation
|
There was a problem hiding this comment.
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
groupedandround_robinstrategies are exported and documented, whilesequentialretains its prior behavior and provides a migration path for the changed default. The optionalcreate_builderparameter preserves existing callers. However, the implementation relies on Newton's private_shape_palette_colormember, 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 tobuilder._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) |
There was a problem hiding this comment.
🔵 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.
There was a problem hiding this comment.
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.
|
run-ci |
0053143 to
60edfc9
Compare
|
run-ci |
|
run-ci |
| 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 |
There was a problem hiding this comment.
Do we need such large docstring?
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
gravity is changing twice, once before and once after?
There was a problem hiding this comment.
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.
|
run-ci |
|
don't merge yet!!!! |
0cbdd92 to
2997234
Compare
|
run-ci |
|
Backported to |
…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)
Description
Keyboard reset-buffer construction used the first
nenvironments for partial batches. With contiguous clone groups, this can exclude later keyboard variants from the saved reset states.Sample
ndistinct 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
developthrough #8045 and are no longer part of this PR. Only the keyboard sampling fix and its changelog remain: 2 files, +13 / -7 lines.Validation
uv run isaaclab -fpassed, including changelog validation.Type of change
Release backport
develop