-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
LinearAlgebra: unstable return value, affected by lazy string & @show
in error path
#1064
Comments
Oscar here (grabbed Ian's phone) |
Thanks for the ping. I'll look into it. |
It appears that this error is caused by the using LineaAlgebra, Test
for _ = 1:100; begin
n = 10
areal = randn(n,n)/2
a = convert(Matrix{Float64}, areal)
aherm = a' + a
@test tr(aherm) == tr(Hermitian(aherm))
aimg = randn(n,n)/2
areal = randn(n,n)/2
a = convert(Matrix{ComplexF32}, complex.(areal, aimg))
aherm = a' + a
@test tr(aherm) == tr(Hermitian(aherm))
end; end |
After investigating JuliaLang/julia#54090, I found that the issue was not caused by the effects of `checksquare`, but by the use of the `@simd` macro within `tr(::Matrix)`: https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380 While simply removing the `@simd` macro was considered, the strict left-to-right summation without `@simd` otherwise is not necessarily more accurate, so I concluded that the problem lies in the test code, which tests the (strict) equality of two different `tr` execution results. I have modified the test code to use `≈` instead of `==`. - fixes #54090
…c.jl After investigating JuliaLang/julia#54090, I found that the issue was not caused by the effects of `checksquare`, but by the use of the `@simd` macro within `tr(::Matrix)`: https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380 While simply removing the `@simd` macro was considered, the strict left-to-right summation without `@simd` otherwise is not necessarily more accurate, so I concluded that the problem lies in the test code, which tests the (strict) equality of two different `tr` execution results. I have modified the test code to use `≈` instead of `==`. - fixes #54090
Thanks for investigating & fixing. I had thought this was a return type change from real to complex, hence the alarm. |
@show
in error path@show
in error path
…#55143) After investigating JuliaLang/julia#54090, I found that the issue was not caused by the effects of `checksquare`, but by the use of the `@simd` macro within `tr(::Matrix)`: https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380 While simply removing the `@simd` macro was considered, the strict left-to-right summation without `@simd` otherwise is not necessarily more accurate, so I concluded that the problem lies in the test code, which tests the (strict) equality of two different `tr` execution results. I have modified the test code to use `≈` instead of `==`. - fixes #54090
…#55143) After investigating JuliaLang/julia#54090, I found that the issue was not caused by the effects of `checksquare`, but by the use of the `@simd` macro within `tr(::Matrix)`: https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380 While simply removing the `@simd` macro was considered, the strict left-to-right summation without `@simd` otherwise is not necessarily more accurate, so I concluded that the problem lies in the test code, which tests the (strict) equality of two different `tr` execution results. I have modified the test code to use `≈` instead of `==`. - fixes #54090
… (#55143) After investigating JuliaLang/julia#54090, I found that the issue was not caused by the effects of `checksquare`, but by the use of the `@simd` macro within `tr(::Matrix)`: https://github.com/JuliaLang/julia/blob/0945b9d7740855c82a09fed42fbf6bc561e02c77/stdlib/LinearAlgebra/src/dense.jl#L373-L380 While simply removing the `@simd` macro was considered, the strict left-to-right summation without `@simd` otherwise is not necessarily more accurate, so I concluded that the problem lies in the test code, which tests the (strict) equality of two different `tr` execution results. I have modified the test code to use `≈` instead of `==`. - fixes #54090
Seen on this 1.10 backports PR JuliaLang/julia#53714 but the problematic commit was reverted on that PR
feceefe
(#53714)Quoting JuliaLang/julia#53714 (comment)
I confirmed locally that this error was introduced by
feceefe
(#53714)which is weird for just a change switching to lazy strings?
Specifically, reverting just this one makes tests pass
https://github.com/JuliaLang/julia/blob/97b0571cbd74cfc7959fe065b5dfc47d0636fc4e/stdlib/LinearAlgebra/src/LinearAlgebra.jl#L241
Also leaving it lazy and adding a
@show m
under that line makes test passThe text was updated successfully, but these errors were encountered: