-
Notifications
You must be signed in to change notification settings - Fork 275
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
simulator: add counterexample minimization #623
base: main
Are you sure you want to change the base?
Conversation
…perations that did not reflect the internal structure, in which they were actually concatenations of properties, which are a coherent set of interactions that are meaningful by themselves. this commit introduces this semantic layer into the data model by turning interaction plans into a sequence of properties, which are a sequence of interactions
the execution of the current property and switches to the next one.
three indexes(connection, interaction pointer, and secondary pointer) that can uniquely identify the executed interaction at any point. we will use the history for shrinking purposes.
This looks quite cool @alpaylan. Could you post some literature you think is relevant for this? |
Thanks @pereman2 ! Of course, here are some rather informal writing discussing different shrinking strategies(warning: they're quite opinionated with respect to author's position, which I don't agree)
Two other informal articles, ECOOP20 paper from the hypothesis author, I view shrinking very related to delta debugging, which I think is a lot more used in the literature. I have a submission that discusses shrinking too, I'm not sure if sharing it here breaks double blind, but I can send it over email if you would like. |
I thought this page had a nice layman definition for shrinking:
We could even add it to our code |
@@ -251,31 +283,67 @@ impl Interaction { | |||
Self::Assertion(_) => { | |||
unreachable!("unexpected: this function should only be called on queries") | |||
} | |||
Interaction::Fault(_) => { | |||
Self::Assumption(_) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw you can just do sth like
_ => unreachable!("unexpected: ...")
to reduce some lines-of-code noise from the pattern matching. or alternatively
if let Self::Query(query) = self {
...
} else {
unreachable!(...)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice touch, adding it in the next commit.
The shrinking is a bit harder than I hoped for, particularly due to the fact that we cannot shrink closures, which limits our ability to minimize aggressively by removing columns from tables, because we wouldn't be able to modify the assertion that checks it. The solution is to turn the assertions themselves into a small DSL, but at that point it goes into too much research, which I don't think is the right choice for now. I've instead focused on other shrinking mechanisms;
|
This PR introduces counterexample minimization(shrinking) in the simulator. It will require changes to the current structure in various places, so I've opened it as a draft PR for now, in order to not overwhelm the reviewers all at once.