Skip to content

Declare semantic inclusion matches and select compact clone worlds - #9156

Merged
ooctipus merged 8 commits into
isaac-sim:mainfrom
Fanxing-LI:fansing/clone-variant-pins
Nov 24, 2026
Merged

ooctipus merged 8 commits into
isaac-sim:mainfrom
Fanxing-LI:fansing/clone-variant-pins

Conversation

@Fanxing-LI

@Fanxing-LI Fanxing-LI commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Multi-asset spawners can expose an enormous Cartesian product even when a task only needs a few compatible worlds. Declare compatibility with existing semantic tags and keep the legal choices compact until scene planning selects concrete worlds.

InclusionSet(assets=["gear", "fixture"], match_tags=["size", "assembly"])
  • InclusionSet owns only asset membership, inclusion weight, and matching tag types. No matching subclass, override method, positional layouts, separate labels, environment count, or random seed is required.
  • Selected variants must share a value for each requested tag type. A universal fixture can list several size values. Repeat asset names for cardinality; all selected instances share the requested tags. Unclaimed assets remain independent. This expresses shared compatibility, not separate pairwise constraints or sampling without replacement.
  • Scene planning reads individual spawner tags, including inherited wrapper tags, and resolves compatible tag-value groups. Each slot retains its candidate prototype IDs instead of expanding every concrete combination.
  • make_clone_plan uses the existing scene clone strategy to select groups and each slot's candidates, materializes only selected worlds, and reuses identical concrete prototypes. Inclusion weights split equally across compatible groups. Multi-valued tags can make groups overlap; this is group-weighted selection, not uniform sampling over the exhaustive union of concrete worlds.
  • Without matching tags, retain the existing independent product and assignment behavior.
  • Replication execution remains unchanged. ReplicateSession only receives broader type annotations for forwarding compact definitions; inclusion interpretation stays outside it.

This is the generic prerequisite. Downstream task-manager, heterogeneous-task, and VLA evaluation example changes (#9161, #9165 and #9184 ) need to adopt the declarative API when restacked.

Validation

  • 36 clone-plan algebra tests, 17 replication-session tests, and one Newton native asset test passed (54 total).
  • Tests cover multi-valued universal tags, multiple matching tag types, repeated instances, independent unclaimed assets, collection columns, mixed concrete/factorized definitions, prototype reuse, invalid choices, and external random-seed reproducibility.
  • A case with 1,000 variants, five categories, and eight slots retained five groups rather than expanding 5 * 200**8 concrete worlds; planning 128 environments created at most 128 concrete world prototypes.
  • A standalone scene-planning check passed for collection members, shared offsets, concrete MultiUsd candidates, inherited tags, and source preservation. The Isaac Sim scene test cannot launch without its runtime in this checkout.
  • Removing inherited tag propagation makes the native regression fail; restored code passes.
  • Local planning benchmark: approximately 4.37 ms to resolve the 1,000-variant case and 0.85 ms to select 128 worlds, with about 510 KiB peak Python planning allocation. This measures planning, not asset loading or simulation.
  • Full formatting checks and a file-by-file structural audit passed, including unchanged replication execution after stripping annotations.

Clone planning enumerates the product of the variant counts of all replicated assets, which runs out of memory for scenes with several multi-variant assets. InclusionSet.variants pins the variant of assets in a clone combination, so a scene lists its legal compositions instead. Planning now raises a ValueError naming the pins when it would enumerate more than ten million world prototypes.
The limit counts the world prototypes of all clone combinations together, and a test covers the scene path without combinations. A pin given as a narrow NumPy integer selects its variant, the error states the exact count, and the API reference lists the fields of InclusionSet.
Planning enumerates the product of the variant counts again and runs out of memory for scenes that are too large, instead of raising a ValueError. InclusionSet.variants and its validation stay.
Pinning every asset of a combination into one world is already asserted by the pinned variants test, and the test no longer has a limit to contrast with.
@Fanxing-LI
Fanxing-LI requested a review from a team November 23, 2026 05:58
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Nov 23, 2026
@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds InclusionSet.variants so clone combinations can select specific spawner variants without expanding every possible choice.

  • Clone combinations can pin specific spawner variants.

No actionable issues were found. Tests were inspected but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Clone combination] --> B[Check asset names and pins]
    B --> C[Pinned assets contribute one choice]
    B --> D[Unpinned assets contribute all choices]
    C --> E[Build world prototypes]
    D --> E
    E --> F[Split combination weight across worlds]
Loading

Reviews (1) · Last reviewed commit: "Remove the redundant pinned-world count ..." · Reviewed by 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

Needs attention: Style consistency (2), Test quality (1). Other reviewed categories look good.

  • PR description: Title and feature scope match; condense repeated rationale, remove future-merge timing, and compare bounded planning memory/latency across revisions with command, hardware, backend, software environment, environment count, and warmup.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: The added configuration copy uses a legacy method instead of the guide’s preferred functional operation; use clone(...) and remove the redundant assertion-narrating comment.
  • Test quality: The distinct planning regression lacks a kitless marker and is omitted from kitless CI selection; mark it kitless while retaining the separate Newton initial-variant proof.

Minor fixes needed. Posted 3 inline findings.

Automated review; human maintainers own approval decisions.

assert all(1 not in ids for _, _, ids in simulation.calls)


def test_pinned_variants_narrow_a_combination_to_its_unpinned_product():

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 · Test Quality — Mark the planning test kitless

CI selects kitless files by marker text. This pure-planning test has no kitless marker, so that selection omits it. Add pytest.mark.kitless to the test.

InclusionSet(assets=["part", "part", "tool"], variants={"part": 1, "lamp": 1}),
]
worlds, weights = make_valid_clone_combinations(names, counts, combinations)
# Pinning every multi-variant asset leaves one world carrying the whole weight; the free tool splits the other.

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 · Style Consistency — Remove assertion-narrating comment

The comment repeats the test docstring and narrates the following world and weight assertions. Remove it; the prototype-row mapping above explains the non-obvious numeric IDs.

def test_pinned_clone_combinations_choose_initial_variants(device: str) -> None:
"""Each world starts with the variants its clone combination pins, for reset-time and static spawners."""
scene_cfg = _VariantSceneCfg(num_envs=4, env_spacing=2.0)
third = scene_cfg.object.spawn.assets_cfg[0].copy()

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 · Style Consistency — Use functional configuration cloning

New configuration code should use the guide's functional operations. Replace this added .copy() call with clone(...); the legacy method remains supported but is not the preferred new-code convention.

@ooctipus ooctipus changed the title Add InclusionSet.variants to pin spawner variants in clone combinations Define legal clone world layouts through InclusionSet Nov 23, 2026
@ooctipus ooctipus changed the title Define legal clone world layouts through InclusionSet Let task-local inclusion rules select legal clone worlds Nov 23, 2026
@ooctipus ooctipus changed the title Let task-local inclusion rules select legal clone worlds Declare semantic inclusion matches and select compact clone worlds Nov 23, 2026
@Fanxing-LI Fanxing-LI mentioned this pull request Nov 24, 2026
6 tasks done
@ooctipus

Copy link
Copy Markdown
Collaborator

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 Nov 24, 2026
@ooctipus
ooctipus merged commit 587fc82 into isaac-sim:main Nov 24, 2026
62 checks passed
ooctipus added a commit that referenced this pull request Nov 25, 2026
## Description

Add `IsaacContrib-TableTop-PickPlace-Franka`, a flat Franka/Robotiq
tabletop environment with 100 NVIDIA-hosted SimReady props and nine real
SimReady table variants. Object count, categories, concrete assets,
table and collision-free poses are sampled again at reset. Every
environment can use every declared task family.

The scene declares eight interchangeable object slots. Each slot
contains the same complete catalog plus an invisible, non-colliding
placeholder. Reset samples a count from 2–8, samples a compatible source
category and an asset uniformly within that category, reserves a fitting
receiver, then samples categories and assets for the remaining occupied
slots. Occupied objects and placeholders are shuffled across slots. A
composition such as one container and two food items therefore uses
three slots and five placeholders; no slot is permanently assigned a
receiver or object role. Repeated assets are allowed. Placement retries
preserve the sampled count.

`InclusionSet(assets=["objects", "work_table"], sample_by="category")`
keeps initial clone planning factorized. Runtime selection uses Newton's
existing native body variants through rigid-object and collection APIs,
updating geometry, mass, inertia and COM-dependent state. There is no
enumeration of complete world combinations or stored catalog-pair
product, and no additional `ReplicateSession` customization. Identical
collision-only source meshes share native SDF texture allocations across
slots; visual meshes and prebuilt SDFs retain their ownership.

Task rules are declared beside the scene config as `put_in_container`
and `put_on_tray`. Task IDs are stable indices into `env.cfg.tasks`,
shared across all environments. Requesting a family before reset samples
objects that make it evaluable. Instructions and source/target masks are
rebuilt from current category- and size-compatible objects after every
reset. Success requires release, footprint containment and supporting
contact; container placement additionally checks the bottom against the
rim.

Reset uses the intersection of the hand-defined robot workspace and each
table's measured usable support polygon, including holes. Batched tensor
checks test complete footprints against measured edges and holes, while
XYZ bounds enforce the workspace; no polygon Boolean construction or
Shapely task dependency is needed. Proposal bounds only narrow the
search and do not replace the measured surface. Collision geometry is
transformed relative to the simulator COM. Full footprints must fit,
object pairs need clearance, and Newton's native collision pipeline
rejects penetrating placements, including robot intersections. Tables
retain their real visual geometry and triangle collisions; articulated
table equipment is frozen into one kinematic body. A reset selects a
different feasible table. Partial resets preserve untouched worlds.
Pending worlds publish their new geometry and poses together; unplaced
slots are kept apart outside the workspace during retries. The task
declares SAH geometry BVHs: the same dense 64-world reset case passes
with SAH and crashes inside Newton’s mesh-overlap kernel with LBVH.

The config composes constants with `.copy()` and `.replace()`. Reset and
success evaluation stay in task-local MDP terms. There are no per-task
configuration files, task YAML, config factories, post-init scene
generation, task-local object-cooking subclasses or core task manager.
Objects, tables and robot support use NVIDIA-hosted SimReady paths; no
Hugging Face cache or custom object/table uploads are required. The
known problematic `Big_Plastic_Plate_A01` is excluded.

The Newton backend declares optional SDF triangle reduction through
`NewtonCfg(sdf_mesh_reduction=0.75)`, retaining original visual geometry
and body inertia. This task uses 0.75 mm SDF voxels, four solver
substeps with contact refresh, and a shared 5 ms gripper/object contact
response. Robot home pose and actuator gains are preserved. Camera
lighting comes from scene dome/distant-light assets translated at the
builder boundary; renderer configs do not duplicate scene lighting.
Unsupported light types are reported, and scenes with no supported
lights keep Newton's defaults.

The robot references
`ISAACLAB_NUCLEUS_DIR/Robots/FrankaEmika/Robotiq/franka_robotiq_2F_85.usd`.
Its corrected replacement was requested and bucket propagation is
pending. Local simulation uses the corrected saved USD through a
runner-only override; no robot USD is bundled in this PR.

Based on main after #9156 merged. This PR is a prerequisite for #9184.

## Validation

- Automated coverage includes the catalog/factorization check and
backend collision-approximation and visual-import checks.
- A 1,000-entry, five-category catalog remains factorized across eight
slots, with at most 128 materialized world prototypes for 128
environments.
- A negative control fails when identical collision meshes allocate
separate SDF textures. An isolated replay of the captured dense
mesh-overlap query also reproduces the LBVH crash and passes with SAH.
- The actual 100-asset scene passed 896 forced resets across 64 worlds:
every count from 2–8 and both task families in every environment. All
100 concrete props were observed. Partial resets preserved untouched
object variants and poses, and 30 subsequent simulation steps kept
object states finite. These checks used the cached NVIDIA assets and the
corrected local robot override; MJWarp still emitted line-search
iteration-limit warnings.
- The Shapely-free support check matches an independent geometry oracle
on 90,000 cases, including concave outlines, enclosed holes and three
clearance distances. Local physical reset/task-success and actual
Robotiq validation passed after removing the direct dependency. Shapely
remains a transitive dependency of the existing Newton `alphashape`
importer.
- Repository formatting/lint, changelog checks and offline lockfile
validation pass.

The workspace is hand-defined rather than an IK reachability
calculation. Size compatibility is conservative, not a grasp planner,
and bounded placement can fail explicitly for infeasible configurations.
The current documentation image was rendered before this reset change;
no new policy success rate is claimed.

## Screenshot

![16 sampled SimReady tabletop worlds in a clean 4×4
view](https://raw.githubusercontent.com/Fanxing-LI/IsaacLab/49c258587/docs/source/_static/environment-previews/heterogeneous_tabletop.jpg)

## Type of change

- New feature
- Documentation update

## Checklist

- [x] Read the contribution guidelines
- [x] Run formatting and lint checks
- [x] Update documentation
- [x] Validate behavior with focused coverage and apply the test-audit
criteria
- [x] Add package changelog fragments
- [x] Contributor names already exist in `CONTRIBUTORS.md`

---------

Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
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