events for more mark_invalid() cases #3654
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
why
argument toConjectureData.mark_invalid()
(andmany.reject()
which can call through to it), which can optionally take a string description of the reason for the data to be marked as invalid, and will record an event.I didn't try to ensure that every single callsite now provides these arguments (there can always be follow-up PRs to add more where it seems useful), but I covered the ones where I felt able to provide something (hopefully) sensible.
The specific case I wanted to cover was
MAX_DEPTH
invalidation, since I have a use case where I'm getting >99% invalidation due to that, and prior to this PR it was invisible in the statistics, making me dive into internals to understand what was happening. With this PR I now see:I think ideally this message would give more info on what the user can do to avoid this, but at the moment I don't know enough to say more than maybe "use less recursive strategies."
See #3643 for discussion.