Skip to content

Fix collision Loss Scaling for Large-Object Placement - #974

Open
zhx06 wants to merge 3 commits into
mainfrom
zxiao/feature/normalization_non_collision
Open

Fix collision Loss Scaling for Large-Object Placement#974
zhx06 wants to merge 3 commits into
mainfrom
zxiao/feature/normalization_non_collision

Conversation

@zhx06

@zhx06 zhx06 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Normalize collision loss for large objects

Detailed description

  • Large robots could overwhelm relation losses and fail placement after repeated attempts.
  • Normalize bbox and mesh penetration by object size.
  • Align mesh dispatch between optimization and validation.
  • Exclude relation anchors from aggregated background meshes.
  • Improves NextTo placement reliability without increasing retries.

@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Normalizes collision penetration losses by object size and aligns optimization-time and validation-time mesh dispatch.

  • Replaces AABB overlap-volume loss with normalized nearest-separating-face penetration.
  • Normalizes mesh penetration per subject size and uses maximum penetration per pair.
  • Excludes relation-anchor subtrees when aggregating background collision meshes.
  • Uses stand-only bounding-box collision for configured Droid embodiments.
  • Adds coverage for normalized losses, mesh dispatch, background exclusions, and USD extraction errors.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness or security defects identified.

The normalized AABB and mesh losses retain collision gradients, optimization and validation use the same mesh-coverage predicate, and background exclusions are keyed and tested without leaving an unsupported dispatch path.

Important Files Changed

Filename Overview
isaaclab_arena/relations/relation_loss_strategies.py Replaces scale-sensitive overlap-volume loss with normalized separating-depth loss while preserving gradients for containment and coincident centers.
isaaclab_arena/relations/no_overlap_mesh.py Normalizes sphere penetration by subject size and aggregates each pair using its maximum penetration.
isaaclab_arena/relations/collision_mode.py Centralizes the decision for whether a fixed or dynamic collision pair can be represented by the mesh path.
isaaclab_arena/relations/placement_validators.py Aligns validation dispatch with solver dispatch using candidate-batched bounding boxes and the shared mesh-coverage predicate.
isaaclab_arena/relations/passive_collision_objects.py Maps anchored object references to parent-background subtree exclusions before fixed mesh aggregation.
isaaclab_arena/relations/background_collision_object.py Supports per-object mesh exclusions and treats fully excluded geometry as contributing no aggregate obstacle.
isaaclab_arena/relations/warp_mesh_manager.py Keys extracted meshes by exclusion set and distinguishes absent, unsupported, and fully excluded collision geometry.
isaaclab_arena/utils/usd_helpers.py Adds absolute USD subtree filtering and a dedicated error for extraction where every mesh was excluded.
isaaclab_arena/environments/relation_solver_interface.py Forwards relation-anchor references as background mesh exclusions during passive collision discovery.
isaaclab_arena/embodiments/droid/droid.py Forces bounding-box collision mode when stand-only placement geometry is requested.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Scene assets and relation anchors] --> B[Discover passive collision objects]
  B --> C[Exclude anchored ObjectReference subtrees]
  C --> D[Aggregate remaining background meshes]
  A --> E[Build candidate bounding boxes]
  D --> F{Pair covered by mesh collision?}
  E --> F
  F -->|Yes| G[Normalized sphere-to-SDF penetration]
  F -->|No| H[Normalized AABB penetration]
  G --> I[Relation solver optimization]
  H --> I
  I --> J[Validation using matching pair dispatch]
  J --> K[Rank and apply placement]
Loading

Reviews (1): Last reviewed commit: "introduce normalization in bbox/mesh" | Re-trigger Greptile

self.params = params or RelationSolverParams()
# High slope (vs 10-100 for relation strategies) so overlap avoidance dominates.
self._no_collision_strategy = NoCollisionLossStrategy(slope=10000.0)
self._no_collision_strategy = NoCollisionLossStrategy()

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.

🟡 Collision loss no longer dominates relation losses

The old slope (10000.0 on overlap-volume) was deliberately high so overlap avoidance would dominate the 10–100 relation-strategy slopes — the comment you removed said as much. The new size-normalized penetration loss with the default slope=10 is roughly the same order of magnitude as the relation losses, so a strong relation term (e.g. a tight NextTo) can now outweigh collision avoidance for all scenes, not just large objects. Did you confirm dense existing scenes still resolve without overlaps under the new balance, or should the no-collision slope stay somewhat higher than the relation slopes?

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This normalizes the no-collision loss by object size (AABB penetration depth ÷ subject scale, and per-pair amax of normalized sphere penetration in MESH mode) so large objects no longer overwhelm relation losses, deduplicates the mesh-vs-AABB dispatch decision into a single pair_is_covered_by_mesh_collision predicate, and excludes relation-anchor subtrees from the aggregated background mesh so anchor geometry is not double-counted. The refactor is coherent and the test coverage is genuinely strong (scale-invariance, containment-gradient, batched-bbox dispatch, exclusion cache-keying, and the fully-excluded/unsupported-geometry error paths are all covered, using the inner/outer sim pattern where needed).

Findings

🟡 relation_solver.py:51 — The no-collision slope drops from 10000 (on overlap volume) to the default 10 on size-normalized penetration, which is now the same order of magnitude as the 10–100 relation-strategy slopes. That inverts the previous deliberate "overlap avoidance dominates" balance for every scene, so a strong relation term could now win over collision avoidance. Raised inline as a question — worth confirming dense existing scenes still solve without overlaps.

No correctness issues found in the normalization math, the anchor-swap / tie-break heuristics, the exclusion plumbing, or the new assert-based invariants.

Test Coverage

Thorough. New/updated tests cover the normalized-depth formula, scale invariance, containment gradient, batched-bbox mesh dispatch, meshless-anchor AABB fallback, exclusion cache-keying, all-meshes-excluded, and unsupported-geometry preservation. Sim-dependent tests (test_usd_helpers.py) use the run_simulation_app_function inner/outer pattern.

Verdict

Ship it — pending a sanity check that the global loss-reweighting does not regress collision avoidance on existing dense scenes.

zhx06 added 2 commits July 29, 2026 16:38
Signed-off-by: zhx06 <zihaox@nvidia.com>
Signed-off-by: zhx06 <zihaox@nvidia.com>
@zhx06
zhx06 force-pushed the zxiao/feature/normalization_non_collision branch from 97dbd58 to 49097c7 Compare July 29, 2026 23:38
Signed-off-by: zhx06 <zihaox@nvidia.com>

@qianl-nv qianl-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a relative large change to the relation solver loss compute and carry a lot of risk this late in the stage. Let's take a more systematic approach to understand the perf gain of each optimization and if they introduces any regressions

I see several changes in this MR that should be separately measured

  1. AABB loss: Volume overlap (slope=10000) → shortest-axis penetration / subject size (slope=10)
    this carries the highest risk for regressing existing scenes. Let's benchmark this change alone, over all the existing robolab scenes (in isaaclab_arena_environments/robolab), and check how (1) layout success rate and interation count changes (2) physics stability rate on the layouts using isaaclab_arena/scripts/run_placement_pool_validation.py

  2. Mean sphere penetration → max normalized penetration per pair

  3. Excludes anchor ObjectReference subtrees from aggregated background meshes

  4. Droid stand collison_mode=BBOX

For 2-4, let's use the scenes in isaaclab_arena_environment/kitchen_bench with mesh mode enable for the kitchen, and check the impact on build/solver time, layout success rate, interations ect. Let's only merge the changes that has significant impact on perf.

It also seems 4 makes 2 unnecessary at least for kitchen_bench scenes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants