Repository navigation
Add native rectangular trust-region Dogbox solver - #1258
Closed
ChrisRackauckas-Claude wants to merge 12 commits into
Closed
ChrisRackauckas-Claude wants to merge 12 commits into
ChrisRackauckas-Claude wants to merge 12 commits into
Conversation
This was referenced Sep 12, 2026
ChrisRackauckas-Claude
force-pushed
the
feature/dogbox
branch
from
September 12, 2026 09:56
fe33c2d to
e723d72
Compare
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
ChrisRackauckas-Claude
force-pushed
the
feature/dogbox
branch
from
September 12, 2026 14:13
e723d72 to
a727541
Compare
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
ChrisRackauckas-Claude
force-pushed
the
feature/dogbox
branch
from
September 12, 2026 15:33
a727541 to
ee0d80b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Dogboxfor the P1 portion of #1254. It combines the Cauchy and Gauss–Newton directions inside the intersection of the physical bounds and rectangular trust region. Bound hits are snapped to their endpoints using both hit-time and coordinate spacing checks, preventing rounding from leaving a nearly active coordinate that stalls subsequent steps.Gauss–Newton directions come from the shared Jacobian and linear-solver caches. Sparse prototypes remain sparse and Krylov solves use operators, with the usual linear solver, AD, preconditioning, and reinitialization options. The method is opt-in and documents the dependence of rank-deficient behavior on the selected linear solver.
Depends on #1257. The draft targets
masterand includes its prerequisites; the focused comparison below isolates this method.Verification
The results below are from the final stacked checkout in #1259, which includes all four methods and the identical shared source used by the prerequisites.
The official
NativeBoundsgroup covers all six constructor/globalization choices, sparse analytic and AD Jacobians, operator-only JVP/VJP callbacks, normal-equation and rectangular Krylov solves, preconditioning, scalar/static/mixed shapes, bound-aware differences, and parameter-changing cache reinitialization.Julia 1.10.11 with the CI minimum dependency set (29 pinned packages), including ADTypes 1.13.0, SciMLBase 3.46.0, SciMLOperators 1.30.0, and the corrected LinearSolve minimum 5.6.0:
Julia 1.13.0 with LinearSolve 5.17.2 and normal precompilation, matching current release CI. Both runs preload Enzyme (
preload-enzyme.jlcontains onlyusing Enzyme) to cover the reverse-AD backend available in Core:Final
GROUP=QAruns with Julia 1.12.7 andPkg.test(; julia_args=["--compiled-modules=existing"]):The full FirstOrder Core group passed on the final source with Julia 1.10.12 and the same minimum-dependency environment. Its 42 top-level test summaries contain 9,144 passing assertions, including all 5,810 NativeBounds assertions:
Runic,
typoson changed files, andgit diff --checkpassed.The full documentation build passed on Julia 1.13.0 with the final source:
Discriminating regressions
With the original implementation and the new sparse/operator tests, the official group produced 1899 passed, 18 errors:
The same representation cases pass in the expanded group above. A later user-supplied
FunctionOperatorregression exposed use oftranspose(J)where an adjoint product is required:After changing Jacobian products to
adjoint(J), that focused test passed 32/32 checks across the four methods, and all six globalization choices are covered in the official group.The full Core environment loads Enzyme before these tests. Its first run exposed a backend-selection defect and incompatible test instrumentation (2833 passed, 12 errors in the bounded group). The VJP selector now inherits
AutoFiniteDiff()unless the user supplies a product backend. The assertion-instrumented ForwardDiff feasibility test explicitly requests finite-difference VJPs; its assertions remain enabled. Automatic reverse-AD with pure residuals remains covered (48/48 operator/reinit checks passed with Enzyme even in the failing run).A convertible sparse
MatrixOperatorregression initially failed its storage assertion and then threwMethodError: no method matching copyto!(::FunctionOperator, ...)under a direct solve. Converting through the operator's public matrix interface when a concrete system is requested preserves sparse storage. The focused regression passed 144/144 checks across all six choices, covering default, LU, LSMR, forced concrete LSMR, and reinitialization.Preconditioner initialization initially received zeros instead of the nonlinear initial state:
Passing the current state into the shared linear-cache constructor made the same focused test pass 3/3 checks; the official suite also asserts the initial callback's state and problem parameters.
GPU paths, downstream packages, and Julia prerelease were not tested locally. No tests were skipped or relaxed for this change. P2 derivative-free and quasi-Newton additions remain deferred pending benchmark demand, following the roadmap.
Julia 1.13 exposed a Dogbox reinitialization regression when cancellation left a coordinate one ulp inside its bound. The focused sparse/LSMR/GMRES reproducer failed 6/9 assertions before the fix and passed 9/9 afterward (all returned
Success, maximum solution error at most 6.94e-18). The same cases remain in the unchanged official representation/reinit tests. Dogbox now recognizes coordinate roundoff as well as simultaneous hit-time roundoff when snapping an endpoint.The downgrade CI failure was separately traced to LinearSolve 5.4's missing rank-deficient QR fallback. LinearSolve 5.6 is now required through the standalone compatibility prerequisite #1261; its existing upstream fallback supplies the fix. Minimum-version testing uses normal precompilation. An independently reported upstream world-age defect affects older LinearSolve versions with precompilation disabled and is fixed in 5.17: SciML/LinearSolve.jl#1282.
Links
Ignore this draft until reviewed by @ChrisRackauckas.
🤖 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.