Repository navigation
Publish clone plans before scene construction - #7570
Conversation
|
run-ci |
Greptile SummaryThe PR publishes clone plans before cfg-owned scene construction and enforces a single plan and backend dispatch per simulation.
Confidence Score: 4/5The PR should not merge until failed backend dispatch leaves the clone lifecycle recoverable rather than permanently consumed. Backend replication remains fallible, but the new ordering marks the plan consumed before invoking any backend, leaving the simulation unable to clear or retry after a failure or partial dispatch. Files Needing Attention: source/isaaclab/isaaclab/cloner/replicate_session.py and source/isaaclab/isaaclab/sim/simulation_context.py Important Files Changed
Sequence DiagramsequenceDiagram
participant Scene as InteractiveScene
participant Session as ReplicateSession
participant Sim as SimulationContext
participant Backend as Clone backends
Scene->>Session: enter with cfgs
Session->>Session: make_clone_plan()
Session->>Sim: set_clone_plan(plan)
Scene->>Scene: construct planned entities
Scene->>Session: exit
Session->>Sim: consume plan
loop Registered backends
Session->>Backend: replicate(plan)
end
Reviews (1): Last reviewed commit: "Clarify clone plan inspection" | Re-trigger Greptile |
| sim._consume_clone_plan(plan) | ||
| for context in sorted(contexts, key=lambda item: item.replicate_priority): | ||
| context.replicate(plan) |
There was a problem hiding this comment.
Dispatch failure locks clone lifecycle
When a registered backend raises during context.replicate(plan), _consume_clone_plan() has already marked the lifecycle consumed, so cleanup and subsequent replication attempts raise instead of recovering the active SimulationContext.
Knowledge Base Used: Scene and asset composition
There was a problem hiding this comment.
Addressed in eca3cd2. The consumed flag and cross-module lifecycle mutation were removed entirely. A partial multi-backend dispatch is not safely retryable without transactional rollback, so retry state is no longer modeled here; ReplicateSession owns publication before construction and dispatches the same plan on exit.
There was a problem hiding this comment.
Isaac Lab Review Bot
The review traced the new cfg-first lifecycle from ReplicateSession.__enter__ through constructor ownership validation and single backend dispatch, including the separate empty-scene/direct-task path. The proposed documentation finding is not accepted because the changelog and cloning guide already instruct custom composition roots to include participants in a plan published before construction and dispatch that same plan once.
- Design and architecture: Plan publication before cfg-owned construction, single-plan ownership in
SimulationContext, and caller-owned cloning for emptyInteractiveSceneinstances form a coherent lifecycle split. The replacementscene_from_cfggate preserves the prior distinction used for collision filtering. - API: The changed compatibility surface is explicitly marked as breaking. The documentation and changelog provide migration guidance for custom composition roots: build and publish one plan covering participants before construction, then dispatch that plan once. Although they do not repeat the exact runtime error wording, they cover the ownership rule underlying it.
- Implementation: The reviewed paths validate backend registration before consuming the plan, route global-path-only plans to the physics context, clear failed sessions, and keep environment origins synchronized with a subsequently published direct-workflow plan. Focused tests cover pre-construction publication, ownership rejection, single dispatch, failure cleanup, and empty-scene behavior.
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.
|
run-ci |
| else: | ||
| self.stage.DefinePrim(self.env_prim_paths[0], "Xform") | ||
| positions = cloner.grid_transforms(self.num_envs, self.cfg.env_spacing)[0] | ||
| self._env_origins = torch.as_tensor(positions, device=self.device) |
There was a problem hiding this comment.
Do we need _env_origins to be torch tensor? Ideally we want to keep initialization python or numpy array only
There was a problem hiding this comment.
Addressed in 579bd62. InteractiveScene now keeps the plan positions as NumPy during construction and materializes/caches the device tensor only when the public env_origins property is first read. Publishing a later direct-workflow plan replaces that cache with the new NumPy positions, so there is still exactly one conversion per plan.
|
run-ci |
|
run-ci |
|
run-ci |
Description
This follows #7462 by making the simulation's
ClonePlanavailable before cfg-owned scene construction.ReplicateSessionnow builds and publishes the plan on entry, constructs every participant at its planned source path, and dispatches that same object on exit.SimulationContextremains the canonical owner of the plan pointer; no secondary lifecycle state, constructor ownership heuristic, stage discovery, fallback context, or second clone mapping is introduced.InteractiveSceneowns this lifecycle for cfg-declared scenes. An emptyInteractiveSceneauthors only the env-0 prototype and leaves replication to direct task setup. That removes redundant environment-root authoring while preserving direct workflows with custom clone positions. Plan positions remain NumPy during scene construction and become a cached device tensor only when the publicenv_originsproperty is read.Kitless shadow visualization now takes its environment count and world positions from the same plan instead of rediscovering destination env transforms on USD. This lets OVPhysX feed Newton Renderer or OVRTX without requiring redundant destination prims.
Migration
Custom cfg-owned composition roots should use the session around cfg construction:
Homogeneous direct workflows construct env 0 first, then finish their one clone lifecycle explicitly:
Size
Performance
The earlier functional 3B head was performance-neutral in one matched warm sample on physical GPU 0 using
Isaac-Lift-KukaAllegro, 4,096 environments, Newton MJWarp physics, and no visualizer:The cleanup commits remove redundant empty-scene root authoring and eager environment-origin tensor creation. A current-head Kuka sample will replace this table when the shared physical GPU 0 is idle.
Type of change
Release backport
developScreenshots
Not applicable.
Validation
ReplicateSessiontests passedInteractiveSceneorigin/lifecycle tests passed on CPU and CUDAKeyErrorbefore the fix and passes after itgit diff --checkpassedThe prior
isaaclab_rlfailure is the independent LEAPP 0.7 regression fixed by #7592; this PR does not duplicate that dependency pin.Checklist
CONTRIBUTORS.md