Add reusable homotopy solver caches - #1100
Conversation
|
Implementation scratchpad:
|
|
Validation update for exact head
No source change, synthetic commit, or rebase was made for these runner-only failures. |
0feaad2 to
5eb00ed
Compare
|
CI checkpoint (2026-07-22 08:31 EDT): Linux Core on LTS/release/prerelease, NonlinearSolveBase Core on all versions, homotopy-continuation Core and downgrade, CUDA, allocations, downstreams, docs, and Runic pass. The macOS Core failures are the same Brown almost-linear alg #4 failure present on untouched master run 29902380036 across all macOS Julia lanes; a separate clean-master bisect/fix investigation is in progress. The macOS LTS Adjoint job aborted inside the Julia compiler after a large inference dump, while the other five Adjoint lanes pass; a job-only rerun was attempted but the token lacks repository-admin permission. QA failures are the existing SciMLTesting 2.4 public-reexport audit described in the PR body. |
|
Downstream integration is now in draft SciML/OrdinaryDiffEq.jl#3985. That PR replaces the per-stage one-shot homotopy solve in The ODE integration remains draft and explicitly depends on this PR. |
5eb00ed to
5b44f3e
Compare
|
Rebased the four-commit series onto current Local verification on exact head
The PR is now mergeable with master. No test was skipped, silenced, or loosened. |
|
Clean-master allocation follow-up at
Fresh isolated-worktree validation on Julia 1.12.6 + LinearSolve 5.2.0:
No threshold was changed, loosened, skipped, or silenced; a duplicate PR is unnecessary because #1100 already fixes the clean-master failure. |
|
Exact downstream integration validation against this PR's current head ( On OrdinaryDiffEq master plus the single cache-integration commit, Julia 1.12.6 with local NonlinearSolve 4.24 / NonlinearSolveBase 2.40:
This complements the Julia 1.12 continuation-corrector allocation evidence above: the new reusable outer caches work through the public |
5b44f3e to
dea394f
Compare
|
Rebased the four-commit series onto current Local verification on exact head
The PR is now mergeable with master. No test was skipped, silenced, or loosened. |
|
The DiffEqCallbacks downstream failure in job 90053534882 reproduces unchanged against clean NonlinearSolve master 1d51c8d (v4.23.2), so it is independent of this PR. The first resolver wall is DiffEqCallbacks test compat ForwardDiff 0.10 versus current NonlinearSolve ForwardDiff 1; clearing it exposed stale DataInterpolations 5–8 versus FindFirstFunctions 3 and the SciMLBase v2/v3 EnsembleProblem prob_func signature transition. A focused owner-side fix is now draft PR SciML/DiffEqCallbacks.jl#329. Exact downstream replay against clean NonlinearSolve master passes locally, as do DiffEqCallbacks Core, AD under ForwardDiff 1.4.2, QA, and Runic. |
Avoid temporary reshape wrappers for dense AutoForwardDiff Jacobians and same-buffer restructure calls, with direct warmed allocation regressions. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Run reusable continuation correctors to completion without materializing a solution on every step, while retaining full solution construction for custom, bounded, and wrapper caches. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
dea394f to
04e7c57
Compare
|
Rebased the four-commit series onto current
Local verification on exact head
The PR is now mergeable with master. No test was skipped, silenced, or loosened. |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Added commits Local Julia 1.12.6 verification on exact head
No test was skipped, silenced, or loosened. |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Final CI attribution for exact head
Relevant behavioral lanes are green: root Core on Julia current, HomotopyContinuation Core, NonlinearSolveBase Core on LTS/current/pre, every downgrade sublibrary (including Base, FirstOrder, QuasiNewton, and HomotopyContinuation), CUDA, wrappers, polyalgorithms, trim, adjoint, and root downstream groups. No test was skipped, silenced, or loosened in response to these failures. |
Summary
init/reinit!/solve!caches forHomotopySweepandKantorovichHomotopy.homotopy solves, including parameter, initial-value, and same-typed solver-option
updates.
fallback uses the current tolerances.
on Julia 1.12.
NonlinearSolveBase.solve_cache!driver for nested solversthat need per-iteration observations without constructing a
NonlinearSolution.The first dense-Jacobian allocation fix is also available independently as #1116.
This PR retains the complete series needed by the reusable outer cache.
Why
The continuation drivers already reused an inner nonlinear cache within one homotopy
sweep, but the outer
HomotopyProbleminterface only implemented one-shotsolve.A caller solving a sequence of same-typed homotopy problems therefore rebuilt the
outer buffers and inner solver workspace every time. This was the path used by
OrdinaryDiffEq's
HomotopyNonlinearSolveAlgfor successive implicit stages.The new outer cache owns the problem, fixed-lambda residual, inner cache, continuation
buffers, and controller state.
reinit!updatesu0,p, and existing same-typedoptions;
solve!resets the path state in place and drives the cached corrector.Resizing remains the caller's responsibility because a changed state dimension
requires rebuilding the typed inner workspace.
Failure solutions now retain the most recent inner residual on stalled/max-step
paths. This keeps the cached return type consistent and provides more information
than the previous
nothingresidual.Allocation behavior
On Julia 1.12.6, the warmed complete-cache
reinit!plussolve!path allocatesexactly 0 bytes. The existing per-continuation-step regressions also remain exactly
zero after rebasing onto the current homotopy routing and
FastShortcutHomotopyPolyalgwork.The warmed
solve_cache!path with a stateful step observer also allocates exactly0 bytes. This is the cache driver used by the dependent ImplicitDiscreteSolve change
to collect Newton contraction rates without reaching into NonlinearSolve internals.
Local validation
dca80d83conupstream/master22190d403.NONLINEARSOLVE_TEST_GROUP=Coreon Julia 1.12.6:Testing NonlinearSolve tests passed.allocation.
19/19 and 12/12 passed.
Testing NonlinearSolveBase tests passed, including Jacobian/restructureallocation fast paths 6/6 and dense LU allocation checks 14/14.
already-fixed Aqua
treat_as_ownconversion bug. Against the merged SciMLTestingSciMLTesting.jl#37 source,
public API documentation passed 2/2 and 19/20 QA checks passed; the remaining
pre-existing public-owner check is addressed by Use public APIs for AutoDePSpecialize wrappers #1121.
--check: exit 0.git diff --check: exit 0.No test was skipped, silenced, or loosened.