madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
662 stars 48 forks source link

Docs: Add caveat about madsim reproducibility #130

Open kwannoel opened 1 year ago

kwannoel commented 1 year ago

Initially observed here: https://github.com/risingwavelabs/risingwave/issues/7901

Across various build environments the behaviour of RNG in a system may change, if they use from_entropy for instance. Or even just compilation might produce different ordering of rng writes and reads.

It should behave the same only with the same build. For example: we can run the original binary, it should yield the same result with the same SEED. Alternatively: Ensure build environment is the same (compiler, os, commit).

Should add some caveat about this in docs + output on how to reproduce when madsim cluster crashes.

kwannoel commented 1 year ago

may /assign me 😆

wangrunji0408 commented 1 year ago

Sure, it would be great to have such documents for developers. Please feel free to add them. Thanks in advance!

kwannoel commented 1 year ago

More specific details:

We can list these as some examples. I'm not sure if it's enough, maybe we can write some tests to verify 🤔