Reuse analytic Jacobians for line-search JVPs - #1062
ChrisRackauckas merged 2 commits into
Conversation
|
Investigation scratchpad for commit
Next step is CI monitoring; any follow-up commit and its local verification will be recorded in a new comment. |
|
Verification correction: I am withdrawing the previously reported full Core result after a process-path audit found a separate active |
|
Follow-up commit The out-of-place analytic fallback reshaped Final local verification:
|
a5a889a to
44dd823
Compare
|
I split the rectangular analytic-JVP fix out of this PR into prerequisite #1063. The branch now contains only the line-search change plus the NonlinearSolveFirstOrder 2.2.1 / SciMLJacobianOperators 0.1.16 release floor. Post-split verification used the exact #1063 checkout and asserted both version and package path before running the regression: 5/5 tests passed on Julia 1.12.6. The previous combined full-Core and downstream results remain applicable because they ran the same two source changes together. I fetched the remote branch and confirmed that it contained only the two agent-authored commits before replacing the duplicated SciMLJacobianOperators commit with the dependency-floor commit. The update used |
|
The post-split CI run reached the expected release-order gate: every package-resolving job stopped immediately because SciMLJacobianOperators 0.1.16 is not registered yet. Runic and spell checks passed. There is no runtime test failure to debug in this revision; I will rerun the package jobs after #1063 merges and 0.1.16 is tagged. |
|
Version-order note: draft #1060 independently uses the same provisional next versions (SciMLJacobianOperators 0.1.16 and NonlinearSolveFirstOrder 2.2.1). If #1060 merges first, this branch must rebase to NonlinearSolveFirstOrder 2.2.2 and require the post-#1063 SciMLJacobianOperators 0.1.17 release. The current floors are valid only if #1063/#1062 land first; they are not evidence that #1060 contains the residual-shape fix. |
44dd823 to
ad591a3
Compare
|
Rebased onto current master at Final post-rebase validation used the exact #1063 source overlay and asserted local paths plus versions ( The temporary #1063 source overlay was removed before committing; this PR contains only its intended FirstOrder changes and declares the released-version dependency. |
|
The five immediate failures are all prerequisite-resolution failures before tests run:
This is the declared #1063 merge/release dependency. All five jobs stop during environment resolution before loading or running branch code. The exact #1063 0.1.17 source was developed locally for the final full Core run, which passed with path and version assertions; no CI failure is being bypassed or hidden here. |
|
Scheduled CI follow-up at 2026-07-13 18:59 EDT: I fetched and inspected all 37 completed failing job logs. All 37 stop during dependency resolution on the unreleased SciMLJacobianOperators 0.1.17 floor (Unsatisfiable requirements / empty 0.1.16-vs-0.1.17 intersection); none reached this branch's runtime tests. Fourteen checks pass, three matrix placeholders are skipped, and twenty jobs remain queued. The actionable gate remains merging/releasing prerequisite #1063; no #1062 code fix is indicated by this run. |
|
Local downstream verification on BoundaryValueDiffEq master With the released dependency set, MIRK reported: With this PR at All three line-search Dual regressions are gone:
The two remaining failures are unchanged The Shooting Core group also exited 0 with the same combined sources: This confirms the analytic-Jacobian line-search path fixes both BoundaryValueDiffEq downstreams while preserving the non-line-search baseline results. |
Let line-search JVP preparation reuse a supplied analytic Jacobian when no derivative backend was explicitly selected. This avoids differentiating residuals that already provide exact derivatives. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
66043f4 to
af9b7a9
Compare
Important
Ignore this PR until it has been reviewed by @ChrisRackauckas.
Summary
SciMLJacobianOperatorsform the line-search JVP from a supplied analytic Jacobian.SciMLJacobianOperatorsfloor to 0.1.17.Root cause
This follows the direct
ModelingToolkitBaseInterfaceII failures reported while working on ModelingToolkit.jl#4742. Both failures entered a boundary residual withForwardDiff.Dualvalues from the nonlinear line-search JVP.Commit
c6b26f4abegan always passing the automatically selected forward-mode JVP backend toLineSearch, which bypasses the analytic-Jacobian fallback inSciMLJacobianOperators.prepare_jvp(that fallback only fires whenautodiff === nothing). The introducing boundary was checked against the minimal reproducer:c6b26f4a^(d21952c3) exits successfully,c6b26f4aerrors withVector{ForwardDiff.Dual}reaching the residual.The fix passes
nothingonly when the problem has an analytic Jacobian and no JVP, VJP, or reverse-mode backend was explicitly selected. That preserves the explicit-backend behaviorc6b26f4aadded while restoring the analytic derivative path.Prerequisite (resolved)
This depended on a rectangular-output bug in the analytic JVP implementation, split out as #1063. That is now merged (
01891bcd) and SciMLJacobianOperators 0.1.17 is registered in General (JuliaRegistries/General#163962), so the0.1.17compat floor here resolves — including on downgrade CI.Verification
Rebased onto master at
01891bcd. Julia 1.12.4, withlib/path sources so both localSciMLJacobianOperators0.1.17 and localNonlinearSolveFirstOrderare exercised (asserted viapathof).The regression discriminates. With
lib/NonlinearSolveFirstOrder/src/solve.jlreverted to master and the test left in place:With the fix restored, same file, same environment:
Full
GROUP=Coresuite forNonlinearSolveFirstOrder—Pkg.test()exited 0, zero failures and zero errors across every testset:Structured JacobiansandSciMLOperator Jacobiansmatter here specifically: the restoredprepare_jvpfallback materializes a densejac_cacheand callsf.jacinto it, so those groups are what exercise non-densejac_prototypes through the new path.Also run clean: Runic 1.7.0 (
--check, exit 0),typos(exit 0),git diff --check(exit 0).Not verified
lib/.pre; only 1.12.4 was run locally.ModelingToolkitBasebvproblem.jlintegration was verified on the pre-rebase branch, not re-run after this rebase. The code change is identical; only theProject.tomlconflict resolution differs.For a reviewer to push back on
SciMLBase.has_jac(f)is the whole trigger condition. A problem that suppliesjacbut whosejacis more expensive per call than a single forward-mode pushforward now pays that cost in the line search. The prior behavior (beforec6b26f4a) was the same, so this is a restoration, not a new tradeoff — but it is a performance-relevant default.0.1.1→0.1.17, dropping a wide range of resolvable older versions. That is required for correctness (the rectangular-output fix), not cosmetic.