Skip to content

Magical Deterministic Simulator for distributed systems in Rust.

License

Notifications You must be signed in to change notification settings

PromiseTeam/madsim

 
 

Repository files navigation

MadSim

Crate Docs CI

Magical Automatic Deterministic Simulator for distributed systems.

Deterministic simulation

MadSim is a Rust async runtime similar to tokio, but with a key feature called deterministic simulation.

The main idea is borrowed from sled simulation guide and FoundationDB. Part of the implementation is inspired by tokio-rs/simulation.

Ensure Deterministic

Developers should eliminate any randomness in the application code. That's not easy.

Here are some tips to avoid randomness:

To make sure your code is deterministic, run your test with the following environment variable:

MADSIM_TEST_CHECK_DETERMINISTIC=1

Your test will be run at least twice with the same seed. If any non-deterministic detected, it will panic as soon as possible.

Related Projects

  • MadRaft: The labs of Raft consensus algorithm derived from MIT 6.824 and PingCAP Talent Plan.

License

Apache License 2.0

About

Magical Deterministic Simulator for distributed systems in Rust.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%