Skip to content

Matrix-RHS adjoint/transpose matvec falls through to the generic dense fallback — ~3000x slowdown #8

@ChrisRackauckas-Claude

Description

@ChrisRackauckas-Claude

WHAT: Only vector adjoint/transpose mul! are defined (src/matvec.jl:163-171). mul!(Y, A', X) / A'*X for a matrix X dispatches to LinearAlgebra's generic fallback, which materializes columns of A' via getindex. Measured (n=5000, 10 cols): 17.4 s for 20 calls vs 0.0058 s for a structured per-column loop (bit-identical) — a 3007x slowdown. WHY IT MATTERS: This is the exact '~1000x slower' cliff the matvec.jl comment warns about, fixed for vectors but not matrices. Any block/multi-RHS adjoint (block iterative least squares, lstsq's A'*res on a matrix) silently hits it, and the gap went unnoticed because the adjoint matvec is untested (see the coverage issue). FIX: Add mul!(Y::AbstractMatrix, wA::Adjoint/Transpose{<:SparseWithDenseRowColMatrix}, X::AbstractMatrix, α, β) — a matrix analogue of _adjoint_matvec!: mul!(Y, Sop(A.S), X, α, β) then the rank-r block correction Y .+= α Vᴴ(Uᴴ X) (cheap r×ncols block, r≪n), plus the Base.:* matrix wrapper. EFFORT: S-M.


Priority: high. Filed from an automated next-steps audit of the QR/lstsq work (see PR #6).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions