Skip to content

Require TriangularSolve 0.2.2 for the native upper-triangular ldiv! - #112

Merged
ChrisRackauckas merged 1 commit into
JuliaLinearAlgebra:masterfrom
ChrisRackauckas-Claude:ts-native-upper-ldiv
Aug 8, 2026
Merged

Require TriangularSolve 0.2.2 for the native upper-triangular ldiv!#112
ChrisRackauckas merged 1 commit into
JuliaLinearAlgebra:masterfrom
ChrisRackauckas-Claude:ts-native-upper-ldiv

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown

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

🚧 Blocked on TriangularSolve 0.2.2 being merged and registered (native upper-triangular ldiv!, prepared at ChrisRackauckas-Claude/TriangularSolve.jl upper-ldiv; spec in SciML/LinearSolve.jl#1146). Until it is registered, CI here fails at Pkg resolution because the 0.2.2 lower bound does not exist yet.

What changed and why

Compat-only: require TriangularSolve = "0.2.2" and bump this package to 0.2.27. TriangularSolve 0.2.2 adds ldiv!(::UpperTriangular, ::AbstractMatrix), so the U leg of the pivotless (NotIPIV) LU ldiv! in src/lu.jl — which already calls TriangularSolve.ldiv! on both legs — now dispatches to a native SIMD kernel instead of silently falling through TriangularSolve's catch-all to BLAS trsm. No code change is needed here.

Verification

Full test suite run locally (Julia 1.12.4, AMD EPYC 7502) with the TriangularSolve upper-ldiv branch Pkg.developed:

Test Summary:         | Pass  Total     Time
Test LU factorization | 3120   3120  2m28.0s

The 🦋 testset errors on this branch and on unmodified master with UndefVarError: mul! not defined in RecursiveFactorization — a pre-existing master breakage introduced by 0e635a2 (see the bisect + one-line fix in #111, which this PR depends on for green CI). It is unrelated to this compat change.

Solve-only kernel benchmark backing the change (Float64, nrhs=8, 1 BLAS thread, EPYC 7502/AVX2; U-leg comparison of LinearAlgebra.ldiv! (BLAS trsm, the old fallback) vs TriangularSolve.ldiv! 0.2.2 native):

  n     trsm        TS native
  64      4.09 us    1.78 us   (2.3x)
  128    12.36 us    6.27 us   (2.0x)
  256    49.18 us   22.04 us   (2.2x)
  500   154.79 us   79.64 us   (1.9x)

What was not verified

🤖 Generated with Claude Code

TriangularSolve 0.2.2 adds ldiv!(::UpperTriangular, ::AbstractMatrix), so
the U leg of the pivotless LU ldiv! in src/lu.jl now hits a native SIMD
kernel instead of silently falling through TriangularSolve's catch-all to
BLAS trsm. No code change needed here; the call site already routes both
legs through TriangularSolve.ldiv!.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 8, 2026 07:59
@ChrisRackauckas
ChrisRackauckas merged commit 366295b into JuliaLinearAlgebra:master Aug 8, 2026
0 of 19 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