Repository navigation
Various bug fixes - #1051
Various bug fixes#1051
Conversation
|
(I'll investigate the compat failures tomorrow) |
e84eb35 to
ae6601c
Compare
The broken tests appears to have changed in #1039: 1: Generalized Rosenbrock function | alg #4: Test Failed at /home/runner/_work/NonlinearSolve.jl/NonlinearSolve.jl/test/Core/setup_robustnesstesting.jl:25
Expression: norm(res, Inf) ≤ ϵ
Evaluated: 4.3999999999999995 ≤ 0.001
Stacktrace:
[1] macro expansion
@ ~/_work/_tool/julia/1.13.0-rc1/x64/share/julia/stdlib/v1.13/Test/src/Test.jl:753 [inlined]
[2] macro expansion
@ ~/_work/NonlinearSolve.jl/NonlinearSolve.jl/test/Core/setup_robustnesstesting.jl:25 [inlined]
[3] macro expansion
@ ~/_work/_tool/julia/1.13.0-rc1/x64/share/julia/stdlib/v1.13/Test/src/Test.jl:2042 [inlined]
[4] test_on_library(problems::Tuple{typeof(NonlinearProblemLibrary.p1_f!), typeof(NonlinearProblemLibrary.p2_f!), typeof(NonlinearProblemLibrary.p3_f!), typeof(NonlinearProblemLibrary.p4_f!), typeof(NonlinearProblemLibrary.p5_f!), typeof(NonlinearProblemLibrary.p6_f!), typeof(NonlinearProblemLibrary.p7_f!), typeof(NonlinearProblemLibrary.p8_f!), typeof(NonlinearProblemLibrary.p9_f!), typeof(NonlinearProblemLibrary.p10_f!), typeof(NonlinearProblemLibrary.p11_f!), typeof(NonlinearProblemLibrary.p12_f!), typeof(NonlinearProblemLibrary.p13_f!), typeof(NonlinearProblemLibrary.p14_f!), typeof(NonlinearProblemLibrary.p15_f!), typeof(NonlinearProblemLibrary.p16_f!), typeof(NonlinearProblemLibrary.p17_f!), typeof(NonlinearProblemLibrary.p18_f!), typeof(NonlinearProblemLibrary.p19_f!), typeof(NonlinearProblemLibrary.p20_f!), typeof(NonlinearProblemLibrary.p21_f!), typeof(NonlinearProblemLibrary.p22_f!), typeof(NonlinearProblemLibrary.p23_f!)}, dicts::NTuple{23, Dict{String, Any}}, alg_ops::Tuple{NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.GoodBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.FullStructure}, Val{false}}, NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.GoodBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.TrueJacobianInitialization{NonlinearSolveQuasiNewton.FullStructure, Nothing}, Val{true}}, NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.BadBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.IdentityInitialization{Nothing, NonlinearSolveQuasiNewton.FullStructure}, Val{false}}, NonlinearSolveQuasiNewton.QuasiNewtonAlgorithm{Nothing, Missing, NonlinearSolveBase.NewtonDescent{Nothing}, NonlinearSolveQuasiNewton.BadBroydenUpdateRule, NonlinearSolveQuasiNewton.NoChangeInStateReset{Nothing}, NonlinearSolveQuasiNewton.TrueJacobianInitialization{NonlinearSolveQuasiNewton.FullStructure, Nothing}, Val{true}}, SimpleNonlinearSolve.SimpleBroyden{Nothing, Nothing}}, broken_tests::Dict{NonlinearSolveBase.AbstractNonlinearSolveAlgorithm, Vector{Int64}}, ϵ::Float64; skip_tests::Nothing)
@ Main.var"##23 Test Problems: Broyden#160" ~/_work/NonlinearSolve.jl/NonlinearSolve.jl/test/Core/setup_robustnesstesting.jl:13
8: Brown almost linear function | alg #4: Error During Test at /home/runner/_work/NonlinearSolve.jl/NonlinearSolve.jl/test/Core/setup_robustnesstesting.jl:25
Unexpected Pass
Expression: norm(res, Inf) ≤ ϵ
Got correct result, please change to @test if no longer broken.So 1 now fails (according to Claude it was always dubious) and 8 now passes. |
|
The allocation failures in https://github.com/SciML/NonlinearSolve.jl/actions/runs/29238046017/job/86778787036?pr=1051 appear to be because of a change to
|
The old definition would set `cache.p = p`, but `cache.p` is the forcing algorithm struct and not the problem parameters. It just needs to update η, the rest is reinited by the use of `@internal_caches`. Also fixed resetting of `rnorm` and `rnorm_prev`.
`N` is not defined, the value should come from `shared` instead.
Explanation from Claude: `SwitchedEvolutionRelaxationCache` has no `reinit!` method, so the generic no-op applies. Measured: `α⁻¹` goes from `1000.0` at init to `5.3e-8` after a solve and stays there through `reinit!`; the re-solve then runs with essentially no pseudo-time damping — silently a different (pure-Newton-like): algorithm, defeating the point of PseudoTransient on stiff problems. Since the mass-matrix support (SciML#1001) the cache also holds a scaled damping matrix `D` that would leak the same way. Contrast with `LevenbergMarquardtDampingCache`, which correctly resets `λ` and `DᵀD`.
`step!()` only supports `recompute_jacobian`.
Explanation from Claude: With `g = -Jᵀfu`, the code computes `δu_cache_mul = JᵀJ·g` and then `δuJᵀJδu = dot(δu_cache_mul, δu_cache_mul)` = ‖JᵀJ·g‖² = gᵀ(JᵀJ)²g. The non-normal-form branch:(lines 123–124) correctly computes ‖J·g‖² = gᵀJᵀJg. It should be `dot(δu_cauchy, cache.δu_cache_mul)`.
Needed for downgrade CI.
- Fix method ambiguity - Update list of broken tests
Releases the unreleased fixes on master: Various bug fixes (#1051). Claude-Session: https://claude.ai/code/session_01SFmcAmLrGPrGtzwP333mX8 Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
…1125) Problem #8 (Brown almost linear) solved with Broyden(; init_jacobian = Val(:true_jacobian), update_rule = Val(:bad_broyden)) is the same knife-edge case as problem #1, which #1108 already moved into skip_tests. #1051 removed 8 from that algorithm's broken list ([5, 6, 8, 11] -> [1, 5, 6, 11]) after validating on a machine where it converges; it does not converge on the SciML self-hosted pool or on current GitHub-hosted runners, where it returns the initial best residual 5.5. As documented in #1096, the outcome is deterministic per machine but flips with the BLAS kernel, and it has failed in both directions: the 2026-07-15 Downgrade run errored with "Unexpected Pass" while it was still marked broken. Neither pass nor @test_broken is a stable expectation, which is exactly what the harness's skip_tests mechanism is for. Local verification on Julia 1.12.6, test/Core/23_test_problems_tests__item7.jl: this machine is one where #8 converges, so the run goes from 95 pass / 20 broken on master to 94 pass / 21 broken with this change - one test moved from pass to skip, nothing else changed. Co-authored-by: ChrisRackauckas-Claude <[email protected]>
All found by auditing NLSBase and NLSFirstOrder with Claude, and checked by me (not that I'm much of an expert). See the commit messages for more details:
reinit!(::EisenstatWalkerForcing2Cache)method incorrectly assignedp(problem parameters) tocache.p(the forcing algorithm struct).init()for NewtonDescent.reinit!(::SwitchedEvolutionRelaxation), which previously did nothing when reiniting.step!().The fixes I'm particularly unfamiliar with are 11b48f6 (Cauchy point-length) and ff8ef19 (implementing
reinit!(::SwitchedEvolutionRelaxation)) so they could likely do with extra review.Written with Claude 🤖
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.