-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Divide by zero and other issues when detecting outliers #329
Comments
Thank you very much for your feedback and for this detailed bug report!
I guess this could be related to #319 as well, but I did not take a closer look yet. Definitely looks like a problem.
Oh that is bad. The comment of the How could this have gone unnoticed for so long :-/. The only comfort is that the outliers which were not detected are "fast outliers" - which are quite uncommon in practice. |
Fixed in hyperfine v1.11.0. |
When calculating the modified Z-scores, if many of the times are the same, the MAD will be zero (see here), which means this line will divide by zero:
hyperfine/src/hyperfine/outlier_detection.rs
Line 33 in 7cdd1f2
The above link has a simple example that you can add to your test suit to reproduce this issue.
Additionally, the test suite correctly takes the absolute value of the modified Z-scores:
hyperfine/src/hyperfine/outlier_detection.rs
Line 47 in 7cdd1f2
However, the program does not:
hyperfine/src/hyperfine/benchmark.rs
Lines 397 to 400 in 84f3120
Which means that it is missing 50% of the outliers.
I found these issues while testing hyperfine and implementing my Bash port. Thank you for making this wonderful tool!
The text was updated successfully, but these errors were encountered: