Skip to content

Stop the Newton cloner from approximating mesh colliders - #6892

Merged
kellyguo11 merged 8 commits into
isaac-sim:developfrom
ooctipus:zhengyuz/newton-cloner-no-approximation
Aug 6, 2026
Merged

Stop the Newton cloner from approximating mesh colliders#6892
kellyguo11 merged 8 commits into
isaac-sim:developfrom
ooctipus:zhengyuz/newton-cloner-no-approximation

Conversation

@ooctipus

@ooctipus ooctipus commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Newton replication ran a blanket convex-hull pass over every mesh collider, so a USD-authored physics:approximation was discarded the moment the asset was cloned. Assembly geometry — threads, chamfered holes, anything concave that matters — cannot survive that, and the only escape hatch was NewtonCfg.simplify_meshes, a scene-wide flag that turned approximation off for every collider at once.

Approximation belongs on the asset, not in the cloner. This PR drops the pass and the flag: the cloner imports colliders as authored (newton.ModelBuilder.add_usd(skip_mesh_approximation=...)), and a config that wants a convex hull asks for it per collider instead of getting one imposed.

Changes

isaaclab_newton

  • newton_clone_utils.py — the cloner no longer remeshes anything. Removes the physics:approximation → remeshing-method table and the two passes built on it.
  • replicate.py, newton_manager_cfg.py, visualization_builder.pysimplify_meshes plumbing removed.
  • test/cloner/test_collision_approximation.py — covers each authored mode (convexDecomposition, boundingSphere, boundingCube, meshSimplification, none) mapping to its shape type, an unauthored mesh staying a trimesh, mixed stages, and sources that resolve to different shape types being left alone.

isaaclab

  • CollisionBaseCfg.mesh_collision_property — the replacement mechanism. A file-spawned USD asset exposes no approximation knob through collision_props, so without this there is no way to author an approximation from a spawner config once the cloner stops doing it. The dispatch into modify_mesh_collision_properties already existed in schemas.py behind a getattr; this declares the field that feeds it.

isaaclab_tasks

  • lift_env_cfg.py, reorient_manager_env_cfg.py — author convexHull on the two assets that were relying on the implicit hulling (see the audit below).

Collider audit: every task, before vs after

Rather than reason about which assets were affected, every registered task was launched at num_envs=1 on both revisions and each colliding shape's resolved Newton GeoType was dumped and diffed.

before (develop) after
tasks probed 132 132
comparable (ok on both sides) 61 61
uncovered 65 skipped · 6 error 65 skipped · 6 error

Uncovered: 35 physx-only tasks, 8 with no sim.physics, 15 camera/visuomotor variants whose non-render siblings were probed, 5 pre-existing Newton limitations (surface grippers, reversed gripper joints), 1 missing optional tetrahedralization dependency.

Three tasks changed, all CONVEX_MESH → BOX on the same prim:

  • Isaac-Lift-KukaAllegro, Isaac-Reorient-Franka, Isaac-Reorient-KukaAllegro/World/envs/env_0/Object/geometry/mesh

Both root causes are tessellated mesh primitives that authored no approximation: lift_env_cfg.ObjectCfg is a MultiAssetSpawnerCfg of MeshCuboidCfg / MeshSphereCfg / MeshCapsuleCfg / MeshConeCfg variants sharing one collision_props, and the Reorient object is the dex cube. Authoring mesh_collision_property=MeshCollisionPropertiesCfg(mesh_approximation_name="convexHull") on the shared props — which the multi-asset spawner propagates to every variant — restores all three to byte-identical collider dumps.

Four other tasks (IsaacContrib-Stack-Cube-SO101-{v0,IK-Abs-v0,Joint-Teleop-v0}, IsaacContrib-Stack-Cube-Bin-Franka-IK-Rel-Mimic) showed shape-count deltas, but a same-revision control run reproduced the same spread with no code change at all — SO101 gave 2305 vs 2287 convex meshes on two runs of develop, the bin 72 vs 70. Their convex decomposition is nondeterministic run to run and the observed deltas sit inside that. A control re-run of Isaac-Reorient-Franka was byte-identical, confirming the control discriminates.

One measurement caveat: at num_envs=1 a multi-asset spawner instantiates one of its variants, so the sweep witnessed one shape per Lift task rather than all sixteen. The fix is on the shared props that propagate to every variant.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (existing functionality will not work without user modification)

Note on the breaking change

NewtonCfg.simplify_meshes is removed outright rather than deprecated first, which departs from the deprecation rule in AGENTS.md. The field only ever selected between "approximate everything" and "approximate nothing"; a deprecated shim that still forced convex hulls would keep the geometry-destroying path alive for another release, and any scene that wants convex hulls can now express that per collider. Happy to add a shim instead if reviewers prefer.

Out-of-tree scenes that relied on the implicit hulling and author no approximation will now load raw trimeshes. USD defaults physics:approximation to none, so the fix for those assets is the same one applied to Lift and Reorient here: author the approximation they actually want.

Screenshots

n/a

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Newton replication ran a blanket convex-hull pass over every mesh
collider, so a USD-authored physics:approximation was discarded the
moment the asset was cloned. Assembly geometry -- threads, chamfered
holes, anything concave that matters -- cannot survive that, and the
only escape hatch was a scene-wide simplify_meshes flag that turned
approximation off for every collider at once.

Approximation belongs on the asset, not in the cloner. Drop the pass and
the flag: the cloner now imports colliders as authored, and a config that
wants a convex hull asks for it per collider through the new
CollisionBaseCfg.mesh_collision_property, which reaches file-spawned USD
assets that expose no approximation knob otherwise.
@ooctipus
ooctipus requested a review from a team August 4, 2026 12:50
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 4, 2026
@ooctipus

ooctipus commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

#6891 (Factory contact-rich assembly task on Newton) is stacked on this PR and needs it merged first.

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR delegates mesh-collider approximation to Newton’s USD importer, adds per-collider approximation configuration, and removes the scene-wide simplify_meshes option.

  • Preserves authored physics:approximation modes during cloning.
  • Adds CollisionBaseCfg.mesh_collision_property for file-spawned assets.
  • Removes post-import remeshing and simplify_meshes plumbing.
  • Expands collision-import tests for authored, unauthored, mixed, and SDF meshes.
  • Removal of the heterogeneous-source fallback leaves the solver’s homogeneous-world requirement unenforced.

Confidence Score: 4/5

The PR should not merge until heterogeneous per-world source mappings are validated or normalized before SolverMuJoCo initialization.

The change removes the only visible enforcement of the solver’s homogeneous-world shape-sequence requirement while allowing differently approximated source builders to flow into the combined model.

Files Needing Attention: source/isaaclab_newton/isaaclab_newton/cloner/newton_clone_utils.py and source/isaaclab_newton/test/cloner/test_collision_approximation.py

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/cloner/newton_clone_utils.py Moves approximation into Newton’s USD importer but removes the guard that normalized heterogeneous source shape sequences for SolverMuJoCo.
source/isaaclab_newton/isaaclab_newton/cloner/replicate.py Removes simplify_meshes API and configuration plumbing as part of the acknowledged breaking change.
source/isaaclab/isaaclab/sim/schemas/schemas_cfg.py Exposes the already-dispatched mesh-collision configuration through CollisionBaseCfg.
source/isaaclab_newton/test/cloner/test_collision_approximation.py Thoroughly checks imported shape types, but the heterogeneous-source case does not initialize or step the solver whose invariant changed.

Reviews (1): Last reviewed commit: "Stop the Newton cloner from approximatin..." | Re-trigger Greptile

Comment on lines 114 to +117
USD parse time and memory that only pays off when the shapes are rendered
or ray cast.
"""
authored = _authored_collision_approximations(stage)
builders = {
source: _build_source_builder(
stage, source, create_builder, schema_resolvers, ignore_paths, simplify_meshes, authored, load_visual_shapes
)
return {

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.

P1 Homogeneous-world guard is removed

When a replication mapping uses per-world alternatives whose authored approximations produce different shape sequences, these builders now flow unchanged into the combined model, violating SolverMuJoCo's homogeneous-world requirement and causing solver initialization or simulation failure.

@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 cloner now delegates collision approximation to Newton’s USD importer and adds per-collider authoring through CollisionBaseCfg.mesh_collision_property. The implementation is covered by targeted approximation tests, but the public simplify_meshes configuration and keywords are removed without the required deprecation cycle.

  • Design and architecture: Moving collision approximation ownership from the cloner to authored asset properties and the USD importer is a coherent separation of responsibilities. The reviewed patch provides a per-collider configuration path rather than retaining scene-wide remeshing behavior.
  • API: The new CollisionBaseCfg.mesh_collision_property field exposes the existing mesh-collision dispatch path. However, removing NewtonCfg.simplify_meshes and the corresponding keywords from NewtonReplicateContext, newton_physics_replicate, and build_source_builders immediately breaks existing configurations and callers, contrary to the repository requirement that public APIs be deprecated in a prior release. These interfaces should remain temporarily as deprecated, accepted-but-ignored shims with migration guidance.
  • Implementation: The importer path consistently uses add_usd(skip_mesh_approximation=False), while existing visible-collider restoration and shape-color replacement remain in place. Tests cover authored approximation modes, unauthored meshes, mixed stages, differing source shape types, and SDF colliders. The remaining required implementation work is compatibility handling for the removed simplify_meshes inputs.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

self.device = device
self.up_axis = up_axis
if simplify_meshes is None or load_visual_shapes is None:
if load_visual_shapes is None:

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 · Api — Public simplify_meshes removed without deprecation

NewtonCfg.simplify_meshes and the simplify_meshes keyword on NewtonReplicateContext.__init__, newton_physics_replicate, and build_source_builders are deleted in one release, so existing configs and callers now fail with unknown-field or TypeError errors. Repository rules require deprecating public symbols in a prior release. Keep the field and keyword for one release as accepted-but-ignored shims that emit a deprecation warning pointing at mesh_collision_property.

Dropping the cloner's blanket approximation pass leaves every collider at
its USD-authored approximation, and USD defaults that to none. A sweep of
all 132 registered tasks, comparing each collider's resolved Newton shape
before and after, found three tasks whose colliders changed: the lift
multi-asset object and the reorient dex cube, both spawned as tessellated
mesh primitives with no approximation authored.

Author convexHull on their shared collision props, which the multi-asset
spawner propagates to every variant, restoring the shapes those tasks
resolved before.
kellyguo11 and others added 3 commits August 4, 2026 11:06
The MPM particle-pour demo passed simplify_meshes=False to keep its thin
colliders as exact triangle meshes. That is now the cloner's only
behavior, so the argument is gone and the demo failed to construct its
sim cfg at all.

test_valid_properties_cfg asserts every field on a properties cfg is
set, which the new optional mesh_collision_property breaks: None is its
meaningful value, meaning "leave the USD-authored approximation alone".
Exclude it there, and from the prim-attribute validator that would
otherwise look for a physxCollision attribute named after a nested cfg.
@kellyguo11

Copy link
Copy Markdown
Contributor
image this seems incorrect in the rendering-correctness test

The Lift object preset has two variants: a multi-asset spawner of Mesh*
primitives, and a plain CuboidCfg that spawns an analytic UsdGeom.Cube.
Only the former is a mesh, so only the former was ever hulled by the
cloner -- authoring a mesh-collision approximation on the cube claims a
property the prim cannot have.

The collider sweep confirms it was doing nothing: the tasks the hull is
meant to protect resolve identical shapes without it.
@ooctipus
ooctipus force-pushed the zhengyuz/newton-cloner-no-approximation branch from 9f4260e to 1413c0d Compare August 5, 2026 07:23
@ooctipus

ooctipus commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

image this seems incorrect in the rendering-correctness test

#6896 is also failing, this doesn't look like this pr's issue

@kellyguo11
kellyguo11 merged commit 89f10b0 into isaac-sim:develop Aug 6, 2026
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants