JuliaLinearAlgebra / ArrayLayouts.jl

A Julia package for describing array layouts and more general fast linear algebra
https://julialinearalgebra.github.io/ArrayLayouts.jl/
MIT License
54 stars 10 forks source link

Resolve stack-overflow in Diagonal*Bidiagonal and (Sym)Tridiagonal #242

Open jishnub opened 2 months ago

jishnub commented 2 months ago

Currently, there are method ambiguities on v1.10, because of which these paths were not being tested. These ambiguities are resolved on the currently nightly, which reveals a stack-overflow in these methods. This arises because an operation like

(D::Diagonal{<:Any, <:LayoutVector}) * (B::Bidiagonal{<:Any, <:LayoutVector})

internally calls

copy(M::Lmul{<:DiagonalLayout,<:BidiagonalLayout})

but this method was calling D * B again, leading to a cycle. To avoid this, we now broadcast D.diag over the other matrix. The added tests all work on nightly where there are no method ambiguities anymore, and the Bidiagonal ones work on current versions as well.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (d315ce3) to head (77bfc17).

Files Patch % Lines
src/diagonal.jl 0.00% 23 Missing :warning:

:exclamation: There is a different number of reports uploaded between BASE (d315ce3) and HEAD (77bfc17). Click for more details.

HEAD has 7 uploads less than BASE | Flag | BASE (d315ce3) | HEAD (77bfc17) | |------|------|------| ||12|5|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #242 +/- ## ========================================== - Coverage 90.43% 0.00% -90.44% ========================================== Files 11 11 Lines 1902 1814 -88 ========================================== - Hits 1720 0 -1720 - Misses 182 1814 +1632 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.