Tribler / gumby

Experiment runner framework for IPv8 and Tribler
11 stars 36 forks source link

Add an option to fix the randomness in an experiment #511

Open devos50 opened 2 years ago

devos50 commented 2 years ago

We occasionally use the random module to generate random numbers. We could consider making our experiments more deterministic by seeding the randomness. This could be an experiment option. Note that this will likely not take away all randomness in experiments since network latencies might impact the order of events.

kozlovsky commented 2 years ago

But will it provide the necessary determinism? The random generator is not the only source of randomness in the experiment involving multiple nodes. Even with fixed pseudo-randomness, the experiment result will still be indeterministic because the exact timing of nodes' start and communication delays will depend on the entire DAS state. As a result, nodes may process messages in a different order, even with a fixed seed, and the experiment results will still be different.

devos50 commented 2 years ago

@kozlovsky no it doesn't but that also not the end goal (as I also stated in the OP):

Note that this will likely not take away all randomness in experiments since network latencies might impact the order of events.

Uncertainties stemming from the network/system are unavoidable.