# madsim-rs/madsim

Magical Deterministic Simulator for distributed systems in Rust.

Repository: https://github.com/madsim-rs/madsim
Canonical: https://ross.abutalabs.com/products/madsim
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: deterministic, distributed-systems, simulator
Last push: 2026-02-16T08:50:34+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 67, release rhythm 35, longevity 100
- inputs: {"age_days": 1865, "days_push": 198, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1150, forks 71 (observed 2026-08-28T04:03:46.487183+00:00)

## What it is
MadSim is a Rust async runtime similar to tokio that enables deterministic simulation testing for distributed systems. It mocks I/O interfaces, eliminates uncertainty, and injects chaos and failures so bugs can be reproduced deterministically.

## Use cases
- deterministically test distributed systems in Rust
- reproduce race conditions and hidden bugs reliably
- inject network and node failures into async Rust code
- simulate tokio, tonic, etcd, kafka, and S3 clients in tests
- chaos-test a database or streaming system before deployment

## When to choose
- you build distributed systems in Rust and want FoundationDB-style deterministic simulation testing
- you need reproducible failure injection and chaos testing for async Rust code
- you want to swap tokio/tonic/etcd-client/rdkafka with drop-in simulated versions

## When to avoid
- your code depends on crates without madsim-compatible replacements or patches
- you only need conventional integration or end-to-end testing without determinism
- you are not writing Rust async applications

## Facets
- artifact type: library
- maturity: active
- function: testing, simulation, mocking, concurrency
- domain: microservices, testing, developer-tools
- platform: rust, cross-platform
- tags: deterministic-simulation, chaos-testing, async-runtime, tokio-alternative, fault-injection

## Member repositories
- madsim-rs/madsim (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:46.487183+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:33:41.007160+00:00, confidence not recorded.
  - readme: https://github.com/madsim-rs/madsim (fetched 2026-08-28T04:03:46.487183+00:00, sha 2ccd7a65505d)
  - registry_crates: https://crates.io/api/v1/crates/madsim (fetched 2026-08-29T12:38:28.068970+00:00, sha b1e69a7e9232)
- Data as of 2026-08-30T08:39:29.467469+00:00.
