Skip to content

Fix VisACD selection propagation through Spawn - #656

Merged
yuecideng merged 2 commits into
mainfrom
codex/fix-visacd-propagation
Sep 19, 2026
Merged

yuecideng merged 2 commits into
mainfrom
codex/fix-visacd-propagation

Conversation

@yuecideng

@yuecideng yuecideng commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Description

Restore convex-decomposition algorithm selection when compiling mesh collision configuration into a DexSim Spawn descriptor. With approximation: convex_decomposition, an omitted acd_method selects VisACD; explicit visacd, coacd, and vhacd reach the engine unchanged, together with the hull budget.

The Spawn migration resolved the configured method but dropped it before descriptor creation, leaving the engine to use its CoACD default. This change carries the method into the declared CollisionDesc.decomp_algorithm field. Older engine packages fail explicitly instead of silently ignoring the choice. Ordinary geometry creation does not require the new field.

Engine support: http://192.168.3.16/Engine/dexsim/-/merge_requests/1424. The refreshed dexsim_engine==0.5.0 release contains the required field and dispatch, verified using a fresh download from the package index. The dependency pin remains unchanged. VisACD requires CUDA/OptiX support.

The branch includes current main, including #639's mass/inertia API adaptation and architecture-test data regeneration. The algorithm tests now exercise complete descriptor compilation without mocking body-physics compilation. The PR delta against main remains three files.

Type of change

  • Bug fix

Validation

Validated commit: 403f6ee3.

  • Fresh release wheel, isolated from the source-linked DexSim checkout: 298 passed across Spawn descriptors, source adaptation, simulation configuration, and simulation utilities. Previously reproduced mass/inertia failures are resolved.
  • Architecture frontend: npm run data && npm test17 passed.
  • Documentation Python tests: 77 passed.
  • black==26.3.1: black . passed before commit; API documentation coverage 2176/2176; git diff --check passed.
  • Reviewed affected simulation context; the default/method contract is restored, so no additional context update is needed. The main-branch compatibility changes already include their context updates.
  • Current-head GitHub CI: https://github.com/DexForce/EmbodiChain/actions/runs/35432040175PASS on 403f6ee3a7802e00bd2d776c73c2a35eac19cd34. Lint, documentation tests, build, test, and Test gate all passed. CPU: 4759 passed, 1 skipped; GPU: 175 passed, 3 skipped; simulation: 358 passed, 4 skipped. The distributed lane selected no applicable tests and was treated as empty by the existing runner. Greptile Review also passed.

Screenshots

Not applicable.

Checklist

  • I have run the black . command to format the code base.
  • I reviewed affected documentation and agent context, updated it where needed, or explained why no update was needed.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py), if applicable
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

The existing pinned version is retained; the refreshed release artifact was verified directly.

@yuecideng yuecideng added bug Something isn't working physics Things related to physics dexsim Things related to dexsim labels Sep 18, 2026
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because supported dependency resolution can still install a DexSim package whose CollisionDesc does not accept decomp_algorithm.

Fix All in CodexFindings

  1. P1 Dependency permits incompatible descriptor
Fix with agent prompt
### Issue 1
embodichain/lab/sim/spawn/descriptors.py:undefined-316
If an environment resolves an older `dexsim_engine==0.5.0` package without the declared `CollisionDesc.decomp_algorithm` field, compiling any convex-decomposition mesh now passes that unsupported field to `dataclasses.replace`. This raises `TypeError` instead of producing a Spawn descriptor. Publish the companion engine capability under a distinct version and update the dependency constraint so supported installations cannot resolve the incompatible API.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Restores convex-decomposition algorithm propagation when compiling mesh collision configuration into DexSim Spawn descriptors.

  • Defaults an omitted ACD method to VisACD and forwards explicit VisACD, CoACD, and VHACD selections.
  • Preserves the configured hull budget.
  • Documents the VisACD default and CUDA/OptiX requirement.
  • Adds focused descriptor tests for supported and invalid algorithm selections.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[MeshCollisionCfg] --> B[_compile_geometry]
    B --> C[Resolve ACD method]
    C --> D[CollisionDesc]
    D --> E[decomp_algorithm]
    D --> F[decomp_max_hulls]
    E --> G[DexSim collision cooker]
    F --> G
Loading

Reviews (2) · Last reviewed commit: "Merge main to align Spawn validation wit..."

if approximation == CollisionApproximation.CONVEX_DECOMPOSITION:
# Construct the declared field rather than attaching a dynamic attribute
# that older DexSim versions would silently ignore during cooking.
collision = replace(collision, decomp_algorithm=acd_method)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Dependency permits incompatible descriptor

If an environment resolves an older dexsim_engine==0.5.0 package without the declared CollisionDesc.decomp_algorithm field, compiling any convex-decomposition mesh now passes that unsupported field to dataclasses.replace. This raises TypeError instead of producing a Spawn descriptor. Publish the companion engine capability under a distinct version and update the dependency constraint so supported installations cannot resolve the incompatible API.

Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/sim/spawn/descriptors.py
Line: 316

Comment:
**Dependency permits incompatible descriptor**

If an environment resolves an older `dexsim_engine==0.5.0` package without the declared `CollisionDesc.decomp_algorithm` field, compiling any convex-decomposition mesh now passes that unsupported field to `dataclasses.replace`. This raises `TypeError` instead of producing a Spawn descriptor. Publish the companion engine capability under a distinct version and update the dependency constraint so supported installations cannot resolve the incompatible API.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

@yuecideng
yuecideng merged commit 86020ad into main Sep 19, 2026
9 checks passed
@yuecideng
yuecideng deleted the codex/fix-visacd-propagation branch September 19, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dexsim Things related to dexsim physics Things related to physics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant