Skip to content

Add CableObject state and lifecycle support for DexSim 0.6 - #838

Merged
KeqiYe merged 48 commits into
mainfrom
codex/cable-foundation
Nov 11, 2026
Merged

KeqiYe merged 48 commits into
mainfrom
codex/cable-foundation

Conversation

@KeqiYe

@KeqiYe KeqiYe commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add typed CableObjectCfg, CableObject and batched segment state/load APIs through DexSim's public Scene/Spawn lifecycle. Cable declaration, preparation, endpoint attachments, selected-environment episode reset and teardown share the existing simulation owners.

Cable resets restore creation state and joint drive targets for every physical asset in the selected environments. Unsupported cable/particle mixtures are rejected at declaration; failed declarations and rejected topology changes preserve the existing scene and mounted cameras.

Runtime: published dexsim-engine==0.6.0rc1, engine build 1b968250ada2b06b210bc7aa08ef219769f01217, with Linux CPython 3.11/3.12 wheels recorded in the dependency locks.

The standalone create_cable.py tutorial demonstrates procedural cable creation, gravity stepping, world-state reads and episode reset through DexUni. USD particle regression inputs are authored into each test's temporary directory.

Stack

Review fixes

Addresses the five required review items and the unavailable-runtime comment.

Review item Result and regression coverage
Indexed runtime and cable/fluid compatibility Use the published 0.6.0rc1 release for both SDK ABIs. The same CPython 3.12 wheel passes pure cable and pure fluid declare/prepare/step/reset checks.
Cable plus fluid/cloth/soft particles Reject both declaration orders before mutating materials or the builder. CPU declaration tests and native two-world checks preserve the first declaration and verify that resetting env 1 leaves env 0 unchanged.
Stale initialization controls after failed prepare Refresh the owned joint-initialization group from current declarations on every pending build; preserve caller controls. Native regression removes the faulty robot, replaces another under the same UID, and checks initial qpos, drive targets and selected reset.
Duplicate UID pollutes materials Check the scene-wide UID before material registration. A rejected duplicate cannot reserve a new material name or alter the original asset.
Rejected removal destroys mounted camera Preflight pending-removal/topology restrictions before camera or marker teardown. CPU coverage verifies that markers keep following the live parent after rejected removal, including robots without cameras. Native coverage verifies the preserved camera's next frame.
USD particles and cables in one arena Check parsed USD descriptors and the live scene builder before registering materials or adding entities. A typed cable and an authored USD curve each reject a volume particle set in either order. A single stage containing both is also rejected. On CUDA, the first asset can still step and reset env 1 independently in both orders.
Material UID after rejected topology change Check fixed topology before material registration. On CPU and CUDA NoRender, a rejected red rigid leaves reserved available for a green visual. The original cable continues to step and reset.

Primary coverage: cable declaration/state tests, joint runtime controls, native cable lifecycle, fluid lifecycle and mounted-camera lifecycle.

Main compatibility and CI repairs

This branch incorporates #795 and uses its USD import recipe to check the selected descriptors. The synchronization preserves main's batched camera/light integration, stereo-camera coverage, marker attachments and isolated native-test setup. Spawn owns a shared removal preflight used before detaching mounted render resources. The extended regression first reproduced four marker-detachment failures in finalized cable/particle scenes; all 16 pending/finalized, camera/no-camera combinations pass with the fix. NoRender declaration-only visual removal remains supported.

The former CI run had 21 failed tests. Main fixes the 13 camera-reset cases and the Viser-aware example check. This update fixes the remaining seven:

  • Five environment-reset cases use the real DefaultPhysicsBackend default reset hook instead of an incomplete namespace stub. Their sensor/physical UID isolation assertions remain intact.
  • The backend capability matrix and add-method mapping include cables, exercising both backends without allocating a GPU.
  • Articulation qpos projection retains its no-mimic early return, so reset does not read irrelevant mimic relation fields.

Existing regression tests cover these failures; the capability matrix is extended in place.

Tutorial and fixture validation

The tutorial and fixture update is committed at 9da9f00a75c363142a67953733cc2370e4a2c71c.

  • Existing cable object tests pass with 64 passed, 3 skipped. The USD declaration regression subset has 5 passed.
  • Both affected isolated-process CUDA cases pass, covering cable-first rejection and imported-particle-first rejection with the generated USD input.
  • The tutorial passes syntax and CLI-help checks. Its two-environment NoRender run completes 480 steps and verifies exact restoration to creation state.
  • A 16-environment FastRT native-window smoke check displays 320 cable segments. A temporary launcher frames all arenas and repeats resets for viewing.
  • These tutorial/fixture runtime checks use Python 3.12, Torch 2.11.0+cu130 and the local DexSim build 88ac9206e0cb9c7894df6c7780f3e157806f0239 on an RTX 5090. The release-wheel qualification for the foundation commit is recorded below.
  • Whole-tree Black 26.10.1, whitespace, context-map and API coverage checks pass. Existing production tests retain their scenarios through a shared temporary USD fixture. Tutorial validation uses CLI, syntax and direct simulation runs.
  • The tutorial follows the existing simulation lifecycle contract, so the current project-context guidance remains sufficient.

Run from the source checkout:

python scripts/tutorials/sim/create_cable.py
python scripts/tutorials/sim/create_cable.py --headless --renderer no-render --num-envs 2

Foundation validation

Results apply to b125040e194824b238651a1befc0193e3960dd14 (base 33a81cd2). Local native tests use Python 3.12.14, the pinned DexSim release build, Torch 2.11.0+cu130, Newton 1.7.0 and Warp 1.17.0 on the RTX 5090 D v2.

  • 1545 passed, 37 deselected in the focused CPU/context suite, including the previously failing CI modules and the affected main conflict surfaces.
  • 15 passed, zero skipped in the serial native GPU suite, covering both USD/cable declaration orders, preservation of the first asset after rejection, cable state/forces and partial reset, deterministic reset/replay, prepare retry with removed/replaced robots, cable/articulation two-way contact, rigid coupling with/without CUDA Graph capture, three fluid lifecycle configurations and all five Default/Newton mono/stereo/cable camera lifecycle combinations.
  • An additional native probe on the prior head (2b336891) confirmed that the released SDK rejects missing URDF files during declaration. After that rejection, a separate failed prepare can still remove/replace robots, preserve the caller control, restore the new 0.025 joint default and reset env 1 without changing env 0.
  • Black 26.10.1 whole-tree format/check, whitespace validation, context-map checks and API documentation coverage (4757/4757) pass.
  • Built the current wheel and installed it into a separate environment with --no-deps and the pinned runtime dependencies. An isolated (python -I) check imports cable facades/configuration and the YAM preset from that installed wheel and lowers a cable descriptor successfully.
  • Context review: revised the owning simulation lifecycle passage to cover preflight before camera/marker detachment and the NoRender declaration-only exception; the deformables topic now covers native USD inventory checks and material registration order.
  • Remote full PR CI: tracks b125040e.
  • Remote SDK installation matrix: tracks b125040e.
Reproduce native checks
python -m pytest -v -ra -o addopts= --run-gpu -m gpu \
  tests/sim/objects/test_cable_object_cuda.py \
  tests/sim/objects/test_cable_two_way_cuda.py \
  tests/sim/test_dexuni_two_way.py \
  tests/sim/objects/test_fluid_runtime.py \
  tests/sim/test_sim_manager.py::test_robot_mounted_camera_backend_lifecycle \
  --junitxml=pr838-physical.xml

Scope and limits

Cable scenes require Newton/DexUni on CUDA without gradient mode. Finalized physical topology and mixed cable/particle arenas are unsupported; cable episode reset requires all physical assets in each selected environment. An attached articulation with a nonzero initial joint pose is rejected before commit because the current engine initialization hook cannot author that attachment pose safely. Material-modulus conversion and segment-count convergence comparisons remain follow-up work.

Type of change

  • New feature
  • Bug fix
  • Documentation update

Screenshots

This layer changes simulation state/lifecycle APIs and CI contracts. The robot screenshots are included in the independent YAM PR #1143; the dependent cable layer is #839.

Checklist

  • I have run black . with Black 26.10.1.
  • I reviewed affected documentation and agent context and preserved the current lifecycle guidance.
  • Public API changes are reflected in the API docs (4757/4757 documented).
  • I verified behavioral coverage and reviewed the necessity of the extended tests.
  • The published runtime and supported Python versions match the dependency locks.

xiemenghong and others added 19 commits September 17, 2026 09:48
Migrate DexUni example settings to the current namespaced solver interface and preserve the existing cloth contact values. Update the Newton config regression test and document the new mapping contract.
Port the retained MJVBD V2 integration consumers to the current DexUni public interface, while keeping AutoSolver as the Newton default. Preserve namespaced solver options, tutorial calibration, reset/mimic handling, and current task configuration.
Allow geometry-only ContactQuery data for DexUni VBD paths and full impulse/friction data for pure MuJoCo. Add capability tests and GPU end-to-end coverage.
…e-adaptation

# Conflicts:
#	embodichain/lab/sim/cfg/simulation.py
#	tests/sim/test_cfg.py
@KeqiYe KeqiYe added enhancement Improvements to existing capabilities; use feature for new capabilities. physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers. dexsim DexSim SDK interfaces, version adaptation and integration. sim-object Simulation entity configuration, state, creation, destruction and lifecycle. labels Oct 22, 2026
@yuecideng yuecideng added feature New user-facing capabilities. and removed enhancement Improvements to existing capabilities; use feature for new capabilities. labels Oct 25, 2026
yuecideng and others added 3 commits October 27, 2026 17:44
Expose pre-build Newton articulation and collision options, runtime-control
registration, authored tetrahedral meshes and direct nodal-state writes.
Support cloth rest angles and pneumatic cavities through native descriptors,
and forward renderer synchronization and graph-capture settings.

Keep native follower drives and mimic constraints by default; retain the
Default-parity mimic stabilizer as an explicit opt-in. Include focused tests
and the owning simulation context documentation.

Validation: 718 CPU/context tests passed (2 GPU cases skipped in that run);
3 explicit-tetrahedra/nodal-state GPU tests and both W1 mimic modes passed.
Black 26.3.1 (black .), API docs coverage (3269/3269), context checks and
whitespace checks passed. Robot/visualization context ownership remains
accurate; changed contracts are documented in simulation-system context.

Technical-report experiments, output artifacts and the local integration
report are intentionally excluded.
Synchronize origin/main at 460939c. Resolve deformable configuration, Spawn descriptor, example, metadata and context conflicts while retaining explicit tetrahedral meshes, cloth extensions and the native contact sampling fixes.

Validation in conda open: 737 focused regressions, 147 integration regressions and 15 native physics regressions passed. Black 26.10.1 leaves all 2301 files unchanged; API coverage is 4440/4440 and context validation passes.
Check original tetrahedral and surface indices before int32 narrowing. Declare the native GLB pan frame in all placement suites and propagate it through grasp, target and footprint qualification. Require complete footprint coverage, nonpenetrating sampled gaps and an interior-floor support witness for measured placement, including curved undersides.

Align two-way contact guidance and resolve the Task Engine bundle fixture's execution-policy component selector through the production resolver. Cover overflow, geometry failure cases and the real GLB loader in Default and Newton.
@KeqiYe
KeqiYe marked this pull request as ready for review November 9, 2026 05:36
@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge with no actionable defects identified.

Summary

Adds cable configuration, batched segment state, external loads, endpoint attachments, and manager lifecycle support for DexSim 0.6.

  • Scenes can create fixed-topology cables from shared simulation settings.
  • Callers can read and change cable segments through batched state.
  • Cable episode resets restore whole selected physical environments.
  • Cable scenes set articulation starting joints before capturing reset state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[CableObjectCfg] --> B[add_cable_object]
  B --> C[SpawnScene declaration]
  C --> D[prepare]
  D --> E[Seed creation joint state]
  E --> F[Commit Scene and bind CableObject]
  F --> G[CableObjectData snapshots]
  F --> H[Segment writes and external loads]
  F --> I[reset_objects_state]
  I --> J[Scene.reset_arenas for selected environments]
  J --> K[Reset selected visuals, lights and sensors]
Loading

Reviews (1) · Last reviewed commit: "feat(cable): adapt foundation and episod..." · Reviewed by Greptile

yuecideng and others added 4 commits November 9, 2026 13:53
Document Python 3.11/3.12 support and the actual py311 CI activation. Distinguish the current rc1 profiles from historical 0.5.1 images. Retry the official fixed-release Miniforge alias after a versioned-URL failure while retaining the original SHA256 check.

Validated both published rc1 ABI wheels and profile hashes, core-wheel Python-version acceptance/rejection, and 45 release/workflow regressions. Container build qualification follows separately.
Co-authored-by: kioxli <162790769+kioxli@users.noreply.github.com>
Record published cp311/cp312 wheel hashes, Python-version dry runs, unchanged locked resolutions, successful public/internal container builds and final pip checks. Keep image promotion and full native runtime acceptance separate from these build/dependency results.
Preserve origin/codex/adapt-latest-dexsim at e14fc4e while integrating the completed Python distribution and container dependency follow-up. Dependency and Docker build inputs remain identical to the qualified runtime snapshot.

Post-integration: 46 release/workflow tests pass, Black leaves 2312 files unchanged, API coverage is 4449/4449 and context validation passes.

@han-xudong han-xudong 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.

Merge-readiness follow-up for 0e304ee8 against #829 (c6e991c2): GitHub reports CONFLICTING / DIRTY. The branches diverge at 28f8b6a9; local three-way content merges confirm conflicts in at least five files: agent_context/MAP.yaml, embodichain/lab/sim/{sim_manager.py,physics/newton.py,spawn/scene.py}, and pyproject.toml. Please preserve both fluid/cable registration, Spawn dispatch and cleanup when resolving them.

Merge order: #829 → #838 → #839 → #834 → #923. After #829 lands, align this layer with main and retarget it, preserving a cable-only diff.

Resolve the runtime/CI issue below, then retain existing assertions and physical acceptance thresholds; attach cable lifecycle/partial-reset, two-way contact, fluid regression and full-CI results on the final integrated head, including the runtime/wheel provenance and logs.

Comment thread pyproject.toml Resolved
Match SimulationManager's fluid registry in the SimpleNamespace reset fixture. Preserve every reset count, canonical row ID, sensor exclusion and row-isolation assertion.

Reproduced all five AttributeError failures before the change. Validation in conda open: 165 focused Gym/reset and fluid regressions plus 5 native fluid lifecycle/visibility regressions passed without skips.
@yuecideng

Copy link
Copy Markdown
Contributor

#838 线缆基础层修改方案(0e304ee8)

保留 DexUni 统一求解器链路。刚体、线缆和流体的求解归属继续由 DexUni 决定。建议本层负责运行时兼容性预检、完整 episode reset 和声明失败后的状态一致性。

合入前必须修复

问题 修改方案 验收用例
P1 · 安装失败 同步已包含流体 #777 的目标分支。选择正常安装渠道可获取、且支持线缆和流体的 DexSim 构建,同步版本测试。当前固定的开发版在 CI 索引中不可用。 干净环境按项目正常流程安装,恢复受影响的 CI 矩阵;用同一个 wheel 分别执行纯线缆、纯流体的 declare → prepare → step → reset,记录实际 wheel 版本。
P2 · 混合场景延迟失败 在修改 builder、材质或注册表前校验对象组合。当前多段线缆要求 VBD;DFSPH 在有刚体时要求纯 MuJoCo 路径;线缆整场 reset 还会拒绝选中 arena 中的粒子对象。两个声明入口都应检查。 以两种顺序添加“线缆+流体”和“线缆+布料/软体”,当前不支持的组合在第二次声明时报清楚原因,第一项仍能 prepare/reset。纯线缆、纯流体各用两个环境,只 reset env 1,核对 env 0 未变、env 1 恢复默认状态。
P2 · prepare 重试残留控制器 使关节初始化控制器与本次构建声明一致。移除或替换待创建机器人时,清理旧目标并重新读取初始 qpos。 让未连接线缆的机器人因资源无效导致首次 prepare 失败;移除后重试应成功。同 UID 替换有效机器人时,首次状态与 reset 均使用新 qpos。
P2 · 拒绝重复 UID 前污染材质 仿照流体入口,先校验全场景 UID,再解析或注册材质。 声明 A,再用同 UID 和新材质 M 声明一次,预期失败。随后 B 用不同颜色的同名 M 应成功,A 保持原材质。
P2 · 移除失败损失相机 将已构建场景的拓扑预检移到销毁机器人挂载相机之前。 通过公开 remove_asset 尝试移除机器人,预期拒绝;机器人和挂载相机仍可查,相机仍能采下一帧。

后续优化

可新增按材料模量建模的可选入口,保留 YAM 已校准的逐连接刚度与阻尼。Isaac Lab 的同名刚度字段按截面和段长离散化。若引入换算,以同长度、同截面的 50 段与 100 段线缆验证静态伸长和悬臂挠度;提前定义误差容限。

安装失败日志 · 流体运行契约 · Isaac Lab 3.0.0 材料定义

@KeqiYe
KeqiYe force-pushed the codex/cable-foundation branch from 0e304ee to 91ae175 Compare November 10, 2026 06:05
Base automatically changed from codex/adapt-latest-dexsim to main November 10, 2026 11:01

@han-xudong han-xudong 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.

Follow-up on 2b336891 with DexSim 0.6.0rc1 (build 1b968250). The focused suite passed 422 CPU and 7 GPU cases. Please fix the two inline cases and rerun both declaration orders, native selected-env reset, and resource preservation. Keep existing tolerances and report the cable/fluid regressions and full CI on the final head.

Comment thread embodichain/lab/sim/sim_manager.py Resolved
Comment thread embodichain/lab/sim/spawn/scene.py Resolved
@KeqiYe
KeqiYe merged commit 602aff0 into main Nov 11, 2026
5 of 7 checks passed
@KeqiYe
KeqiYe deleted the codex/cable-foundation branch November 11, 2026 07:10
@KeqiYe KeqiYe mentioned this pull request Nov 13, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dexsim DexSim SDK interfaces, version adaptation and integration. feature New user-facing capabilities. physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers. sim-object Simulation entity configuration, state, creation, destruction and lifecycle.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants