Allow AlgebraicMultigrid v2 in the AMG extension compat#1047
Merged
ChrisRackauckas merged 1 commit intoJun 16, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Please ignore until reviewed by @ChrisRackauckas. Opened as a draft.
What
One-line
[compat]bump for theLinearSolveAlgebraicMultigridExtweak dependency:(plus a patch version bump
3.85.1→3.85.2so 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) requiresLinearSolve >= 3.60— exactly the LinearSolve versions that carry this weakdep — AMG 2.0 becomes unsatisfiable alongside it, even though AMG 2.0's ownLinearSolvecompat is"2 - 3"(which includes the current 3.85.x).The Julia resolver hides the real edge, reporting things like:
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.jluses onlyRugeStubenAMG(),SciMLBase.init(amg_alg, A, b),solve!(solver; maxiter, reltol)andsolver.b— all identical between AMG 1.x and 2.0 (AMGSolver{T}still has a.b::Vector{T}field; AMG re-exportsCommonSolve.{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.0now resolve together (fails without this bump).AlgebraicMultigridJLtest block intest/Core/basictests.jlpasses verbatim against AMG 2.0.0 — default Ruge-Stuben,SmoothedAggregationAMG, tight-tolerance solve, and the rectangular-matrixAssertionError(4/4 pass).solve(LinearProblem(A,b), AlgebraicMultigridJL())on AMG 2.0.0 converges (rel. residual 1.3e-8).🤖 Generated with Claude Code