madsim-rs / madsim

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

Creating multiple runtimes with the same seed yields different random values #201

Closed tomasol closed 3 months ago

tomasol commented 3 months ago

Steps to reproduce: Sequentially create multiple runtimes from madsim::runtime::Builder with the same seed Print getrandom::getrandom in each simulation

The first value is different, then all other values are the the same, e.g.

[114]
[139]
[139]
[139]
...

Reproducer

wangrunji0408 commented 3 months ago

Hi, thanks for your feedback! We have fixed this bug and released a new version 0.2.27.

tomasol commented 3 months ago

Great, thanks. I found this issue while I was verifying determinism manually, but I will create a follow-up issue for it.