Skip to content

Import mul! from LinearAlgebra in butterflylu.jl - #111

Merged
ChrisRackauckas merged 1 commit into
JuliaLinearAlgebra:masterfrom
ChrisRackauckas-Claude:fix-butterfly-mul-import
Aug 8, 2026
Merged

Import mul! from LinearAlgebra in butterflylu.jl#111
ChrisRackauckas merged 1 commit into
JuliaLinearAlgebra:masterfrom
ChrisRackauckas-Claude:fix-butterfly-mul-import

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

⚠️ Draft — please ignore until reviewed by @ChrisRackauckas.

What changed and why

src/butterflylu.jl calls mul! in 🦋solve! and materializeUV but only imports Diagonal and I from LinearAlgebra, so any use of the butterfly path (🦋workspace / 🦋solve!) throws UndefVarError: mul! not defined in RecursiveFactorization — including the 🦋 testset at test/runtests.jl:80 on current master. This adds mul! to the existing using LinearAlgebra: line. Introduced by 0e635a2 ("refactor butterfly into new struct", PR #103), which dropped the file's plain using LinearAlgebra while keeping bare mul! calls; PR #104 later added two more bare mul! calls in 🦋solve!.

Verification (Julia 1.12.4)

Failing before (unmodified master, bc3bb8a):

$ julia -e 'using Pkg; Pkg.activate(mktempdir()); Pkg.develop(path="<clone>"); using RecursiveFactorization; A=rand(64,64); b=rand(64); RecursiveFactorization.🦋workspace(A,b)'
ERROR: UndefVarError: `mul!` not defined in `RecursiveFactorization`
Suggestion: check for spelling errors or missing imports.
Hint: a global variable of this name also exists in LinearAlgebra.
Stacktrace:
 [1] materializeUV(U::Matrix{Float64}, V::Matrix{Float64}, uv::Vector{Float64})
   @ RecursiveFactorization src/butterflylu.jl:176
 [2] RecursiveFactorization.🦋workspace(A::Matrix{Float64}, b::Vector{Float64}, ::Val{888})
   @ RecursiveFactorization src/butterflylu.jl:40

Passing after (same command plus 🦋solve!, with this one-line fix):

workspace+solve OK

Full test suite (Pkg.test("RecursiveFactorization") on this branch):

Test Summary:         | Pass  Total     Time
Test LU factorization | 3120   3120  2m23.8s
Test Summary: | Pass  Total  Time
🦋            |   21     21  2.1s
     Testing RecursiveFactorization tests passed

Not verified: lts and pre CI lanes (ran locally on 1.12.4 only).

🤖 Generated with Claude Code

Commit 0e635a2 ("refactor butterfly into new struct") removed the file's
plain `using LinearAlgebra` while keeping bare `mul!` calls, so any use
of the butterfly path (🦋workspace/🦋solve!) throws
`UndefVarError: mul! not defined in RecursiveFactorization`.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Author

Root-cause refinement from a parallel investigation: the missing-import was latent since 0e635a2, but the reason CI stayed green until now is that butterflylu.jl's using SparseBandedMatrices re-exported mul! (SBM extends LinearAlgebra.mul!), so the binding resolved transitively. SparseBandedMatrices v1.3.4 — registered today, JuliaRegistries/General#163804 — removed that re-export, which is what surfaced the error ecosystem-wide (it currently aborts LinearSolve's GROUP=Core on master via Core/resolve.jl). SBM 1.3.4 still extends LinearAlgebra.mul!; it just stopped re-exporting the name, so importing it from its owner (LinearAlgebra) as this PR does is the correct durable fix rather than a workaround.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 8, 2026 06:57
@ChrisRackauckas
ChrisRackauckas merged commit af99db4 into JuliaLinearAlgebra:master Aug 8, 2026
20 of 21 checks passed
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

Successfully merging this pull request may close these issues.

2 participants