Solvers

Solver list

Problem typeSolvers
Unconstrained Nonlinear Optimization Problemlbfgs, tron, trunk, R2, fomo, R2N
Unconstrained Nonlinear Least Squarestrunk, tron, R2NLS
Bound-constrained Nonlinear Optimization Problemtron
Bound-constrained Nonlinear Least Squarestron

Solver list

JSOSolvers.lbfgs — Function
lbfgs(nlp; kwargs...)

An implementation of a limited memory BFGS line-search method for unconstrained minimization.

For advanced usage, first define a LBFGSSolver to preallocate the memory used in the algorithm, and then call solve!.

solver = LBFGSSolver(nlp; mem::Int = 5)
solve!(solver, nlp; kwargs...)

Arguments

  • nlp::AbstractNLPModel{T, V} represents the model to solve, see NLPModels.jl.

The keyword arguments may include

  • x::V = nlp.meta.x0: the initial guess.
  • mem::Int = 5: algorithm parameter, see LBFGSParameterSet.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance, the algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • callback: function called at each iteration, see Callback section.
  • max_eval::Int = -1: maximum number of objective function evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • τ₁::T = T(0.9999): algorithm parameter, see LBFGSParameterSet.
  • bk_max:: Int = 25: algorithm parameter, see LBFGSParameterSet.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • verbose_subsolver::Int = 0: if > 0, display iteration information every verbose_subsolver iteration of the subsolver.

Output

The returned value is a GenericExecutionStats, see SolverCore.jl.

Examples

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3));
stats = lbfgs(nlp)

# output

"Execution stats: first-order stationary"
using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3));
solver = LBFGSSolver(nlp; mem = 5);
stats = solve!(solver, nlp)

# output

"Execution stats: first-order stationary"
source
JSOSolvers.tron — Function
tron(nlp; kwargs...)

A pure Julia implementation of a trust-region solver for bound-constrained optimization:

    min f(x)    s.t.    ℓ ≦ x ≦ u

For advanced usage, first define a TronSolver to preallocate the memory used in the algorithm, and then call solve!:

solver = TronSolver(nlp; kwargs...)
solve!(solver, nlp; kwargs...)

Arguments

  • nlp::AbstractNLPModel{T, V} represents the model to solve, see NLPModels.jl.

The keyword arguments may include

  • x::V = nlp.meta.x0: the initial guess.
  • μ₀::T = T(1 / 100): algorithm parameter, see TRONParameterSet.
  • μ₁::T = T(1): algorithm parameter, see TRONParameterSet.
  • σ::T = T(10): algorithm parameter, see TRONParameterSet.
  • max_eval::Int = -1: maximum number of objective function evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • max_cgiter::Int = 50: subproblem's iteration limit.
  • use_only_objgrad::Bool = false: If true, the algorithm uses only the function objgrad instead of obj and grad.
  • cgtol::T = T(0.1): subproblem tolerance.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance, the algorithm stops when ‖x - Proj(x - ∇f(xᵏ))‖ ≤ atol + rtol * ‖∇f(x⁰)‖. Proj denotes here the projection over the bounds.
  • callback: function called at each iteration, see Callbacks section.
  • callback_quasi_newton: function called at each iteration, specifically to update the Hessian approximation of quasi-Newton models, see Callbacks section.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • subsolver_verbose::Int = 0: if > 0, display iteration information every subsolver_verbose iteration of the subsolver.

The keyword arguments of TronSolver are passed to the TRONTrustRegion constructor.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

References

TRON is described in

Chih-Jen Lin and Jorge J. Moré, *Newton's Method for Large Bound-Constrained
Optimization Problems*, SIAM J. Optim., 9(4), 1100–1127, 1999.
DOI: 10.1137/S1052623498345075

Examples

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x), ones(3), zeros(3), 2 * ones(3));
stats = tron(nlp)
using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x), ones(3), zeros(3), 2 * ones(3));
solver = TronSolver(nlp);
stats = solve!(solver, nlp)
source
tron(nls; kwargs...)

A pure Julia implementation of a trust-region solver for bound-constrained nonlinear least-squares problems:

min ½‖F(x)‖²    s.t.    ℓ ≦ x ≦ u

For advanced usage, first define a TronSolverNLS to preallocate the memory used in the algorithm, and then call solve!: solver = TronSolverNLS(nls, subsolver::Symbol=:lsmr; kwargs...) solve!(solver, nls; kwargs...)

Arguments

  • nls::AbstractNLSModel{T, V} represents the model to solve, see NLPModels.jl.

The keyword arguments may include

  • x::V = nlp.meta.x0: the initial guess.
  • subsolver::Symbol = :lsmr: Krylov.jl method used as subproblem solver, see JSOSolvers.tronls_allowed_subsolvers for a list.
  • μ₀::T = T(1 / 100): algorithm parameter, see TRONLSParameterSet.
  • μ₁::T = T(1): algorithm parameter, see TRONLSParameterSet.
  • σ::T = T(10): algorithm parameter, see TRONLSParameterSet.
  • max_eval::Int = -1: maximum number of objective function evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • max_cgiter::Int = 50: subproblem iteration limit.
  • cgtol::T = T(0.1): subproblem tolerance.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance, the algorithm stops when ‖x - Proj(x - ∇f(xᵏ))‖ ≤ atol + rtol * ‖∇f(x⁰)‖. Proj denotes here the projection over the bounds.
  • Fatol::T = √eps(T): absolute tolerance on the residual.
  • Frtol::T = eps(T): relative tolerance on the residual, the algorithm stops when ‖F(xᵏ)‖ ≤ Fatol + Frtol * ‖F(x⁰)‖.
  • callback: function called at each iteration, see Callback section.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • subsolver_verbose::Int = 0: if > 0, display iteration information every subsolver_verbose iteration of the subsolver.

The keyword arguments of TronSolverNLS are passed to the TRONTrustRegion constructor.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

References

This is an adaptation for bound-constrained nonlinear least-squares problems of the TRON method described in

Chih-Jen Lin and Jorge J. Moré, *Newton's Method for Large Bound-Constrained
Optimization Problems*, SIAM J. Optim., 9(4), 1100–1127, 1999.
DOI: 10.1137/S1052623498345075

Examples

using JSOSolvers, ADNLPModels
F(x) = [x[1] - 1.0; 10 * (x[2] - x[1]^2)]
x0 = [-1.2; 1.0]
nls = ADNLSModel(F, x0, 2, zeros(2), 0.5 * ones(2))
stats = tron(nls)
using JSOSolvers, ADNLPModels
F(x) = [x[1] - 1.0; 10 * (x[2] - x[1]^2)]
x0 = [-1.2; 1.0]
nls = ADNLSModel(F, x0, 2, zeros(2), 0.5 * ones(2))
solver = TronSolverNLS(nls)
stats = solve!(solver, nls)
source
JSOSolvers.trunk — Function
trunk(nlp; kwargs...)

A trust-region solver for unconstrained optimization using exact second derivatives.

For advanced usage, first define a TrunkSolver to preallocate the memory used in the algorithm, and then call solve!:

solver = TrunkSolver(nlp, subsolver::Symbol = :cg)
solve!(solver, nlp; kwargs...)

Arguments

  • nlp::AbstractNLPModel{T, V} represents the model to solve, see NLPModels.jl.

The keyword arguments may include

  • subsolver_logger::AbstractLogger = NullLogger(): subproblem's logger.
  • x::V = nlp.meta.x0: the initial guess.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance, the algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • callback: function called at each iteration, see Callbacks section.
  • callback_quasi_newton: function called at each iteration, specifically to update the Hessian approximation of quasi-Newton models, see Callbacks section.
  • max_eval::Int = -1: maximum number of objective function evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • bk_max::Int = 10: algorithm parameter, see TRUNKParameterSet.
  • monotone::Bool = true: algorithm parameter, see TRUNKParameterSet.
  • nm_itmax::Int = 25: algorithm parameter, see TRUNKParameterSet.
  • verbose::Int = 0: if > 0, display iteration information every verbose iteration.
  • subsolver_verbose::Int = 0: if > 0, display iteration information every subsolver_verbose iteration of the subsolver.
  • M: linear operator that models a Hermitian positive-definite matrix of size n; passed to Krylov subsolvers.

Output

The returned value is a GenericExecutionStats, see SolverCore.jl.

References

This implementation follows the description given in

A. R. Conn, N. I. M. Gould, and Ph. L. Toint,
Trust-Region Methods, volume 1 of MPS/SIAM Series on Optimization.
SIAM, Philadelphia, USA, 2000.
DOI: 10.1137/1.9780898719857

The main algorithm follows the basic trust-region method described in Section 6. The backtracking linesearch follows Section 10.3.2. The nonmonotone strategy follows Section 10.1.3, Algorithm 10.1.2.

Examples

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
stats = trunk(nlp)
using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
solver = TrunkSolver(nlp)
stats = solve!(solver, nlp)
source
trunk(nls; kwargs...)

A pure Julia implementation of a trust-region solver for nonlinear least-squares problems:

min ½‖F(x)‖²

For advanced usage, first define a TrunkSolverNLS to preallocate the memory used in the algorithm, and then call solve!:

solver = TrunkSolverNLS(nls, subsolver::Symbol = :lsmr)
solve!(solver, nls; kwargs...)

Arguments

  • nls::AbstractNLSModel{T, V} represents the model to solve, see NLPModels.jl.

The keyword arguments may include

  • x::V = nlp.meta.x0: the initial guess.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance, the algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • Fatol::T = √eps(T): absolute tolerance on the residual.
  • Frtol::T = eps(T): relative tolerance on the residual, the algorithm stops when ‖F(xᵏ)‖ ≤ Fatol + Frtol * ‖F(x⁰)‖.
  • callback: function called at each iteration, see Callback section.
  • max_eval::Int = -1: maximum number of objective function evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • bk_max::Int = 10: algorithm parameter, see TRUNKLSParameterSet.
  • monotone::Bool = true: algorithm parameter, see TRUNKLSParameterSet.
  • nm_itmax::Int = 25: algorithm parameter, see TRUNKLSParameterSet.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • subsolver_verbose::Int = 0: if > 0, display iteration information every subsolver_verbose iteration of the subsolver.

See JSOSolvers.trunkls_allowed_subsolvers for a list of available Krylov solvers.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

References

This implementation follows the description given in

A. R. Conn, N. I. M. Gould, and Ph. L. Toint,
Trust-Region Methods, volume 1 of MPS/SIAM Series on Optimization.
SIAM, Philadelphia, USA, 2000.
DOI: 10.1137/1.9780898719857

The main algorithm follows the basic trust-region method described in Section 6. The backtracking linesearch follows Section 10.3.2. The nonmonotone strategy follows Section 10.1.3, Algorithm 10.1.2.

Examples

using JSOSolvers, ADNLPModels
F(x) = [x[1] - 1.0; 10 * (x[2] - x[1]^2)]
x0 = [-1.2; 1.0]
nls = ADNLSModel(F, x0, 2)
stats = trunk(nls)
using JSOSolvers, ADNLPModels
F(x) = [x[1] - 1.0; 10 * (x[2] - x[1]^2)]
x0 = [-1.2; 1.0]
nls = ADNLSModel(F, x0, 2)
solver = TrunkSolverNLS(nls)
stats = solve!(solver, nls)
source
JSOSolvers.R2 — Function
fo(nlp; kwargs...)
R2(nlp; kwargs...)
TR(nlp; kwargs...)

A First-Order (FO) model-based method for unconstrained optimization. Supports quadratic regularization and trust region method with linear model.

For advanced usage, first define a FomoSolver to preallocate the memory used in the algorithm, and then call solve!:

solver = FoSolver(nlp)
solve!(solver, nlp; kwargs...)

R2 and TR runs fo with the dedicated step_backend keyword argument.

Arguments

  • nlp::AbstractNLPModel{T, V} is the model to solve, see NLPModels.jl.

Keyword arguments

  • x::V = nlp.meta.x0: the initial guess.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance: algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • η1 = eps(T)^(1 // 4): algorithm parameter, see FOMOParameterSet.
  • η2 = T(95/100): algorithm parameter, see FOMOParameterSet.
  • γ1 = T(1/2): algorithm parameter, see FOMOParameterSet.
  • γ2 = T(2): algorithm parameter, see FOMOParameterSet.
  • αmax = 1/eps(T): algorithm parameter, see FOMOParameterSet.
  • α0 = T(0): algorithm parameter, see FOMOParameterSet.
  • max_eval::Int = -1: maximum number of evaluation of the objective function.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • M = 1 : algorithm parameter, see FOMOParameterSet.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • step_backend = r2_step(): algorithm parameter, see FOMOParameterSet.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

Examples

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
stats = fo(nlp) # run with step_backend = r2_step(), equivalent to R2(nlp)

# output

"Execution stats: first-order stationary"
using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
solver = FoSolver(nlp);
stats = solve!(solver, nlp)

# output

"Execution stats: first-order stationary"
source
JSOSolvers.fomo — Function
fomo(nlp; kwargs...)

A First-Order with MOmentum (FOMO) model-based method for unconstrained optimization. Supports quadratic regularization and trust region method with linear model.

Algorithm description

The step is computed along d = - (1-βmax) .* ∇f(xk) - βmax .* mk with mk the memory of past gradients (initialized at 0), and updated at each successful iteration as mk .= ∇f(xk) .* (1 - βmax) .+ mk .* βmax and βmax ∈ [0,β] chosen as to ensure d is gradient-related, i.e., the following 2 conditions are satisfied: (1-βmax) .* ∇f(xk) + βmax .* ∇f(xk)ᵀmk ≥ θ1 * ‖∇f(xk)‖² (1) ‖∇f(xk)‖ ≥ θ2 * ‖(1-βmax) . ∇f(xk) + βmax . mk‖ (2) In the nonmonotone case, (1) rewrites (1-βmax) .* ∇f(xk) + βmax .* ∇f(xk)ᵀmk + (fm - fk)/μk ≥ θ1 * ‖∇f(xk)‖², with fm the largest objective value over the last M successful iterations, and fk = f(xk).

Advanced usage

For advanced usage, first define a FomoSolver to preallocate the memory used in the algorithm, and then call solve!:

solver = FomoSolver(nlp)
solve!(solver, nlp; kwargs...)

No momentum: if the user does not whish to use momentum (β = 0), it is recommended to use the memory-optimized fo method.

Arguments

  • nlp::AbstractNLPModel{T, V} is the model to solve, see NLPModels.jl.

Keyword arguments

  • x::V = nlp.meta.x0: the initial guess.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance: algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • callback: function called at each iteration, see Callback section.
  • η1 = eps(T)^(1 // 4), η2 = T(95/100): step acceptance parameters.
  • γ1 = T(1/2), γ2 = T(2): regularization update parameters.
  • γ3 = T(1/2) : momentum factor βmax update parameter in case of unsuccessful iteration.
  • αmax = 1/eps(T): maximum step parameter for fomo algorithm.
  • α0 = T(0): initial value of the step parameter (capped by αmax); if 0, it is chosen from the initial gradient norm.
  • max_eval::Int = -1: maximum number of objective evaluations.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • β = T(9/10) ∈ [0,1): target decay rate for the momentum.
  • θ1 = T(1/10): momentum contribution parameter for convergence condition (1).
  • θ2 = eps(T)^(1/3): momentum contribution parameter for convergence condition (2).
  • M = 1 : requires objective decrease over the M last iterates (nonmonotone context). M=1 implies monotone behaviour.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • step_backend = r2_step(): step computation mode. Options are r2_step() for quadratic regulation step and tr_step() for first-order trust-region.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

Examples

fomo

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
stats = fomo(nlp)

# output

"Execution stats: first-order stationary"
using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
solver = FomoSolver(nlp);
stats = solve!(solver, nlp)

# output

"Execution stats: first-order stationary"
source
JSOSolvers.R2N — Function
R2N(nlp; kwargs...)

A second-order quadratic regularization method for unconstrained optimization (with shifted L-BFGS or shifted Hessian operator).

min f(x)

For advanced usage, first define a R2NSolver to preallocate the memory used in the algorithm, and then call solve!:

solver = R2NSolver(nlp)
solve!(solver, nlp; kwargs...)

Arguments

  • nlp::AbstractNLPModel{T, V} is the model to solve, see NLPModels.jl.

Keyword arguments

  • η1::T = eps(T)^(1/4): step acceptance parameter, see R2NParameterSet.
  • η2::T = T(0.95): step acceptance parameter, see R2NParameterSet.
  • θ1::T = T(0.9): Cauchy step parameter, see R2NParameterSet.
  • θ2::T = eps(T)^(-1): Cauchy step parameter, see R2NParameterSet.
  • γ1::T = T(1.5): regularization update parameter, see R2NParameterSet.
  • γ2::T = T(2.5): regularization update parameter, see R2NParameterSet.
  • γ3::T = T(0.5): regularization update parameter, see R2NParameterSet.
  • δ1::T = T(0.5): Cauchy point calculation parameter, see R2NParameterSet.
  • σmin::T = eps(T): minimum step parameter, see R2NParameterSet.
  • non_mono_size::Int = 1: the size of the non-monotone behaviour. If > 1, the algorithm will use a non-monotone strategy to accept steps.
  • x::V = nlp.meta.x0: the initial guess.
  • atol::T = √eps(T): absolute tolerance.
  • rtol::T = √eps(T): relative tolerance: algorithm stops when ‖∇f(xᵏ)‖ ≤ atol + rtol * ‖∇f(x⁰)‖.
  • max_eval::Int = -1: maximum number of evaluations of the objective function.
  • max_time::Float64 = 30.0: maximum time limit in seconds.
  • max_iter::Int = typemax(Int): maximum number of iterations.
  • verbose::Int = 0: if > 0, display iteration details every verbose iteration.
  • subsolver = CGR2NSubsolver: the subproblem solver type or instance.
    • Note: HSL guards fill_ratio, dense_max_nvar, max_nvar, and max_nnzh must be passed to a pre-built subsolver, e.g. subsolver = MA57R2NSubsolver(nlp; max_nvar = 100_000, max_nnzh = 5_000_000). max_nvar is compared against nlp.meta.nvar and max_nnzh against nlp.meta.nnzh (the number of stored lower-triangular Hessian nonzeros). Both default to typemax(Int) (no additional limit). The fill_ratio density guard only applies once nvar > dense_max_nvar (default 12_000), so dense problems up to that size are still factorized by HSL. If any guard trips, HSL allocation and symbolic analysis are skipped and R2N returns status :exception. These are cheap input-size checks, not bounds on factorization memory or runtime.
  • subsolver_verbose::Int = 0: if > 0, display iteration information every subsolver_verbose iteration of the subsolver if KrylovWorkspace type is selected.
  • callback: function called at each iteration, see Callbacks section.
  • callback_quasi_newton: function called at each iteration, specifically to update the Hessian approximation of quasi-Newton models, see Callbacks section.
  • scp_flag::Bool = false: if true, we compare the norm of the calculate step with θ2 * norm(scp), each iteration, selecting the smaller step.
  • always_accept_npc_ag::Bool = false: if true, we skip the computation of the reduction ratio ρ for Goldstein steps taken along directions of negative curvature, unconditionally accepting them as successful steps to aggressively escape saddle points.
  • fast_local_convergence::Bool = true: if true, we scale the regularization parameter σ by the norm of the current gradient on very successful iterations (using γ3 * min(σ, norm(gx))), which accelerates local convergence near a minimizer.
  • npc_handler::Symbol = :ag: the nonpositivecurve handling strategy.
    • :ag: run line-search along NPC with Armijo-Goldstein conditions.
    • :sigma: increase the regularization parameter σ.
    • :prev: use the subsolver's last iterate before negative curvature was detected, sk = sk^(t-1). If it is detected at the first iteration, the Krylov subsolver returns -∇f instead; σ is not increased in either case.
    • :cp: set s_k to Cauchy point.
    • Note: For exact direct subsolvers (e.g., MA57R2NSubsolver), an exact solution to an indefinite shifted system cannot simultaneously be a strict descent direction. If the factorized matrix is singular or indefinite, the solver automatically rejects the step and increases σ, bypassing this handler.

Output

The value returned is a GenericExecutionStats, see SolverCore.jl.

Examples

using JSOSolvers, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
stats = R2N(nlp)

Passing a pre-built HSL subsolver with input-size guards (e.g. to bail out on very large problems instead of paying HSL's eager symbolic analysis):

using JSOSolvers, ADNLPModels, HSL
nlp = ADNLPModel(x -> sum(x.^2), ones(3))
sub = MA57R2NSubsolver(nlp; max_nvar = 100_000, max_nnzh = 5_000_000)
stats = R2N(nlp; subsolver = sub)

Same pattern works for MA97R2NSubsolver. If a guard trips, stats.status == :exception.

Dense Hessians are only rejected above dense_max_nvar (default 12_000), so a dense n = 5_000 problem is still factorized. Lower it to reject dense problems earlier, or raise it to allow bigger dense ones:

sub = MA57R2NSubsolver(nlp; dense_max_nvar = 20_000)
source