-
Notifications
You must be signed in to change notification settings - Fork 9
Deterministic execution checks #2
Comments
I'm not sure that |
@davidbarsky I think that makes sense, the reason I was drawn to using I think instead, we could achieve the same thing by using a global epoch which events can incorporate. Something like |
We spoke on Discord about this, but to summarize: I think a priority queue of events will be sufficient. The events will be inserted into the priority queue during a simulation run. "Priority" of an event is a monotonic instant/integer that allows a user/this system to determine a total ordering of events during a given simulation. This approach is outlined in greater detail here: https://lobste.rs/s/igiolo/learning_build_distributed_systems#c_nlpl7r |
I think the same approach would work for not only network events but IO events as well, and will let us simulate storage failures. A good implementation strategy would be to have each mock |
The easy way to do this is to, right before the test ends, print/log the random number generator's next value. If two runs produce the same final random number, they they're very likely to have identical executions. FoundationDB calls this the unseed. |
In the StrangeLoop FoundationDB talk, Will Wilson mentions the need for re-running simulations with the same deterministic seed and comparing the execution in order to detect sources of nondeterminism which have sneaked into the application.
It would be good to support this, if even at a basic level. One idea that has been floated is to use Tracing to collect a globally ordered set of execution events. This could serve as the basis for comparison to ensure that for multiple runs of the same seed, execution histories are identical.
The text was updated successfully, but these errors were encountered: