Skip to content

Allow AlgebraicMultigrid v2 in the AMG extension compat#1047

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:bump-algebraicmultigrid-2-compat
Jun 16, 2026
Merged

Allow AlgebraicMultigrid v2 in the AMG extension compat#1047
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:bump-algebraicmultigrid-2-compat

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Note

Please ignore until reviewed by @ChrisRackauckas. Opened as a draft.

What

One-line [compat] bump for the LinearSolveAlgebraicMultigridExt weak dependency:

-AlgebraicMultigrid = "1"
+AlgebraicMultigrid = "1, 2"

(plus a patch version bump 3.85.13.85.2 so it can be released).

Why

The AMG extension's weak-dependency compat was pinned to AlgebraicMultigrid = "1", which excludes AMG v2.0. Because the modern stack (e.g. OrdinaryDiffEq v7) requires LinearSolve >= 3.60 — exactly the LinearSolve versions that carry this weakdep — AMG 2.0 becomes unsatisfiable alongside it, even though AMG 2.0's own LinearSolve compat is "2 - 3" (which includes the current 3.85.x).

The Julia resolver hides the real edge, reporting things like:

AlgebraicMultigrid restricted by compatibility requirements with LinearSolve to versions: 1.0.0 - 1.2.0 — no versions left

with no transitive explanation. The give-away: replicating AMG 2.0's exact declared dependencies as a top-level project resolves fine with LinearSolve 3.85.1, while the AMG package itself does not — isolating the constraint to this weak-compat edge in LinearSolve.

This was surfaced while fixing the DiffEqDocs.jl build on the OrdinaryDiffEq v7 migration (SciML/DiffEqDocs.jl#869/#870), where AMG 2.0 could not be installed next to the v7 stack.

Extension code is unchanged / already compatible

ext/LinearSolveAlgebraicMultigridExt.jl uses only RugeStubenAMG(), SciMLBase.init(amg_alg, A, b), solve!(solver; maxiter, reltol) and solver.b — all identical between AMG 1.x and 2.0 (AMGSolver{T} still has a .b::Vector{T} field; AMG re-exports CommonSolve.{init, solve!}). No source change is required.

Verification (local, Julia 1.12.6, current General registry)

  • OrdinaryDiffEq 7.0.0 + LinearSolve 3.85.x + AlgebraicMultigrid 2.0.0 + SciMLBase 3.21.0 now resolve together (fails without this bump).
  • The existing AlgebraicMultigridJL test block in test/Core/basictests.jl passes verbatim against AMG 2.0.0 — default Ruge-Stuben, SmoothedAggregationAMG, tight-tolerance solve, and the rectangular-matrix AssertionError (4/4 pass).
  • A 1600×1600 SPD Poisson solve via solve(LinearProblem(A,b), AlgebraicMultigridJL()) on AMG 2.0.0 converges (rel. residual 1.3e-8).

🤖 Generated with Claude Code

The `LinearSolveAlgebraicMultigridExt` weak-dependency compat was pinned to
`AlgebraicMultigrid = "1"`, which excludes AMG v2.0. Because the rest of the
modern stack (e.g. OrdinaryDiffEq v7) requires LinearSolve >= 3.60 — the
versions that carry this weakdep — AMG 2.0 becomes unsatisfiable alongside it,
even though AMG 2.0's own `LinearSolve` compat is `"2 - 3"`. The Julia resolver
reports this as "AlgebraicMultigrid restricted by LinearSolve to 1.0.0 - 1.2.0"
with no transitive explanation.

The extension code is unchanged and already API-compatible with AMG 2.0: it uses
`RugeStubenAMG()`, `SciMLBase.init(amg_alg, A, b)`, `solve!(solver; maxiter,
reltol)`, and `solver.b`, all of which are identical in AMG 1.x and 2.0
(`AMGSolver{T}` still has a `.b::Vector{T}` field; AMG re-exports
`CommonSolve.{init,solve!}`).

Verified locally on Julia 1.12.6 with a current registry:
- `OrdinaryDiffEq 7.0.0 + LinearSolve 3.85.x + AlgebraicMultigrid 2.0.0 +
  SciMLBase 3.21.0` now resolve together.
- The existing `AlgebraicMultigridJL` test block in test/Core/basictests.jl
  passes verbatim against AMG 2.0.0 (Ruge-Stuben, SmoothedAggregation,
  tight-tolerance, and the rectangular-matrix AssertionError).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 16, 2026 09:38
@ChrisRackauckas ChrisRackauckas merged commit 53a1799 into SciML:main Jun 16, 2026
9 of 13 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