Fix VisACD selection propagation through Spawn - #656
Conversation
|
| 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) |
There was a problem hiding this 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.
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.
Description
Restore convex-decomposition algorithm selection when compiling mesh collision configuration into a DexSim Spawn descriptor. With
approximation: convex_decomposition, an omittedacd_methodselects VisACD; explicitvisacd,coacd, andvhacdreach 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_algorithmfield. 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.0release 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 againstmainremains three files.Type of change
Validation
Validated commit:
403f6ee3.npm run data && npm test— 17 passed.black==26.3.1:black .passed before commit; API documentation coverage 2176/2176;git diff --checkpassed.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
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicableThe existing pinned version is retained; the refreshed release artifact was verified directly.