Skip to content

refactor(sim): move shared-memory control ABI to hardware - #3372

Draft
Nabla7 wants to merge 1 commit into
mainfrom
refactor/simulation-hardware-abi
Draft

refactor(sim): move shared-memory control ABI to hardware#3372
Nabla7 wants to merge 1 commit into
mainfrom
refactor/simulation-hardware-abi

Conversation

@Nabla7

@Nabla7 Nabla7 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Move the simulator/control shared-memory layout to dimos.hardware.simulation.shared_memory.
  • Keep dimos.simulation.engines.mujoco_shm as a compatibility re-export.
  • Point manipulator and G1 adapters, plus the legacy MuJoCo module, at the hardware-owned ABI.

Why

The shared-memory layout is the simulated hardware contract used by ControlCoordinator. It must not be owned by a particular simulation engine if external providers are expected to implement the same adapter boundary.

This is a mechanical ownership change; buffer names and data layout remain compatible.

Validation

  • pytest dimos/hardware/manipulators/sim/test_shm_adapter.py dimos/hardware/test_adapter_registries.py -q
  • 33 tests passed
  • Repository pre-commit hooks passed

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3503 1 3502 174
View the top 1 failed test(s) by shortest run time
dimos.codebase_checks.test_no_all::test_no_all
Stack Traces | 7.13s run time
def test_no_all():
        """Fail if any file defines `__all__`."""
        dimos_dir = DIMOS_PROJECT_ROOT / "dimos"
        hits = find_all_definitions()
        if hits:
            listing = "\n".join(f"  - {p.relative_to(dimos_dir)}:{lineno}" for p, lineno in hits)
>           raise AssertionError(
                f"Found __all__ definition(s) in dimos/:\n{listing}\n\n"
                "__all__ is not allowed. We don't use `from x import *`, so __all__ "
                "lists serve no purpose and are tedious to maintain. Remove them. For "
                "an import that exists purely to be re-exported, use `# noqa: F401`."
            )
E           AssertionError: Found __all__ definition(s) in dimos/:
E             - hardware/simulation/shared_memory.py:480
E             - simulation/engines/mujoco_shm.py:43
E           
E           __all__ is not allowed. We don't use `from x import *`, so __all__ lists serve no purpose and are tedious to maintain. Remove them. For an import that exists purely to be re-exported, use `# noqa: F401`.

dimos_dir  = PosixPath('.../dimos/dimos/dimos')
hits       = [(PosixPath('.../dimos/dimos/dimos/hardware/simulation/shared_memory.py'), 480), (PosixPath('.../dimos/dimos/dimos/simulation/engines/mujoco_shm.py'), 43)]
listing    = '  - hardware/simulation/shared_memory.py:480\n  - simulation/engines/mujoco_shm.py:43'

dimos/codebase_checks/test_no_all.py:51: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

1 participant