-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add fuel to match checking #16879
Add fuel to match checking #16879
Conversation
Running if skip_slow_tests() {
return;
} in front given usually the test runs in debug. With that it gets skipped by default when people run the test suite (while CI will still always run it). |
I'll make the test even bigger actually, to be sure it hangs CI if we regress ^^ |
Thanks 👍 |
☀️ Test successful - checks-actions |
Exhaustiveness checking is NP-hard hence can take extremely long to check some specific matches. This PR makes ehxaustiveness bail after a set number of steps. I chose a bound that takes ~100ms on my machine, which should be more than enough for normal matches.
I'd like someone with less recent hardware to run the test to see if that limit is low enough for them. Also curious if the r-a team thinks this is a good ballpark or if we should go lower/higher. I don't have much data on how complex real-life matches get, but we can definitely go lower than
500 000
steps.The second commit is a drive-by soundness fix which doesn't matter much today but will matter once
min_exhaustive_patterns
is stabilized.Fixes #9528 cc @matklad