-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
[FEATURE] Seed the randomness for deterministic model based test generation #318
Comments
To do the testing in the proper way, we need to have it both ways:
|
I am reading the z3 docs, and the developers say that z3 should be deterministic. The default seed is 0. Are we sure that we get non-determinism from z3? @andrey-kuprianov, you can produce the smt log with I will add an option to set the seed. But it may happen that non-determinism is also on our side. |
well, the outcome is that smt logging seems to be broken. first, it's
|
That's weird. It used to work pretty well. Are you feeding this back to z3? |
|
Oh wait. The last four lines are the output of the sat model. Just delete all these things. |
I have added #320 on that issue. But if you remove the model output at the end of the log, it should work. |
That command seems to produce stable results: z3 -smt2 smt.random_seed=1 sat.random_seed=1 log0.smt However, setting |
The code in this branch sets all random seeds to 0 by default, or to the value passed as When I run Apalache in Intellij Idea on @andrey-kuprianov can you try this branch and see, whether you also get different results on |
Related discussion on stackoverflow: https://stackoverflow.com/questions/47839976/z3-producing-different-models-when-run-multiple-times |
The observation that it worked with Intellij Idea led me to try different versions on java.
z3 behaves non-deterministcally
z3 behaves deterministically (on Rand.tla) We need JDK8 to compile scala, but the compiled code should work in later JREs too. So I guess the current solution will be to run MBT in JRE9 or later. |
implement #318: setting random_seed in z3
It should work unless you are using Java 8 |
Is your feature request related to a problem? Please describe.
Currently every time we regenerate tests we get new ones.
Describe the solution you'd like
A way to regenerate the same set of tests, typically in a case where we've changed some data structure on the Rust side but otherwise want to be testing the same scenario.
The text was updated successfully, but these errors were encountered: