-
Notifications
You must be signed in to change notification settings - Fork 317
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
criterion panicking with slice.len() > 1 && slice.iter().all(|x| !x.is_nan())
#720
Comments
It's entirely possible that repro case may not 100% repro as written on random machines. It looks like the number of elements & maybe the speed of the machine is relevant (I'm running that benchmark on a 13900K). I'm curious if my absolutely blind ignorant hunch is that there's integer math somewhere that ends up with a 0 due to some integer division and is then the numerator for a floating point operation which results in a NaN. I'd love to help track down the bug but I don't know where to start. |
So tracked this down a bit further. Looks like the values being plotted are all the same. This results in a stddev of 0 when estimating the KDE bandwidth within |
Hah. There's even a comment trying to address this.
Likely what's happening is that when values are large (in my case the test is taking 30s), the Replacing it with
where next_up is ported from the std library fixes the issue I think (at least for this repro that I have). |
Put up a minimal repro here: https://github.com/vlovich/criterion-bug-repro
Notice below that the 5 Gelem/s number is total garbage (+ the NaN in the output). The "Took Xs or N Kelements/s" is printed by the benchmark directly. So something is causing garbage in criterion's measurements (looks like something is injecting NaN).
When HTML reports are enabled, the benchmark crashes because of the NaNs.
Maybe the problem is somehow too many elements?
HTML report crash (backend doesn't matter - both gnuplot and plotter fail the same way).
The text was updated successfully, but these errors were encountered: