From 550d4ab6d51576e8232af7d50395b2cb0affaf39 Mon Sep 17 00:00:00 2001 From: Jonathan Brodrick Date: Wed, 13 May 2026 00:55:10 +0100 Subject: [PATCH 1/2] fix reporting nonconvergence as divergence for non-Cauchy termination --- diffrax/_root_finder/_verychord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffrax/_root_finder/_verychord.py b/diffrax/_root_finder/_verychord.py index d73b3336..f58fcb44 100644 --- a/diffrax/_root_finder/_verychord.py +++ b/diffrax/_root_finder/_verychord.py @@ -162,7 +162,7 @@ def terminate( converged = _converged(factor, self.kappa) terminate = at_least_two & (small | diverged | converged) terminate_result = optx.RESULTS.where( - at_least_two & jnp.invert(small) & (diverged | jnp.invert(converged)), + at_least_two & jnp.invert(small) & diverged, optx.RESULTS.nonlinear_divergence, optx.RESULTS.successful, ) From 7f9fbd1a9a8a21740e870528c3ef57ab53b7a888 Mon Sep 17 00:00:00 2001 From: Jonathan Brodrick Date: Wed, 13 May 2026 03:22:02 +0100 Subject: [PATCH 2/2] fix test --- test/test_solver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_solver.py b/test/test_solver.py index a022f644..dfff3f6b 100644 --- a/test/test_solver.py +++ b/test/test_solver.py @@ -50,7 +50,7 @@ def test_implicit_euler_adaptive(): stepsize_controller=stepsize_controller, throw=False, ) - assert out1.result == diffrax.RESULTS.nonlinear_divergence + assert out1.result == diffrax.RESULTS.nonlinear_max_steps_reached assert out2.result == diffrax.RESULTS.successful