Skip to content
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

Statistcs.cov has type stability issues #155

Closed
joa-quim opened this issue Oct 31, 2023 · 1 comment
Closed

Statistcs.cov has type stability issues #155

joa-quim opened this issue Oct 31, 2023 · 1 comment

Comments

@joa-quim
Copy link

At least that's how I interpret the JET report

using JET
using Statistics

@report_opt cov(rand(10,3))
═════ 32 possible errors found ═════
┌ cov(X::Matrix{Float64}) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:584
│┌ cov(X::Matrix{Float64}; dims::Int64, corrected::Bool) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:584
││┌ kwcall(::NamedTuple{(:corrected,), Tuple{Bool}}, ::typeof(Statistics.covm), x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:561
│││┌ covm(x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64; corrected::Bool) @ Statistics C:\workdir\usr\share\julia\stdlib\v1.9\Statistics\src\Statistics.jl:561
...

With 1.10b3

@report_opt cov(rand(10,3))
═════ 190 possible errors found ═════
┌ cov(X::Matrix{Float64}) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:594
│┌ cov(X::Matrix{Float64}; dims::Int64, corrected::Bool) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:594
││┌ kwcall(::@NamedTuple{corrected::Bool}, ::typeof(Statistics.covm), x::Matrix{Float64}, xmean::Matrix{Float64}, vardim::Int64) @ Statistics C:\programs\Julia-1.10\share\julia\stdlib\v1.10\Statistics\src\Statistics.jl:571
│││┌ covm(x::Matrix{Float64}, xmean::Matrix{Fl
@nalimilan
Copy link
Member

I'm not familiar with @report_opt, but looking at the output it seems it reports instabilities which are in functions not living in Statistics.jl, and probably not problematic (e.g. error printing). Please reopen if you have evidence that this creates problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants