# hybridrobotics/supermimic architecture

> Architecture diagram of the GitHub repository hybridrobotics/supermimic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hybridrobotics/supermimic
- Repository: https://github.com/hybridrobotics/supermimic

## Overview

SuperMimic trains a humanoid motion-tracking policy through a differentiable learned world model, with generalized- and maximal-coordinate representations. The main workflow is task configuration and simulated data collection, followed by world-model and policy learning, checkpoint export, and playback. The graph preserves the documented training and playback capabilities, multi-task goals, simulation context, and representation-specific kinematics. Some implementation details are unsampled; edges are limited to relationships shown in excerpts, the source index, or the README.

Main entry points: [`src/supermimic/runners/supermimic_runner.py`](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/runners/supermimic_runner.py) (Training runner), [`src/supermimic/representations.py`](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/representations.py) (State representations), [`src/supermimic/envs/world_model_env.py`](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/envs/world_model_env.py) (Simulation environment), [`src/supermimic/scripts/play.py`](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/play.py) (Playback CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Training and playback"]
  node_train["Training CLI<br/>[train.py]"]
  node_play["Playback CLI<br/>[play.py]"]
  node_runner["Training runner"]
  node_viewer["Playback viewers<br/>[viewers.py]"]
end

subgraph group_simulation["Tasks and simulation"]
  node_taskcfg["Environment configs<br/>[env_cfgs.py]"]
  node_taskspec["Task specifications<br/>[task_spec.py]"]
  node_simctx["Simulation context<br/>[sim_context.py]"]
  node_simulator["mjlab simulator"]
  node_realenv["Simulation environment<br/>[world_model_env.py]"]
end

subgraph group_learning["World model and learning"]
  node_replay[("Replay buffer<br/>[replay_buffer.py]")]
  node_dynamics["Dynamics model<br/>[models.py]"]
  node_wmlearner["World-model learner<br/>[wm_learner.py]"]
  node_policy["Policy learner<br/>[policy_learner.py]"]
  node_learnerutils["Learning utilities<br/>[learner_utils.py]"]
end

subgraph group_motion["Motion representations"]
  node_representation["State representations<br/>[representations.py]"]
  node_ik["Analytic inverse kinematics<br/>[analytic_ik.py]"]
  node_coordhelpers["Coordinate helpers"]
end

subgraph group_integration["Export and tools"]
  node_exporter["Model exporter<br/>[exporter.py]"]
  node_artifacts["W&amp;B artifacts<br/>[wandb_artifacts.py]"]
end

node_user(("Engineer"))
node_wandb["Weights &amp; Biases"]

node_user -->|"starts training"| node_train
node_train -->|"launches"| node_runner
node_runner -->|"configures"| node_taskcfg
node_runner -->|"uses task specs"| node_taskspec
node_taskcfg -->|"selects representation"| node_representation
node_taskspec -->|"defines goals for"| node_representation
node_runner -->|"builds context"| node_simctx
node_representation -->|"binds context"| node_simctx
node_runner -.->|"collects rollouts"| node_simulator
node_runner -->|"steps environment"| node_realenv
node_runner -->|"stores transitions"| node_replay
node_runner -->|"trains dynamics"| node_wmlearner
node_wmlearner -->|"optimizes"| node_dynamics
node_wmlearner -->|"uses"| node_learnerutils
node_runner -->|"trains policy"| node_policy
node_policy -->|"rolls out in"| node_realenv
node_policy -->|"uses"| node_learnerutils
node_realenv -->|"predicts with"| node_dynamics
node_realenv -->|"transforms state"| node_representation
node_realenv -.->|"samples batches"| node_replay
node_representation -->|"uses"| node_ik
node_representation -->|"uses"| node_coordhelpers
node_runner -->|"exports models"| node_exporter
node_runner -->|"logs checkpoints"| node_artifacts
node_artifacts -->|"uploads artifacts"| node_wandb
node_user -->|"starts playback"| node_play
node_play -->|"loads run config"| node_runner
node_play -->|"downloads checkpoint"| node_artifacts
node_play -->|"opens viewer"| node_viewer
node_viewer -->|"renders state"| node_representation

click node_train "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/train.py"
click node_play "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/play.py"
click node_runner "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/runners/supermimic_runner.py"
click node_viewer "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/viewers.py"
click node_taskcfg "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/tasks/env_cfgs.py"
click node_taskspec "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/tasks/task_spec.py"
click node_simctx "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/sim_context.py"
click node_realenv "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/envs/world_model_env.py"
click node_replay "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/replay_buffer.py"
click node_dynamics "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/models.py"
click node_wmlearner "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/wm_learner.py"
click node_policy "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/policy_learner.py"
click node_learnerutils "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/learner_utils.py"
click node_representation "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/representations.py"
click node_ik "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/analytic_ik.py"
click node_coordhelpers "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/maxcoord_helpers.py"
click node_exporter "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/runners/exporter.py"
click node_artifacts "https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/wandb_artifacts.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_train,node_play,node_runner,node_viewer toneBlue
class node_taskcfg,node_taskspec,node_simctx,node_simulator,node_realenv toneAmber
class node_replay,node_dynamics,node_wmlearner,node_policy,node_learnerutils toneMint
class node_representation,node_ik,node_coordhelpers toneRose
class node_exporter,node_artifacts,node_user,node_wandb toneIndigo
```

## Components

### Training and playback

- [Training CLI](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/train.py): `src/supermimic/scripts/train.py`
- [Playback CLI](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/play.py): `src/supermimic/scripts/play.py`
- [Training runner](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/runners/supermimic_runner.py): `src/supermimic/runners/supermimic_runner.py`
- [Playback viewers](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/scripts/viewers.py): `src/supermimic/scripts/viewers.py`

### Tasks and simulation

- [Environment configs](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/tasks/env_cfgs.py): `src/supermimic/tasks/env_cfgs.py`
- [Task specifications](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/tasks/task_spec.py): `src/supermimic/tasks/task_spec.py`
- [Simulation context](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/sim_context.py): `src/supermimic/sim_context.py`
- **mjlab simulator**
- [Simulation environment](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/envs/world_model_env.py): `src/supermimic/envs/world_model_env.py`

### World model and learning

- [Replay buffer](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/replay_buffer.py): `src/supermimic/replay_buffer.py`
- [Dynamics model](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/models.py): `src/supermimic/models.py`
- [World-model learner](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/wm_learner.py): `src/supermimic/learners/wm_learner.py`
- [Policy learner](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/policy_learner.py): `src/supermimic/learners/policy_learner.py`
- [Learning utilities](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/learners/learner_utils.py): `src/supermimic/learners/learner_utils.py`

### Motion representations

- [State representations](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/representations.py): `src/supermimic/representations.py`
- [Analytic inverse kinematics](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/analytic_ik.py): `src/supermimic/utils/analytic_ik.py`
- [Coordinate helpers](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/maxcoord_helpers.py): `src/supermimic/utils/maxcoord_helpers.py`

### Export and tools

- [Model exporter](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/runners/exporter.py): `src/supermimic/runners/exporter.py`
- [W&B artifacts](https://github.com/hybridrobotics/supermimic/blob/main/src/supermimic/utils/wandb_artifacts.py): `src/supermimic/utils/wandb_artifacts.py`

### Other components

- **Engineer**
- **Weights & Biases**

## Connections

- Engineer → Training CLI: starts training (evidence: `README.md`)
- Training CLI → Training runner: launches (evidence: `src/supermimic/scripts/train.py`)
- Training runner → Environment configs: configures (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Training runner → Task specifications: uses task specs (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Environment configs → State representations: selects representation (evidence: `src/supermimic/tasks/env_cfgs.py`)
- Task specifications → State representations: defines goals for (evidence: `src/supermimic/tasks/task_spec.py`)
- Training runner → Simulation context: builds context (evidence: `src/supermimic/runners/supermimic_runner.py`)
- State representations → Simulation context: binds context (evidence: `src/supermimic/representations.py`)
- Training runner → mjlab simulator: collects rollouts (evidence: `README.md`)
- Training runner → Simulation environment: steps environment (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Training runner → Replay buffer: stores transitions (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Training runner → World-model learner: trains dynamics (evidence: `src/supermimic/runners/supermimic_runner.py`)
- World-model learner → Dynamics model: optimizes (evidence: `src/supermimic/learners/wm_learner.py`)
- World-model learner → Learning utilities: uses (evidence: `src/supermimic/learners/wm_learner.py`)
- Training runner → Policy learner: trains policy (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Policy learner → Simulation environment: rolls out in (evidence: `src/supermimic/learners/policy_learner.py`)
- Policy learner → Learning utilities: uses (evidence: `src/supermimic/learners/policy_learner.py`)
- Simulation environment → Dynamics model: predicts with (evidence: `src/supermimic/envs/world_model_env.py`)
- Simulation environment → State representations: transforms state (evidence: `src/supermimic/envs/world_model_env.py`)
- Simulation environment → Replay buffer: samples batches (evidence: `src/supermimic/envs/world_model_env.py`)
- State representations → Analytic inverse kinematics: uses (evidence: `src/supermimic/representations.py`)
- State representations → Coordinate helpers: uses (evidence: `src/supermimic/representations.py`)
- Training runner → Model exporter: exports models (evidence: `src/supermimic/runners/supermimic_runner.py`)
- Training runner → W&B artifacts: logs checkpoints (evidence: `src/supermimic/runners/supermimic_runner.py`)
- W&B artifacts → Weights & Biases: uploads artifacts (evidence: `src/supermimic/utils/wandb_artifacts.py`)
- Engineer → Playback CLI: starts playback (evidence: `README.md`)
- Playback CLI → Training runner: loads run config (evidence: `src/supermimic/scripts/play.py`)
- Playback CLI → W&B artifacts: downloads checkpoint (evidence: `src/supermimic/scripts/play.py`)
- Playback CLI → Playback viewers: opens viewer (evidence: `src/supermimic/scripts/play.py`)
- Playback viewers → State representations: renders state (evidence: `src/supermimic/scripts/viewers.py`)
