[Tasks] Fix composite physics preset selection - #7167
Conversation
Greptile SummaryThe PR fixes typed physics selection for presets that package a complete simulation configuration.
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified. The new matching logic consistently classifies the existing complete simulation alternatives as physics presets across help discovery and runtime validation without changing unrelated preset resolution. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Preset alternative] --> B{PresetTarget.matches}
B -->|PhysicsCfg| C[PHYSICS]
B -->|SimulationCfg containing PhysicsCfg| C
B -->|RendererCfg| D[RENDERER]
B -->|No typed match| E[DOMAIN presets]
C --> F[Help discovery and runtime validation]
D --> F
E --> F
Reviews (1): Last reviewed commit: "Fix typed composite physics presets" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change centralizes typed preset classification in PresetTarget.matches() and consistently applies it to help discovery and runtime validation. Complete SimulationCfg alternatives containing a PhysicsCfg are now recognized by physics=NAME, with corresponding documentation and changelog coverage.
- Design and architecture: The shared predicate prevents help-time bucketing and runtime validation from diverging. Classifying any complete
SimulationCfgcarrying a concretePhysicsCfgas a physics preset is broader than direct subclass matching, but it directly supports the cabinet preset structure and is a reasonable documented tradeoff. - API: Existing direct
PhysicsCfg,RendererCfg, and domain preset behavior remains intact. The change only widens the acceptedphysics=surface to include qualifying complete simulation configurations;DOMAINremains excluded from typed matching and access tocfg.physicsis guarded by theSimulationCfgcheck. - Implementation: Both producer and consumer paths use
PresetTarget.matches(): help bucketing classifies alternatives through it, while Hydra validation records the same typed target. Documentation and the package changelog describe the new behavior. A minor residual inconsistency remains in the unchanged__new__parameter documentation, which still describes routing solely viaisinstance, but it does not warrant blocking this fix.
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.
Description
Fix typed
physics=NAMEselection for presets whose alternatives bundle a completeSimulationCfg.The cabinet tasks use complete simulation presets because switching physics backends also changes the simulation timestep. Preset discovery and runtime validation previously classified alternatives only by their direct type, so these valid bundles appeared only under
presets=andphysics=newton_mjwarpwas rejected.This change:
PresetTarget.matches();SimulationCfgalternative as physics when itsphysicsfield is aPhysicsCfg;isaaclab_taskschangelog fragment.A repository-wide audit found this pattern only in the shared cabinet configuration. The fix covers these four registrations:
Isaac-Open-Drawer-FrankaIsaac-Open-Drawer-Franka-DirectIsaacContrib-Open-Drawer-Franka-IK-AbsIsaacContrib-Open-Drawer-Franka-IK-RelNo dependencies were added.
Type of change
Validation
uv run isaaclab train --task Isaac-Open-Drawer-Franka-Direct --rl_library rsl_rl --max_iterations 5 physics=newton_mjwarpPhysics: newton_mjwarp, no renderer, and no visualizer.uv run --frozen python -m pytest source/isaaclab_tasks/test/core/test_preset_cli.py source/isaaclab_tasks/test/core/test_hydra.py -quv run isaaclab -fuv run python tools/changelog/cli.py check develop --include-worktreeuv run --isolated --extra test -- make -C docs current-docsdevelopwhile importingisaaclab_physx/assets/rigid_object_collection/kernels.py:TypeError: unsupported operand type(s) for |: 'type' and 'Tensor'at the existingwp.array | torch.Tensorannotation. The failure occurs before reading the edited page.Per request, this PR does not add or modify tests.
Screenshots
Not applicable.
Checklist
uv run isaaclab -fsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.md