-
Notifications
You must be signed in to change notification settings - Fork 586
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
RuleBasedStateMachine is prone to Unsatisfiable errors #3618
Comments
|
@Zac-HD I see why you tagged this In order to work around this issue, we need to make sure that all our composite strategies rarely or never mark examples as invalid; i.e, we basically cannot use Specifically, we have to do the opposite of what the Hypothesis docs recommend for composite strategies: https://hypothesis.readthedocs.io/en/latest/data.html#composite-strategies. In the |
|
This turned out to be pretty simple in the end! I thought that #3894 might have helped, but it didn't at all - and at that point I was pretty confident that it wasn't actually due to filtering too much at all. Instead, it turned out to be trying to generate too much data; the fix is simply to stop taking additional steps if we've already generated 80% as much data as is possible. (we could tune it more precisely based on how many steps we've taken so far, but it's not really worth the trouble) So why did avoiding filters seem to help? My best guess is that it's because your filter-free strategies (a) don't generate-and-discard when attempting to satisfy the filter, and (b) might generate smaller and simpler inputs overall. Happily, you'll now be able to use the same strategies across |
Hypothesis has made [many improvements](https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/docs/changes.rst) in the last few months, including closing issues like HypothesisWorks/hypothesis#3618. Hoping that this will fix the recent error > Data generation is extremely slow: Only produced 9 valid examples in 225.14 seconds (0 invalid ones and 744 exceeded maximum size). Try decreasing size of the data you're generating (with e.g. max_size or max_leaves parameters). (https://github.com/chroma-core/chroma/actions/runs/9505770742/job/26201473178) or at least provide a better place to start debugging from. (Seems like this error may have started occurring after #2297 was merged.) Note: hypothesis was originally pegged in #1760.
Hypothesis has made [many improvements](https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/docs/changes.rst) in the last few months, including closing issues like HypothesisWorks/hypothesis#3618. Hoping that this will fix the recent error > Data generation is extremely slow: Only produced 9 valid examples in 225.14 seconds (0 invalid ones and 744 exceeded maximum size). Try decreasing size of the data you're generating (with e.g. max_size or max_leaves parameters). (https://github.com/chroma-core/chroma/actions/runs/9505770742/job/26201473178) or at least provide a better place to start debugging from. (Seems like this error may have started occurring after chroma-core#2297 was merged.) Note: hypothesis was originally pegged in chroma-core#1760.
A state machine frequently ends up as
hypothesis.errors.Unsatisfiablewhen the input strategies to its rules themselves are frequently marked as invalid.For example,
Yields:
This is the minimal example I could find, my actual state machine is much larger but exhibits the same error.
The state machine works fine when used with simpler or more reliable strategy. '
The
st.lists(st.text(), min_size=5, unique=True)strategy also fine when used with@given(i.e. not in a state machine), although the stats show that it does frequently return invalid examples.The text was updated successfully, but these errors were encountered: