Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RepeatableRandom displaying non-repeatable results #136

Open
rbilgil opened this issue Oct 17, 2023 · 1 comment
Open

RepeatableRandom displaying non-repeatable results #136

rbilgil opened this issue Oct 17, 2023 · 1 comment

Comments

@rbilgil
Copy link

rbilgil commented Oct 17, 2023

Hello! We're using the vrp_core crate directly in our codebase to solve VRP problems and are very interested in deterministic output. Our expectation is that the RepeatableRandom seed provided in the crate and supplied to the Environment should mean subsequent runs when run on the same input should result in exactly the same solution. However, in practice we haven't been able to achieve this: the solution never appears to be repeatable between runs.

Wondering if either our expectations of what RepeatableRandom does is wrong, or whether we're encountering a bug. From examining some of the calls to random(), we did suspect that thread scheduling could be adding its own entropy to the RNG access, but not completely sure if that could explain the problem.

@reinterpretcat
Copy link
Owner

Yes, thread scheduling could be one of explanations: insertion evaluation process is sensible to result comparison order, if results are the same, it will pick the one passed as "right" to comparison operator.

However, I wouldn't ignore possibility of the bugs. My way to tackle such problems would be to disable parallelism and check whether output is deterministic. If not, dive deeper into app state during multiple executions and compare it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants