Add Kantorovich homotopy continuation - #1071
Conversation
|
Commit Execution notes:
Local evidence on the committed tree:
The unrelated Core Broyden stop was reproduced and bisected separately; details and links are in the PR body. |
|
CI note: the red |
|
Additional CI note: |
|
The third red check, |
|
The |
|
Supplemental current-stable verification: after instantiating the repository-local Julia 1.12 environment, |
affc2ec to
fad6ad6
Compare
|
Rebased onto current |
|
Post-rebase CI note: Downgrade / Downgrade Tests - Core reached the pre-existing Broyden block and stopped with the exact clean-master baseline: 94 passed, the generalized Rosenbrock case failed for algorithm 4, the Brown almost-linear case produced one platform-dependent unexpected pass, and 19 remained broken. This is the separately reproduced/bisected issue described in the PR body; #1057 contains the generalized-Rosenbrock fix and #1056 tracks Brown. No homotopy test failed, and this PR does not alter, skip, or loosen the baseline tests. |
|
Follow-up commit a3bd3b1 corrects the contraction observation to measure the first Newton ratio from the predictor residual, rather than starting at the second ratio. The new regression deliberately has first contraction 0.99 and later contraction 0, so the prior implementation would select the wrong value. Exact post-change local run: Kantorovich homotopy 48 passed / 48 total in 2m47.6s on Julia 1.12; repository-wide Runic and git diff --check both exited 0. The branch was current with upstream/master and was pushed normally without force. |
|
Corrected benchmark note: measuring the true first contraction materially changed the comparison, so I reran rather than reusing the earlier numbers and replaced the PR table. Default strict Kantorovich is 28.8% lower in residual calls on stiff van der Pol and 26.6% lower on Robertson, but it is not uniformly good: it fails to finish fixed-step ignition at dt=5 and dt=10, and costs 55.7% more at dt=20. On standalone paths it wins the smooth cubic, loses badly on a narrow transition, and correctly fails at a fold where ArcLength succeeds. At ignition dt=10, strict=false recovers a 751-vs-1160 call win, but only by accepting the poor initial contraction, which reintroduces path-jump risk. The conclusion is now explicitly that this remains opt-in and must not replace the existing default. Temporary benchmark environments/scripts were removed and both worktrees are clean. |
|
Benchmark reproduction details: standalone runs used Julia 1.12, explicit NewtonRaphson(autodiff=AutoFiniteDiff()), abstol=reltol=1e-10, maxiters=50, and counted every H evaluation. Paths were H=u^3-(1+lambda); H=u^3-exp(2lambda)^3; H=u^3-(1+0.5tanh(25(lambda-0.5)))^3; a 50-variable tridiagonally coupled cubic with known path u(lambda)=1+lambda*v; and H=u^3-3u-(-3+6lambda) for the two-fold curve. ODE runs used the existing HomotopyNonlinearSolveAlg adapter with ImplicitEuler and sol.stats.nf: the repository stiff-VDP problem (mu=1000, tspan 0:0.3, tolerances 1e-6), repository Robertson problem (tspan 0:1e5, tolerances 1e-8), and u prime = u^2(1-u), u0=0.01, tspan 0:200 at fixed dt 5/10/20. Each algorithm was reconstructed for every run. |
|
Post-fix aggregate continuation verification is complete. Each Julia 1.10 exited 0: Julia 1.12 produced: The two Julia 1.12 failures are exactly the pre-existing |
|
The newly reported
Both fail with the same constraint chain: #1070 requires |
a3bd3b1 to
57e36d7
Compare
|
Rebased the feature commits onto the focused clean-master downgrade fix in #1075. The remote branch was audited first (only the two known feature commits), and the rewritten push used an explicit lease against old head New head: Post-rebase local verification:
This stack includes #1075 only. The independent root dependency-floor PR #1079 is not a prerequisite for this feature. |
|
Final documentation audit found that Local validation after the documentation edit:
The exact #1071 + #1075 downgrade sandbox was also reproduced locally: NLS 4.21.0 / local Base 2.36.0 / SciMLBase 3.34.0 / SciMLLogging 2.0.3 / LinearSolve 5.0.0, with |
|
Added direct regression coverage for the optimized warm handoff in Whole-repository Runic and |
|
Latest-head aggregate validation on Julia 1.10.11 ( Exit code 0. No test was skipped, disabled, loosened, or silenced. The isolated temporary environment used to resolve the exact local source tree on Julia 1.10 was removed after the run; the feature worktree is clean. |
|
Clean-master Adjoint CI failure investigation is complete and confirms an unrelated dependency-floor regression.
No test or dependency constraint in this homotopy PR was changed to mask the baseline. All disposable investigation worktrees, clones, and depots were removed. |
|
Latest-head Julia 1.12.6 aggregate (
No test was skipped, disabled, loosened, or silenced. The disposable Julia 1.12 environment was removed and the feature worktree is clean. |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
c854160 to
63f3599
Compare
|
Rebased directly onto current clean Remote safety audit before rewriting:
New head:
|
|
Scheduled one-hour CI audit for rebased head
No completed CI failure implicates the new Kantorovich controller. |
Summary
KantorovichHomotopy, a documentedHomotopyProblemsolver whose parameter-step controller is adapted fromImplicitDiscreteSolve.KantorovichTypeController.HomotopySweeppath driver, including cache reuse, endpoint polishing, predictor trust, tracking limits, Jacobian forwarding, and warm handoff toArcLengthContinuation.Θminconvention for polyalgorithms and no-init solvers.Why
ImplicitDiscreteSolveuses a Newton--Kantorovich continuation-style controller across accepted discrete states, but it is not itself one fixedHomotopyProblem: its residual mutates the previous accepted state. The reusable part is the contraction-based path-step controller. This PR implements that controller for a genuine fixed homotopy while retaining NonlinearSolve's existing continuation machinery.OrdinaryDiffEq already has a generic
HomotopyNonlinearSolveAlgadapter that builds the normalized per-stage homotopy from the known zero-step anchor. No adapter-specific source change is needed: callers can passHomotopyNonlinearSolveAlg(KantorovichHomotopy(...))once this solver is available.This feature branch is rebased directly onto current
master; the former #1075 and #1079 prerequisites are now included upstream.Comparison
After correcting the controller to use the actual first residual contraction (predictor residual to first corrected residual), explicit finite-difference Newton comparisons are mixed. Values below are homotopy residual-function evaluations.
The predictor and controller effects are distinct. Secant prediction makes the Kantorovich controller competitive on the curved exponential and best on the coupled path, but it remains much worse through the narrow transition. The constant predictor matches ImplicitDiscreteSolve's method, yet is worse than HomotopySweep on three of these five standalone paths. Natural-parameter Kantorovich continuation cannot traverse a fold; strict rejection detects the bad contraction, while ArcLengthContinuation follows the branch.
The existing OrdinaryDiffEq adapter shows real wins on some stiff workloads but the same lack of uniform robustness. Values are
sol.stats.nffromImplicitEulerruns.At ignition dt=10,
strict=falsefinishes in 751 calls, confirming that the apparent speedup comes from accepting a corrector whose initial contraction violates the strict path-safety criterion. That permissive setting can jump branches and is not a safe general default.The conclusion is therefore conservative: this controller is useful as an opt-in experiment and can reduce work substantially on some smooth stiff-stage homotopies, but it is not a replacement for HomotopySweep, and ArcLengthContinuation remains the fold solver. The default homotopy polyalgorithm is intentionally unchanged.
Validation
63f359999):50 passed / 50 totalin46.5s, including a retained shrunken-span Kantorovich → arclength warm handoff.527 passed / 527 totalin6m29.8s.527 passed, 2 failed / 529 totalin8m54.8s; the only failures are the two pre-existing allocation assertions reproduced on clean master and tracked in #1076.GROUP=QA:15 passed / 15 total.ReturnCode.Success, endpoint error1.450765923494135e-4against a tight TRBDF2 reference.git diff --check: exit 0.GROUP=Corereaches an unrelated failure in the pre-existing Broyden test before the continuation section. The failure was reproduced on clean master and bisected separately; #1057 is the generalized-Rosenbrock fix and #1056 tracks the platform-dependent Brown behavior. This PR does not alter or suppress that test.Process notes
The work audited the
ImplicitDiscreteSolvecontroller and residual mutation semantics, reviewed the existing OrdinaryDiffEq homotopy adapter, extracted the shared continuation driver hooks, tested exact controller factors and rejection behavior, benchmarked smooth, curved, stiff-ODE, and fold cases, then verified documentation and the full continuation regression surface. Reproduction details and clean-master CI investigations are recorded in the PR comments.