Recognize explicit second-order AutoSparse AD - #1269
Recognize explicit second-order AutoSparse AD#1269ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
|
Fresh downstream verification on 2026-07-20:
This confirms that #1269 is the OptimizationBase half of the fix. BoundaryValueDiffEq still needs the companion explicit-second-order change; #1269 alone correctly continues warning for its current first-order |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
dc1da44 to
ec83d4e
Compare
|
Rebased onto current clean |
Summary
AutoSparseAD types that explicitly wrapDifferentiationInterface.SecondOrdermissing_second_order_adwarning for implicit first-orderAutoSparseinputsContext
Optimization's exact-Hessian cache warning only recognized a top-level
SecondOrder. The documented sparse form is insteadAutoSparse(SecondOrder(inner, outer)), so an explicitly configured sparse second-order backend was incorrectly warned as missing second-order AD.This became visible in BoundaryValueDiffEq after OptimizationIpopt 1.3 switched to the generic
OptimizationCache. A separate downstream follow-up supplies an explicit sparseSecondOrder; this PR only fixes OptimizationBase's classification.Related prior art: #1061 called out this false warning while working around it downstream, and #1240 concerns another second-order warning edge case. I found no open duplicate PR.
Investigation
AutoSparse(SecondOrder(AutoForwardDiff(), AutoForwardDiff()))solves successfully.AutoSparseoutside the individualSecondOrderbackends is the working sparse representation; the alternative top-level construction fails in DifferentiationInterface's pullback path.Local verification
OPTIMIZATION_TEST_GROUP=Core: 54 passedOPTIMIZATION_TEST_GROUP=QA: 16 passed, 1 pre-existing broken assertion; package test passedPlease ignore this draft until it has been reviewed by @ChrisRackauckas.