Skip to content

Preserve residual shape in analytic JVPs - #1063

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/preserve-analytic-jvp-residual-shape
Draft

Preserve residual shape in analytic JVPs#1063
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/preserve-analytic-jvp-residual-shape

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Jul 13, 2026

Copy link
Copy Markdown
Member

Ignore this PR until it has been reviewed by @ChrisRackauckas.

Summary

  • reshape out-of-place analytic Jacobian-vector products to the residual shape, not the unknown shape
  • cover a rectangular matrix-valued least-squares residual
  • bump SciMLJacobianOperators from 0.1.16 to 0.1.17 for the bug-fix release

For a rectangular Jacobian, the product has one entry per residual. Reshaping it to size(u) only worked when residual and unknown shapes happened to match.

Verification

  • NONLINEARSOLVE_TEST_GROUP=Core julia +1.10 --project=lib/SciMLJacobianOperators -e "using Pkg; Pkg.instantiate(); Pkg.test()"
    • Scalar Ops: 1248/1248
    • Inplace Problems: 864/864
    • Out-of-place Problems: 1250/1250
    • Copy with Tuple parameters: 11/11
  • Runic 1.7 repository check: exit 0
  • git diff --check upstream/master...HEAD: exit 0

This is the release prerequisite for #1062.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The root downgrade job failed in the pre-existing Broyden robustness lane, not in SciMLJacobianOperators: Generalized Rosenbrock function | alg #4 returned residual norm 4.4. The exact same failure is present on clean master run 29258191482 at commit 579761dd2; this PRs analytic-Jacobian test passed before that lane.

Per the repository instructions, I have queued a separate clean-master reproduce/bisect/fix audit rather than changing or silencing the robustness assertion here. All other #1063 checks remain under monitoring.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Prior-art check found that the clean-master downgrade failure is already fully audited in #1057: it reproduces the same generalized-Rosenbrock bad-Broyden case, bisects the first bad commit to 6a7687f542, and provides the focused triangular-solve fix with local Core/downstream verification. I will not duplicate that work. The later unrelated Brown bookkeeping behavior is already documented in #1056.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Owning-package CI is now green across the full matrix: SciMLJacobianOperators Core passed on Julia lts, current release, and prerelease; QA passed on current release; and the strict sublibrary downgrade job passed. Runic and spell checks are also green. The only completed red remains the exact clean-master Broyden failure already fixed by #1057.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Version-order note: draft #1060 independently uses SciMLJacobianOperators 0.1.16 (and NonlinearSolveFirstOrder 2.2.1). These are provisional next-version numbers, not interchangeable fixes. If #1060 merges first, this PR must rebase and become SciMLJacobianOperators 0.1.17, and dependent #1062 must raise its floor accordingly. If #1063/#1062 merge first, #1060 must take the later patch versions. No release should treat the shared provisional number as meaning both patches are present.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude
ChrisRackauckas-Claude force-pushed the agent/preserve-analytic-jvp-residual-shape branch from f7c5c29 to af90452 Compare July 13, 2026 20:07

Copy link
Copy Markdown
Member Author

Post-#1060 rebase verification:

  • Safely rebased onto merged master 41681c5e4 after fetching both remotes and confirming the feature remote still pointed to the sole agent-authored commit f7c5c29bc.
  • Because Raise SciMLOperators public API floors and resolve cache ambiguity #1060 registered the previously provisional SciMLJacobianOperators 0.1.16 bump, this branch now correctly uses 0.1.17. The PR body has been updated accordingly.
  • Exact Julia 1.10.11 SciMLJacobianOperators Core on rebased head af904522c passed: Scalar 1248/1248, in-place 864/864, out-of-place 1250/1250, tuple copy 11/11.
  • Whole-repository Runic and git diff --check both exited 0.

The rewritten branch was pushed with an exact lease against verified old SHA f7c5c29bc; no contributor commit was overwritten.

Copy link
Copy Markdown
Member Author

Early CI classification for the two red downgrade jobs on rebased head af904522c:

  • Root Downgrade Tests - Core stops before tests because the current downgrade action pins SciMLOperators = 1.22.0, while the in-tree NonlinearSolveQuasiNewton 1.14.1 now correctly requires SciMLOperators >= 1.24 after merged Raise SciMLOperators public API floors and resolve cache ambiguity #1060.
  • downgrade-sublibraries / SimpleNonlinearSolve stops for the same reason: its generated manifest pins SciMLOperators = 1.22.0, while the in-tree NonlinearSolveBase 2.34.3 requires >= 1.24.

Both logs are resolver failures before any test starts. This is the already-audited shared julia-downgrade-compat path-source problem addressed by stacked upstream drafts #54 and #55, not a failure in the analytic-JVP change. The remaining checks are still running.

Copy link
Copy Markdown
Member Author

Additional rebased-head CI classification from the exact failed logs:

These failures are outside the SciMLJacobianOperators analytic-JVP diff and match the already-audited clean-master failures. No tests or broken-test bookkeeping were changed here.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The remaining rebased-head failure is root CUDA: both QuasiNewtonAlgorithm cases at test/gpu/cuda_tests__item1.jl:34 and :44 error with DimensionMismatch: array could not be broadcast to match destination (18 pass, 2 error). The job never enters the SciMLJacobianOperators analytic-JVP regression.

The same two line-level failures have been observed on the clean-master CUDA lane, so this is being kept out of the analytic-JVP diff and queued for the required separate reproduce/bisect/fix audit on the GPU runner. No CUDA test is skipped or weakened here.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The two newly completed macOS Core jobs match the same already-audited root Broyden regression:

  • Julia current and prerelease each fail only Generalized Rosenbrock function | alg #4, with residual 4.3999999999999995 > 0.001 (94 pass, 1 fail, 20 existing broken).
  • Both logs enter the root Broyden robustness suite after the owning SciMLJacobianOperators matrix has already passed; neither failure exercises this PR's analytic-JVP regression.

This is the same cross-platform clean-master failure addressed by focused draft #1057 (with #1058 as the alternative dense fallback), so no additional test change or duplicate audit is needed here.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The final macOS Core lane, Julia LTS, has now completed with the same sole generalized-Rosenbrock alg #4 residual (4.3999999999999995 > 0.001; 94 pass, 1 fail, 20 existing broken). Thus the full Linux/macOS × LTS/current/prerelease Core matrix is classified under the already-bisected #1057/#1058 Broyden work. The only remaining queued check is the independent SimpleNonlinearSolve CUDA sublibrary lane.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

Terminal CI follow-up: the final queued SimpleNonlinearSolve CUDA lane passed, bringing the run to 82 successes, 3 skipped matrix placeholders, and 10 previously classified failures. Those failures remain the clean-master downgrade resolver, NonlinearSolveBase ExplicitImports, root CUDA (addressed separately by #1066), and generalized-Rosenbrock root Core failures. No analytic-JVP-specific failure appeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants