-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Generalized dot test sensitve to numerical precision #712
Comments
Perhaps we should set a random seed somewhere close to the tests, and change that in case RNGs start to produce bad numbers. |
I thought testsets did set a consistent seed, although the result isn't fixed across versions. For example, this passes for me every time on Julia 1.5.0-rc1, and fails every time on 1.4.2: using Test
@testset "stuff" begin
@show rand()
@test rand()>0.5
end |
Any dot product test will be badly conditioned (very sensitive to roundoff error and hence likely to fail the Fortunately, this is a low-probability event, so it should suffice to set the seed. (Even if Julia changes the random-number generator in a future version, there is a low probability that we will need to change the seed.) (Similarly for pretty much any @mcabbott, my understanding is that |
Thanks, sadly I did not get as far as actually reading the docs... Should be simple to fix the seed though, will make a PR unless someone beats me to it. |
The tests at
Compat.jl/test/runtests.jl
Lines 171 to 173 in e667af7
sometimes fail for
Float32
eltype with an error that can probably be attributed to numerical precision issues, e.g.The same tests appear in the LinearAlgebra tests:
https://github.com/JuliaLang/julia/blob/29826c2c0893488dce0d4ee92b457f7f1a586dfb/stdlib/LinearAlgebra/test/generic.jl#L472-L474
So Julia is probably effected as well.
The probability of failing seems to be quite low (around 0.02% in a brief experiment), but it would still be nice to sort this out. CC @dkarrasch who added these tests in julia and @mcabbott who brought them here.
The text was updated successfully, but these errors were encountered: