Skip to main content

MADDENING

Modular Automatic Differentiation and Data-Enhanced Neural-network INteracting Graph

📖 Documentation: https://microrobotica.org/maddening/ 🧩 Part of the Microrobotics Simulation Framework (MADDENING · MIME · MICROROBOTICA).

A JAX-based modular simulation framework for multi-physics. Designed as the computational backbone of MIME (MIcrorobotics Multiphysics Engine).

Regulatory disclaimer: MADDENING is research software. It is not a medical device as defined by EU MDR (EU 2017/745) and is not intended for clinical use. When used in a regulated product, MADDENING is classified as SOUP (Software of Unknown Provenance) under IEC 62304. See docs/regulatory/ for details.

What It Does

MADDENING manages a simulation graph where each node simulates one aspect of a physical system (fluid dynamics, rigid body mechanics, heat transfer, etc.) and edges represent coupling between them. The entire graph step is JIT-compiled into a single XLA computation via JAX, making the simulation fully differentiable and GPU-accelerated.

Core capabilities:

  • Graph-based multi-physics — nodes are independent JAX programs coupled by typed edges
  • Fully differentiable — jax.grad through entire coupled simulations (verified through 1000-step rollouts)
  • Iterative coupling — Gauss-Seidel and Jacobi with convergence acceleration (Aitken, IQN-ILS, IQN-IMVJ)
  • Multi-rate timestepping — each node at its own timestep, GCD-based base rate
  • Adaptive timestepping — Richardson extrapolation with PI controller
  • Neural surrogates — train MLP/DeepONet/FNO surrogates from simulation data, hot-swap into the graph
  • Cloud deployment — provision GPU VMs via SkyPilot, stream rendered viewports via WebRTC
  • Multi-job — distribute subgraphs across VMs with ZMQ-based rendezvous coordination

Package structure:

maddening/
├── core/                 # Graph manager, node ABC, edge spec, schedule
│   ├── coupling/         # Iterative coupling, convergence, acceleration, spatial mapping
│   ├── simulation/       # Adaptive dt, checkpoint, integrators, calibration, profiler
│   └── compliance/       # Metadata, stability, anomaly tracking, audit, UQ
├── nodes/                # Built-in nodes (Ball, Table, Spring, Heat, LBM, HeartPump, RigidBody)
├── surrogates/           # Neural surrogate framework (architectures, training, validation)
├── cloud/                # Cloud orchestration (SkyPilot, providers, coordinator, streaming)
│   └── multigpu/         # Device mesh, partitioning, sharded nodes, coordinator
├── viz/                  # Visualization (renderer ABC, relay, runner, backends)
├── api/                  # FastAPI server (REST + WebSocket + server-side rendering)
└── usd/                  # OpenUSD integration (graph serialization, geometry)

Installation

pip install maddening                    # CPU (base)
pip install maddening[cuda12]            # GPU with CUDA 12
pip install maddening[cuda12,viz]        # GPU + matplotlib plots
pip install maddening[server,cuda12]     # GPU simulation server
pip install maddening[runpod]            # Cloud deploy to RunPod
Extra What it adds
cuda12 / tpu GPU / TPU acceleration
viz Matplotlib renderers
terminal Rich terminal renderer
api FastAPI HTTP/WS server
network ZeroMQ remote transport
surrogates Neural surrogate training (equinox + optax)
runpod / lambda / aws / gcp Cloud deploy via SkyPilot
server Bundle: FastAPI + ZMQ + rich + matplotlib
cloud All supported cloud providers
all Everything

Works with both pip and uv. See docs/user_guide/installation.md for the full guide.

Quick Start

import jax.numpy as jnp
from maddening import GraphManager, SimulationNode

class BounceNode(SimulationNode):
    def halo_width(self) -> dict[int, int]:
        return {}  # pointwise (no spatial neighbors)

    def initial_state(self):
        return {"position": jnp.array(5.0), "velocity": jnp.array(0.0)}

    def update(self, state, boundary_inputs, dt):
        new_vel = state["velocity"] + -9.81 * dt
        new_pos = state["position"] + new_vel * dt
        new_vel = jnp.where(new_pos < 0, jnp.abs(new_vel) * 0.8, new_vel)
        new_pos = jnp.maximum(new_pos, 0.0)
        return {"position": new_pos, "velocity": new_vel}

gm = GraphManager()
gm.add_node(BounceNode(name="ball", timestep=0.01))
gm.compile()
final_state, history = gm.run_scan_with_history(n_steps=500)

See docs/user_guide/quickstart.md for the full tutorial.

Cloud Deployment

Pre-built Docker image with JAX CUDA, GStreamer, and all server dependencies:

pip install maddening[runpod]
# Set up ~/.maddening/cloud_credentials.yaml (see examples/cloud/config/)
from maddening.cloud.launcher import CloudLauncher

launcher = CloudLauncher()
job = launcher.launch("job_config.yaml")  # provisions GPU VM
job.ssh_run("python3 my_simulation.py")   # run directly on GPU
job.teardown()

Docker image: ghcr.io/microrobotics-simulation-framework/maddening-cloud:latest

The HTTP API requires a bearer token whenever it is not bound to loopback, and it still has no TLS. A 127.0.0.1 bind is unauthenticated, as before — local development is unchanged. Any other bind (which is what the cloud image does) demands Authorization: Bearer <token> on every route: set MADDENING_API_TOKEN, or read the token the server generates and logs once at startup. JobConfig.ports no longer defaults to [8000], so a launched job's API is not opened in the provider's firewall; reach it through an SSH tunnel (ssh -L 8000:127.0.0.1:8000 root@<vm> -p <ssh-port>). Because there is no TLS, the token crosses the network in cleartext — prefer the tunnel to a public port even now. See src/maddening/api/README.md.

For MIME Developers

MADDENING is designed to be extended by MIME. See:

License

LGPL-3.0-or-later. See LICENSE.

Metadata

Release files for maddening 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maddening 0.4.1
File Size Uploaded
maddening-0.4.1.tar.gz 8.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for maddening 0.4.1
File Interpreter ABI Platform
maddening-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 MB

Release files / maddening-0.4.1.tar.gz

Download URL maddening-0.4.1.tar.gz
Size 8.5 MB
Tags Source
SHA-256 checksum
How to use checksums
a7373760536bdcae6a41c20b34f31075a11b3397c70c0657b2f0c9b6afb3439a
BLAKE2b-256 checksum
How to use checksums
8e91a9e7de5bcfe3991f8ee7be7677b3d9ea65f0a2924d7a9e77e969796a672a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / maddening-0.4.1-py3-none-any.whl

Download URL maddening-0.4.1-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0cce3c04d2341c5f71e0aebcd9973fbe54e9615468018f4bc2677175688a6f9f
BLAKE2b-256 checksum
How to use checksums
793230dabe2c9ed4d0f9ecf456dddfea2bebcc7080793e1b04d13b8da12a735d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page