Skip to content

Remove some unnecessary methods that cause invalidations#694

Open
JamesWrigley wants to merge 1 commit intoJuliaSparse:mainfrom
JamesWrigley:invalidations
Open

Remove some unnecessary methods that cause invalidations#694
JamesWrigley wants to merge 1 commit intoJuliaSparse:mainfrom
JamesWrigley:invalidations

Conversation

@JamesWrigley
Copy link
Copy Markdown
Member

  • A axes(::AbstractQ) already exists in LinearAlgebra that does the same thing.
  • Julia already has a generic Base.size(x, dim) method that uses Base.size(x).

Should fix these invalidations seen when loading CUDA.jl on 1.13:

 inserting size(FC::SparseArrays.CHOLMOD.FactorComponent, i::Integer) @ SparseArrays.CHOLMOD ~/.julia/juliaup/julia-1.13.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/cholmod.jl:1363 invalidated:
   backedges: 1: superseding size(t::AbstractArray, dim) @ Base abstractarray.jl:42 with MethodInstance for size(::AbstractVecOrMat, ::Int64) (9 children)
              2: superseding size(t::AbstractArray, dim) @ Base abstractarray.jl:42 with MethodInstance for size(::AbstractMatrix, ::Int64) (21 children)
              3: superseding size(t::AbstractArray, dim) @ Base abstractarray.jl:42 with MethodInstance for size(::AbstractArray, ::Int64) (21 children)

 inserting axes(Q::SparseArrays.SPQR.QRSparseQ) @ SparseArrays.SPQR ~/.julia/juliaup/julia-1.13.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.13/SparseArrays/src/solvers/spqr.jl:143 invalidated:
   backedges: 1: superseding axes(Q::LinearAlgebra.AbstractQ) @ LinearAlgebra ~/.julia/juliaup/julia-1.13.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.13/LinearAlgebra/src/abstractq.jl:78 with MethodInstance for axes(::LinearAlgebra.AbstractQ) (81 children)
   1 mt_cache

Could we backport this to 1.13?

- A `axes(::AbstractQ)` already exists in LinearAlgebra that does the same
  thing.
- Julia already has a generic `Base.size(x, dim)` method that uses
  `Base.size(x)`.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.31%. Comparing base (3ab784c) to head (0985da3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
- Coverage   84.35%   84.31%   -0.05%     
==========================================
  Files          13       13              
  Lines        9347     9345       -2     
==========================================
- Hits         7885     7879       -6     
- Misses       1462     1466       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ViralBShah ViralBShah added the backport 1.13 Change should be backported to release-1.13 label Apr 6, 2026
@araujoms
Copy link
Copy Markdown
Contributor

araujoms commented Apr 9, 2026

Maybe you want to remove these lines as well:

Base.axes(Q::QRSparseQ) = map(Base.OneTo, size(Q))

axes(A::Union{Dense,Sparse,Factor}) = map(Base.OneTo, size(A))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 1.13 Change should be backported to release-1.13

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants