Skip to content

Share bounded globalization helpers across first-order methods - #1263

Closed
ChrisRackauckas-Claude wants to merge 14 commits into
SciML:masterfrom
ChrisRackauckas-Claude:refactor/shared-bounded-globalization
Closed

ChrisRackauckas-Claude wants to merge 14 commits into
SciML:masterfrom
ChrisRackauckas-Claude:refactor/shared-bounded-globalization

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

BoundedTrustRegion and the native bounded methods now share bound normalization, projected-gradient and active-variable calculations, quadratic-model evaluation, Cauchy step lengths, and trust-radius updates. The Armijo search shared by bounded LM and Gauss–Newton now lives in their common implementation file. Integration tests preserve the configurable radius factors of BoundedTrustRegion and the step-length-dependent shrink policy of Dogbox and bounded Gauss–Newton.

This is stacked on #1259. The focused refactor is one commit; review its diff here:
ChrisRackauckas-Claude/NonlinearSolve.jl@cff4287...refactor/shared-bounded-globalization

No public API or dependency changes. Each method retains its own subproblem geometry, Jacobian representation, and linear-solver cache. BoundedTrustRegion continues using its preallocated buffers. The shared-code convention is recorded in AGENTS.md.

Verification

Local test runs used JULIA_NUM_THREADS=1 and JULIA_PKG_PRECOMPILE_AUTO=0.

  • Julia 1.13.0: GROUP=NativeBounds julia +1.13.0 --project=lib/NonlinearSolveFirstOrder -e 'using Pkg; Pkg.test(; julia_args=["--load=" * abspath("../scratch/preload-enzyme.jl")])'. The preload file contains only using Enzyme, matching the Core suite's backend availability.

    Native bounded methods | 5825 5825 8m08.7s
    Testing NonlinearSolveFirstOrder tests passed
    
  • Julia 1.12.7: GROUP=QA julia +1.12 --project=lib/NonlinearSolveFirstOrder -e 'using Pkg; Pkg.test()':

    QA | 20 20 2m53.8s
    Testing NonlinearSolveFirstOrder tests passed
    
  • Runic --check, typos on all changed files, and git diff --check passed.

  • Julia 1.12.7: GROUP=QA julia +1.12 --project -e 'using Pkg; Pkg.test()':

    QA | 28 28 8m30.8s
    Testing NonlinearSolve tests passed
    
  • Julia 1.13.0: env -u GITHUB_PERSONAL_ACCESS_TOKEN JULIA_CONDAPKG_BACKEND=Null JULIA_PYTHONCALL_EXE=/usr/bin/python3 julia +1.13.0 --compiled-modules=existing --project=docs docs/make.jl completed with exit code 0, including HTML rendering.

  • Julia 1.13.0, detached shell: GROUP=Core julia +1.13.0 --project=lib/NonlinearSolveFirstOrder -e 'using Pkg; Pkg.test()' completed with exit code 0: 8,575 passing assertions across 42 test summaries. This includes the existing BoundedTrustRegion suite and the native bounded methods:

    Bounded trust region | 24 24
    Native bounded methods | 5825 5825
    SciMLOperator Jacobians | 14 14
    Testing NonlinearSolveFirstOrder tests passed
    

Not run locally: GPU and downstream groups, or the full monorepo Everything group.

Ignore this draft until reviewed by @ChrisRackauckas.

Links

🤖 Generated with Codex CLI 0.154.0 (model: gpt-6-astra; session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl).

ChrisRackauckas and others added 14 commits September 12, 2026 08:26
Use independent local checkouts and the public AirspeedVelocity API so
Julia LTS can resolve unregistered monorepo sublibrary versions. Publish
comparison tables in the job summary and preserve the result artifacts.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Add a default Newton regression for a rank-deficient tall Jacobian and
require the first LinearSolve release with the pivoted-QR fallback.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Implement scaled and corrected trust-region subproblems with reflected and
Cauchy candidates, feasible differencing, and separate root/KKT termination.
Document dense storage limits and cover native bounds and cache contracts.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
…thods

Adapt mixed residual/state shapes internally without changing user callbacks.
Cover autodiff, analytic Jacobians, and parameter-changing cache reuse.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Reuse the shared Jacobian and LinearSolve caches, including solver options,
preconditioning, and reinitialization. Restrict dense trust-region work to
the projected one- or two-dimensional model.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Use a finite-difference Jacobian backend for JVPs and VJPs unless their
backends are explicitly selected. Keep the feasibility assertions outside
reverse AD and verify selection when Enzyme is loaded.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Convert operator prototypes through their matrix interface when a concrete
linear system is requested, preserving sparse storage. Exercise default,
LU, and Krylov solves and parameter-changing reinitialization.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Pass the current iterate to the shared linear-solver constructor so
preconditioner setup receives the same state and parameters as other
first-order methods. Assert the initial callback values.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Solve the damped box subproblem with an active set and globalize with
a feasible Armijo search and projected-gradient fallback.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Compute a free-variable dogleg inside the intersected box and rectangular
trust region, including rank-deficient slow-convergence coverage.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Recognize endpoints within one coordinate ulp as well as simultaneous
hit times, so a nearly active coordinate cannot stall the dogleg step.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Solve reduced free-variable systems with projected line search, trust
region, and trust-region-with-line-search-fallback options.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
Consolidate bounds, projected gradients, active masks, quadratic models,
Cauchy lengths, and radius updates with BoundedTrustRegion. Keep each
method's shrink policy explicit and move the shared Armijo search out of LM.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.154.0
Agent-Model: gpt-6-astra
Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/12/rollout-2026-09-12T04-30-15-01a094bd-179a-7972-97ec-36badb9448cd.jsonl
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