Repository navigation
SimpleNonlinearSolve: single branchless loops that trace under Reactant - #1213
ChrisRackauckas-Claude wants to merge 79 commits into
Conversation
cf6dad1 to
bb507c6
Compare
|
Re-stacked on the rebased #1197 (after #1072); NonlinearSolveBase compat is now 🤖 Posted by an AI agent (Claude Code, model claude-fable-5) on behalf of Chris Rackauckas. Session: https://claude.ai/code/session_016LsC6pp9z6s5EABX9DnVjE |
|
CI triage: the red 🤖 Posted by an AI agent (Claude Code, model claude-fable-5) on behalf of Chris Rackauckas. Session: https://claude.ai/code/session_016LsC6pp9z6s5EABX9DnVjE |
4601664 to
458b609
Compare
Run every algorithm's ordinary `solve` dispatch under `Reactant.@compile`. The shared solver loop is a `ReactantCore.@trace while` over `CommonSolve.step!`, return codes are traced enums (EnzymeAD/Reactant.jl#3232, SciMLBase#1563) so the solution is built by `SciMLBase.NonlinearSolution` on every path, and the loop-carried cache state is refreshed by one reflective `dealias_traced!` instead of per-cache field lists. Trust-region, Levenberg-Marquardt, geodesic and dogleg updates are written once with `ifelse`; polyalgorithms are traced as a chain of their members. Forward-mode `AutoEnzyme` is preferred during compilation. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Agent-Harness: Claude Code 2.1.251 Agent-Model: claude-fable-5 Agent-Session: https://claude.ai/code/session_016LsC6pp9z6s5EABX9DnVjE
Write each simple solver iteration once as a `ReactantCore.@trace while` loop without early returns, so the same code runs on the host and under `Reactant.@compile`. Loop state is prepared by `Utils.init_loop_state`/ `Utils.fresh` and the solution by `Utils.simple_solution`; the Reactant-only shadow solution, copies and duplicated loops are removed. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude <[email protected]> Agent-Harness: Claude Code 2.1.251 Agent-Model: claude-fable-5 Agent-Session: https://claude.ai/code/session_016LsC6pp9z6s5EABX9DnVjE
458b609 to
67e5133
Compare
…Base layouts
`iteratively_build_sols(probs::AbstractVector)` spells out
`NonlinearSolution{...}` to type the `sols` buffer, and the vector-form
test spells the same type into the `FunctionWrapper` `SubArray` signature.
SciMLBase #1620 adds a trailing `RC` type parameter to `NonlinearSolution`,
which turns that application into a UnionAll: `Vector{ST}` then has an
abstract eltype and `isconcretetype(eltype(original))` fails.
`stripped_solution_type` spells the ten non-`RC` parameters and applies
`ReturnCode.T` only when the spelled result is not already concrete, so
`ST` is the concrete stripped-solution type under both the released
SciMLBase layout and the #1620 layout. Verified: GROUP=Core passes
against SciMLBase 3.56.0 and against the #1620 branch, including the
vector-form concreteness assertion.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.3
Agent-Model: swe-2-high
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/SciMLBase.jl/jobs/1619-devin/log.txt on amdci2.julia.csail.mit.edu
Vector-form SCC users wrap explicitfuns with a FunctionWrapper whose
second argument spells SubArray{SSol,...}. Prefer that declared SSol
over the concrete stripped_solution_type so legacy ten-parameter
signatures keep converting under SciMLBase #1620's trailing RC param.
Add a regression test for the old signature next to the updated one.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1332-cursor/log.txt on amdci2.julia.csail.mit.edu
sols_buffer_eltype previously only inspected eltype/first, so Any[plain_noop, legacy_FW] still built a concrete buffer and broke conversion. Scan every element after the eltype fast path. Derive item4's SubArray element type from public strip_solution instead of the internal stripped_solution_type helper, and cover the mixed container in item8. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1332-cursor/log.txt on amdci2.julia.csail.mit.edu
Preserve master's solver defaults, bounded methods, and trust-region safeguards. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.157.1 Agent-Model: gpt-6-astra Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-codex/log.txt on amdci2.julia.csail.mit.edu
Retain the companion branch's concrete and legacy FunctionWrapper buffer handling. Core validation: SCCNonlinearSolve tests passed on Julia 1.12.7. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.157.1 Agent-Model: gpt-6-astra Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-codex/log.txt on amdci2.julia.csail.mit.edu
Reactant compilation carries TracedRNumber{Bool} success flags through
MoreTrustRegionDescent; ConcreteStructs must not pin linsolve_success to Bool.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
Residual-dependent Moré control flow becomes ifelse/select forms with a ReactantCore.@trace λ-iteration, matching host iterates while compiling. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
More/Yuan/Fan radius policies use ifelse, and NLStats mutations gate on within_compile so traced TrustRegion/LM steps stay on one path. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
nf/njacs/nsolve/nsteps updates are Int mutations that cannot be traced; gate them so ordinary solve remains the compiled path. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
Move unreleased dependency pins into test/Reactant [sources], assert ConcreteEnum retcodes, and exercise small-radius TrustRegion compiles. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
Pick up SciML#1324 AutoDespecialize adjoint unwrap fix so Adjoint CI matches master. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
Released Reactant v0.2.289 includes traced enums (#3232); drop the EnzymeAD main source pins. Keep the SciMLBase #1620 source pin — v3.56.1 predates that merge. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
`got_step | accept_gn` hit runtime dispatch when the @trace-carried got_step widened to Integer in inference. Use ifelse so host Bool and traced Bool stay on one concrete path. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/1197-cursor/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261123T114922Z-codex-gpt-6.2-astra Agent-Session: local session 01a2083d-5ca4-7700-8319-fe7ea2c76de2 (no session URL)
Check the LU determinant sign before Halley's traced step and retain the current point on failure. Restore Broyden's host exact-root return before workspace setup. Carry the optional line-search decision explicitly, and reject unsupported low-rank iterations during tracing. Use the parent's registered DifferentiationInterface environment and termination logic. Exercise both singular residual regimes, small nonzero pivots, dense Broyden fallback, and the two low-rank implementations. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261123T145331Z-codex-gpt-6.2-astra Agent-Session: local session 01a208e5-fb5a-7ea2-9d12-deb27c3fa37d (no session URL)
PR: #1213 Reviewed head: f3ae789 Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H6:
Blocking findings
Non-blocking findings
What I ran
What I did not verifyThe full Reactant matrix did not complete. I did not verify GPU execution, downstream packages, the rendered documentation, full two-revision benchmarks, or hosted CI. AUTHOR_GRADE: {"task":"feature","score":2,"difficulty":5,"rounds":1,"author_harness":"Codex CLI 0.170.0","author_model":"gpt-6.2-astra","note":"Host Core and QA coverage is substantial. Independent probes found inconsistent successful solutions, discarded cache state, a host regression and a reproducible callback deadlock."} Head link: f3ae789 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Carry stopped and failed caches through traced control flow, and retain independent polyalgorithm candidates. Preserve shared and cyclic const-field parameters, combine norm criteria during tracing, and keep the host Moré safeguard arithmetic. Lower default dense solves to a device-side SVD and report unsupported matrix configurations and box transformations at compile time. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261125T080644Z-codex-gpt-6.2-astra Agent-Session: local session 01a211be-4390-7682-b06f-d658e7e264f6 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T104331Z-codex-gpt-6.2-astra Agent-Session: local session 01a2124d-cd0c-7873-8e13-aee5a138e440 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T104331Z-codex-gpt-6.2-astra Agent-Session: local session 01a2124d-cd0c-7873-8e13-aee5a138e440 (no session URL)
Use device-side pivoted LU for square systems and retain rank-revealing solves for singular or rectangular matrices. Carry auxiliary initialization failure through Newton, polyalgorithm and no-init caches. Honor supported step payloads and diagnose incompatible data-dependent returns. Evaluate the Moré damping square root before broadcasting and keep traced finalization out of host inference. Cover the compiled and host behavior with exact solutions, residuals, return codes and step counts. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261125T122641Z-codex-gpt-6.2-astra Agent-Session: local session 01a212ac-4305-7bd2-a65f-5c0c088f1daf (no session URL)
PR: #1213 Reviewed head: f9bd73d Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H6:
Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyGPU hardware, downstream packages, rendered documentation, benchmark timings and hosted CI. The 1.12.4 Reactant group stopped at the trust-region compile error, so its focused reruns cover only part of that matrix. AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":2,"author_harness":"Codex CLI 0.170.0","author_model":"gpt-6.2-astra","note":"Core and QA pass, the prior stepping and aliasing regressions have effective tests, and the full Reactant entry passes on Julia 1.13.3. Independent probes still expose loss of a full-rank Newton direction, unnecessary derivative calls, an SCC callback regression and Julia 1.12 compilation errors."} Head link: f9bd73d 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T144730Z-codex-gpt-6.2-astra Agent-Session: local session 01a2132d-4923-7203-9309-18780dfb9f88 (no session URL)
Evaluate Simple Newton Jacobians only for attempted steps and keep scalar arithmetic outside broadcasts in the Newton and Broyden updates. Pass history views to ordinary SCC callbacks while retaining conversion to the element types declared by wrapped transfers. Exercise the dense Newton path on the exact three-step Float32 system. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T144730Z-codex-gpt-6.2-astra Agent-Session: local session 01a2132d-4923-7203-9309-18780dfb9f88 (no session URL)
PR: #1213 Reviewed head: 60e7b46 Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H6:
Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyGPU hardware, downstream packages, rendered documentation, benchmark timings and hosted CI. The Julia 1.13.3 full-file run stopped at its first failing testset. The focused reruns cover the three files named above. AUTHOR_GRADE: {"task":"feature","score":2,"difficulty":5,"rounds":3,"author_harness":"Codex CLI 0.170.0","author_model":"gpt-6.2-astra","note":"The pivoted dense solve and 160 focused assertions pass on both Julia versions. Compiled initialization can reverse the caller’s acceptance decision, both Simple Newton variants fail to compile, and scalar termination and SCC callback regressions remain reproducible."} Head link: 60e7b46 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Pass the caller's tolerances to auxiliary initialization in cached and one-shot polyalgorithms. Select tolerances and retained members through static child indices, preserving lazy reinitialization and wrap-around when the winning index depends on traced values. Use scalar arithmetic for Newton steps and guard Broyden denominators before broadcasting. Exercise initialization failure, cache reuse, scalar trial steps and rank-one updates through CPU Reactant. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261125T162432Z-codex-gpt-6.2-astra Agent-Session: local session 01a21386-030e-72d2-9b53-a0a3c9a85bd6 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T194712Z-codex-gpt-6.2-astra Agent-Session: local session 01a2143f-a85a-7233-8130-e1049c3741ff (no session URL)
…ansfers Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1213--20261125T194712Z-codex-gpt-6.2-astra Agent-Session: local session 01a2143f-a85a-7233-8130-e1049c3741ff (no session URL)
…zation Keep the inverse times the residual change separate from the secant denominator in the diagonal good update. Construct the scaled identity with a whole-matrix broadcast during tracing so singleton vector solves can initialize the dense inverse. Assemble the augmented trust-region right-hand sides without writing through singleton views. Exercise the returned inverse, the two-step public solves, and the default auxiliary solver with an explicit initialization tolerance. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261126T011838Z-codex-gpt-6.2-astra Agent-Session: local session 01a2156f-1630-72d0-ac64-bcb6276d965b (no session URL)
PR: #1213 Reviewed head: 9f697a4 Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H6:
Blocking findings
Non-blocking findings
What I ran
What I did not verifyGPU hardware, downstream consumers, QA groups, rendered documentation, benchmark timings and hosted CI. The CI header records the supplied status. The independent device-tolerance and Broyden probes ran on Julia 1.13.3. AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":4,"author_harness":"Codex CLI 0.170.0","author_model":"gpt-6.2-astra","note":"Both Reactant suites and four sublibrary Core groups passed. Independent probes exposed a new test that enforces an incorrect inverse secant and a one-shot compilation failure with device tolerances."} Head link: 9f697a4 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Keep caller-supplied tolerance scalars independent of traced initializer and member regions. Exercise both initializer outcomes with one compiled executable and check Broyden updates against their full rank-one forms. Run the Reactant CI group on Julia 1.12.4 and the release channel. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261126T045455Z-codex-gpt-6.2-astra Agent-Session: local session 01a21635-1b9d-7c01-8771-cfd7636c9544 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.171.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261126T072211Z-codex-gpt-6.1-terra Agent-Session: local session 01a216bb-dcdb-79d1-9195-114ac1ca659f (no session URL)
Use the same conjugated step in the rank-one right factor and its denominator. Check the complex secant equation for dense and diagonal updates and the two-iteration diagonal solve on host and compiled CPU. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261126T082619Z-codex-gpt-6.2-astra Agent-Session: local session 01a216f6-a9bc-7fd2-9f67-d9ab27cc33be (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.171.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261126T093456Z-codex-gpt-6.1-terra Agent-Session: local session 01a21735-6a56-7bb3-8892-d77d27f1e7d4 (no session URL)
PR: #1213 Reviewed head: d52d7b8 Risk assessment
Review reportVERDICT: CHANGES Riskhigh (H6:
Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyHosted CI, GPU hardware, downstream packages, QA groups, documentation builds and benchmark execution. The CI header records the supplied status. The independent failure probes ran on Julia 1.12.4. AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":5,"rounds":5,"author_harness":"Codex CLI 0.171.0","author_model":"gpt-6.1-terra","note":"Both prior blockers are fixed in the merged parent paths. Both Reactant suites and both child Core groups passed. Independent probes exposed singleton initialization and complex secant failures in the child's simple Broyden path."} Head link: d52d7b8 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.171.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261126T112148Z-codex-gpt-6.1-terra Agent-Session: local session 01a21797-41fc-78a0-8ded-20cecc276f8e (no session URL)
…uffer Evaluate scalar stall tests directly and install the numeric inverse and descent step by assignment. Use the conjugated step in the good Broyden update and reuse the existing work vector for dense complex updates. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.2-astra Agent-Job: SciML__NonlinearSolve.jl__1197--20261126T105717Z-codex-gpt-6.2-astra Agent-Session: local session 01a21780-f420-7b20-ba5c-392c374b0cc9 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.169.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1197--20261126T132842Z-codex-gpt-6.1-terra Agent-Session: local session 01a2180b-7562-7d30-9728-3fe53c92919a (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261126T162810Z-codex-gpt-6.1-terra Agent-Session: local session 01a218af-b235-7f81-83d1-cf471346ccd3 (no session URL)
PR: #1213 Reviewed head: 94ce686 Risk assessment
Review reportVERDICT: MERGE Riskhigh (H6:
Blocking findingsNone. Both previous numerical blockers are resolved, and the final hosted matrix matches the parent. Non-blocking findingsThe complex-step correction allocates a vector on every real dense Broyden update. At Implementation fix: In the What I ran
What I did not verifyI used hosted results for macOS, CUDA, QA, docs, downstream and benchmarks. The allocation probe measured bytes, not elapsed solve time. AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":5,"rounds":6,"author_harness":"Codex CLI 0.170.0","author_model":"gpt-6.1-terra","note":"Both prior failures reproduced on the old head and passed on the merge. All 861 Reactant assertions passed locally and on both hosted Julia versions. The complex-step fix introduces an avoidable allocation for real vectors."} Head link: 94ce686 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-astra |
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1197--20261127T034246Z-codex-gpt-6.1-terra Agent-Session: local session 01a21b19-4dbb-7af1-a63b-9087ade0bda1 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.170.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261127T040503Z-codex-gpt-6.1-terra Agent-Session: local session 01a21b2e-3cd5-7340-b6c8-a0bacdbc6c33 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.172.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1197--20261128T034122Z-codex-gpt-6.1-terra Agent-Session: local session 01a2203f-85bb-7200-b092-268afe05ce16 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.172.0 Agent-Model: gpt-6.1-terra Agent-Job: SciML__NonlinearSolve.jl__1213--20261128T041153Z-codex-gpt-6.1-terra Agent-Session: local session 01a2205b-7b07-7c72-86a9-a490f6dd07e6 (no session URL)
What changed and why
Each SimpleNonlinearSolve iteration (
SimpleNewtonRaphson,SimpleTrustRegion,SimpleBroyden,SimpleKlement,SimpleHalley) is now written once as a branchless loop that runs unchanged on the host and underReactant.@compile:for _ in 1:maxiterswithsolved && returnbecomesReactantCore.@trace track_numbers = false while (!solved) & (iterations < maxiters); the "initial guess is already a root" early return is subsumed (the loop does not execute andsimple_solutionreportsSuccess).@traceis a compile-time no-op outside Reactant.returnor branch (SimpleHalley's factorization failure,SimpleTrustRegion's shrink-threshold exit and step acceptance,SimpleKlement's Jacobian reset) are loop conditions orifelseselections.dogleg_method!!keeps its two host early-outs behind!within_compile()with the selection as the fallthrough.Utils.init_loop_statepromotes the return code and counter withNonlinearSolveBase.maybe_tracedand makes the loop-carried arrays distinct;Utils.freshre-applies that aftercheck_termination(whose best-iterate result aliases the termination cache) and after@bb copyto!(which rebinds rather than copies for traced arrays). Both are no-ops on the host.Utils.simple_solutionbuilds theNonlinearSolutionfromsolvedwithifelse/select; the previous_build_simple_solution,_copy_for_reactant,reactant.jland thenonlinear_solution_new_algshadow-solution hack are removed, as is theBase.@noinlineon the safe-bestcheck_termination(its tests pass on 1.10 without it).SimpleTrustRegion's host loop now forms the candidate Jacobian on every iteration and selects it (previously only accepted steps recomputed it). The result-type assertions insimple_solutionexist becauseSimpleTrustRegionwithautodiff = nothinghas a run-time-typed Jacobian (prepare_jacobianreturns a non-concreteDIExtras), which is pre-existing but previously never reached the return type; with them@inferred solve(...)holds on 1.10 and 1.12.Diff on top of the core PR: 9 files, +237/−102.
Verification
Same environment as the core PR (Reactant#3232, SciMLBase#1563, DI
571fc178), Julia 1.12.4 unless noted.Reactant group with the full matrix (Simple solvers included):
SimpleNonlinearSolve's own groups with this branch's NonlinearSolveBase developed in:
Before the
select/simple_solutionresult-type assertions, the 1.10 Core group failed@inferred solve(prob, SimpleTrustRegion())in the root-finding snippet (return type NonlinearSolution{_A, _B, _C, _D, …}); with them it passes on both versions.Formatted with Runic 1.10.0;
typosclean.Not verified
SimpleDFSaneandSimpleLimitedMemoryBroydenare unchanged here (SimpleDFSane's line search branches on traced values and is still unsupported under Reactant; limited-memory Broyden already traced).GROUP=Everything.🤖 Generated with Claude Code (model: claude-fable-5) on behalf of Chris Rackauckas. Session: https://claude.ai/code/session_016LsC6pp9z6s5EABX9DnVjE
Prior agent assessment and fix reports for the pre-rebase heads were relocated verbatim to this PR's comments (2026-11-22) to keep reviews independent of them.
Risk assessment
e11385d16: 113 pass, 1 fail = CUDA (directly confirmed failing on current master push run 44568335433), 1 skipped matrix placeholder.GROUP=Reactant149/149; rootGROUP=QA28/28; SimpleNonlinearSolve QA 20/20. All four minimum-version downgrade Core groups pass on Julia 1.10.14; the compat floor is justified by a nested@tracereproducer that fails on every ReactantCore 0.1.21–0.1.24 and passes on 0.1.25.🤖 Posted by an AI agent — harness: Claude Code · model: qwen3.8-flash-next
Conversation: local session topic-reactant-work (no session URL)
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head f3ae789)
Merged the updated parent at
97a1fda0b. Both singular Halley cases now returnUnstablewith the original iterate and finite residual. The factorization check uses the determinant sign, including for small nonsingular pivots. Host Broyden exits before allocating its workspace for an exact initial root. Its compiled full step also works when the optional line-search cache is absent. The generic and static low-rank limited-memory iterations report an actionableArgumentErrorduring compilation. The two-component test exercises the dense fallback.The parent supplies the registered DifferentiationInterface array-AD guard and both termination corrections. The safe-best regression returns the first iterate with unit residual (about −20.464836). SimpleKlement returns
MaxItersfor a nonfinite residual under plain absolute-norm termination. The full group used registered DifferentiationInterface 0.7.22 and Reactant 0.2.308.SimpleTrustRegion evaluates the candidate Jacobian when the trial is accepted and another iteration is needed. The dense limited-memory fallback uses
Utils.nonlinear_solution_new_algto retain the requested algorithm in the solution. ConstructionBase and ReactantCore, the new hard dependencies of NonlinearSolveBase, both use the MIT license.Verification
The same focused suite on the original head and this head used Julia 1.13.3, registered DI 0.7.22 and ReactantCore 0.1.26. Integer and rational exact roots raised
MethodError: epsbefore the fix. The 512-element exact-root allocation fell from 4,236,256 to 4,168 bytes. On the original head, Halley reported success below the residual threshold and returned NaNs above it. The low-rank solve raised a traced-booleanTypeErrorand Newton array AD raised a scalar-indexing error. A separate original-head run with ReactantCore 0.1.27 reproducedUndefVarError: ls_cacheon the first Broyden iteration.The validation environments load the local sublibraries. The Julia 1.13.4 CPU integration used four threads and stock packages. It ran the focused checks and a garbage collection before entering the ordinary group runner. Project paths and the focused regression script are represented by shell variables.
Some Julia 1.13.3 and 1.13.4 CPU runs encountered the parent’s reproducible XLA callback/garbage-collection deadlock. The CUDA CI job encountered the same GPUCompiler deprecation assertion on both the reviewed head and master. I had no GPU for local validation. Downstream packages and the Everything group were outside this run. Parent investigation · PR CUDA log · Master CUDA log
Next counted review must come from a smart model in a fresh session, not this fix session.
🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a208e5-fb5a-7ea2-9d12-deb27c3fa37d (no session URL)
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head f9bd73d)
Merged the fixed parent from reactant-jit-solve. The merge has first parent
f3ae78971and second parent7c408456a. The counted review and the tests below identify the individual cases.[2,2]on success and the last candidate's[3,3]after two failures.[1,1], with zero residual and the winningSuccessorMaxIterscode. Both two-component cases passed 8/8.Successat50.004997, reported-0.009999, and had a recomputed residual of24.994997.0.01f0both retain0.01f0. The host and compiled residual and tolerance checks passed 28/28. The host checks for zero, one, and exhausted iteration budgets and Jacobian call counts passed 32/32.InitialFailureadvanced from 2 to 1 in one step and returned success.InitialFailure. Jacobian evaluation and available step counters stay zero. Passed 30/30, plus the scalar replay.reactant_julia_callback. The hosted group was cancelled at its two-hour limit.Success, both roots againstsqrt(2.0f0), and the materialized residual.StalledSuccessstill advances to the next member. Each case passed 8/8.DivideErrorduring a rank-one update after acceptance.[1,99//100], residual[0,1//100], andSuccess(3/3). The compiled full-step regression also passed 3/3.[u,u]changed its sibling to[1,2]. The reviewed const/cycle fixtures errored.[-0.0,1.0]; the first becomes[1,2]. Both parent const-field fixtures passed 5/5.MethodError: Cannot convert. Mixed direct signatures also failed.The SCC fixture consolidation retains the stored-element-type and warmed compile-time checks. AGENTS.md now asks for Core and QA in each changed sublibrary and verification of the resolved source paths. The benchmark workflow still requires an owner decision.
Verification
The focused drivers execute the committed regression assertions in the repository test environments. The numerical and nested-array baseline used the merge before the child changes. The parent-overlap baseline used the reviewed child head. In the commands, shell variables identify these checkouts, test targets and focused drivers.
The SCC before/after runs used the same final shared fixture. Before the fix, a decorated concrete-signature callback raised a view-conversion error. After the fix, each wrapper received its declared view and the results matched the independently solved coupled system.
Both CPU versions ran the complete root Reactant group. The test targets match the root project and include its test dependencies. The resolved solver sources point into the checkout.
The Core and QA invocations used the following package projects.
CUDA had the same GPUCompiler deprecation assertion on the reviewed PR and master (21 passed, 1 failed in both). GPU hardware, downstream packages, prerelease Julia and the full Everything matrix were outside this verification. The parent documents the Julia 1.12.4 GPUCompiler limitation. PR CUDA job · Master CUDA job · Reviewed Reactant timeout · Parent PR
Next counted review must come from a smart model in a fresh session, not this fix session.
🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a2124d-cd0c-7873-8e13-aee5a138e440 (no session URL)
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head 60e7b46)
Merged the fixed parent into the reviewed child. The merge is 737fc385b. The two parent-covered cases were tested on both sides of this merge. The child changes were tested against the merged baseline. Round-two findings
Successat[1, 134217728]with both recomputed residuals exactly zero. The Newton-path test covers the reviewer’s Float32 power of two. Thelinsolve_identity!!caller solvingA X = Iretains the parent's SVD fallback for singular square matrices. The singular generalized inverse and the small nonsingular pivot both passed.[0, 0, 1, 2]check. This child hoists the guarded Broyden denominators and subtracts scalar Newton steps directly. The trust-region, diagonal cubic and scalar Simple Newton tests passed on 1.12.4 and 1.13.3.Both reviewed-head Trim jobs failed on JET’s captured
if_result#242in host finalization. Both corresponding checks passed on the latest master push. The parent supplies the finalization fix. The complete Linux Trim group passed locally. Reviewed CI · Master CIVerification
The focused driver reads CHILD_TREE to locate the regression assertions. The shell variables below identify the reviewed and merged checkout test projects, their focused drivers, and the Julia runtime used by Trim. The focused drivers execute the committed assertions.
All three CPU Reactant groups ran to completion with local solver sources, Reactant 0.2.309 and GPUCompiler 2.10.0. Julia 1.12.4 had one remaining error in the scalar autodiff Newton/default test. The stack reaches a subtraction broadcast over two traced scalars. The parent's standalone reproducer imports only Reactant and compiles
difference(x) = x .- xfor a ConcreteRNumber. A fresh 1.12.4 process reportedMissing Julia object for global 'jl_global_48335'. The same input returned0.0f0on 1.12.7. All requested 1.12.4 cases passed, including the 48 derivative-counter checks. Julia backportThe version list in the root group table configures hosted GitHub runs. Expanding that matrix and accepting the existing H6 mechanism require an owner decision. GPU hardware, downstream packages and local macOS execution were outside this CPU validation.
Next counted review must come from a smart model in a fresh session, not this fix session.
🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a2132d-4923-7203-9309-18780dfb9f88 (no session URL)
Fix by Codex CLI 0.170.0 gpt-6.2-astra (head 9f697a4)
The compiled Simple Newton and Gauss–Newton methods now build analytic Jacobians within the active step. The SCC history view exposes its dense backing storage so decorated callbacks accepting a
StridedVectorreceive the same data as direct callbacks. The parent at0b6e2f267supplies the initialization tolerance, cache accessor and scalar stall fixes. It was already included at merge5c05de200. Round-three findingsOn Julia 1.12.4, the merged baseline reported
621 passed, 0 failed, 4 erroredin root Reactant. The four errors named the traced Jacobian slot. The same group passed 753/753 on this head. The SCC transfer test went from 151 passes and one decorated-transferMethodErrorto 156/156. The prior run also verified zero Jacobian callbacks at an acceptable initial iterate and one at an active initial iterate with the same compiled executable. Both analytic algorithms returned the active iterate[1.25f0]and residual[0.5625f0].Remaining Core and QA groups
The remote PR already pointed to this child commit at the start of validation. The first QuasiNewton Core run printed all 1,078 passes before a shell-wrapper error. The complete repeat produced the same count and exited zero.
The FirstOrder commands use the test target produced by
Pkg.test()for this checkout. Both Core targets resolve their solver packages to the checked-out source. Each invocation used a layered depot, four threads, four precompile tasks and a three-hour shell timeout.The prior run on this head completed the root CPU Reactant suite on Julia 1.12.4, 1.12.7 and 1.13.3, root Core and QA, and Core and QA for SCCNonlinearSolve, SimpleNonlinearSolve and NonlinearSolveBase. Runic, typos and the whitespace check exited zero. GPU execution, downstream packages, documentation and benchmarks were outside this local validation. The workflow and repository-instruction changes flagged as H6 in the review still require the owner's decision.
The hosted Reactant check passed on this head. The sole failing check was documentation link checking. GitHub returned HTTP 502 for two links present on master, and both returned HTTP 200 on a fresh GET. The latest master push passed the documentation job. Reactant check · Documentation failure · Master documentation check
Next counted review must come from a smart model in a fresh session, not this fix session.
🤖 Posted by an AI agent — harness: Codex CLI 0.170.0 · model: gpt-6.2-astra
Conversation: local session 01a2151c-5288-7a41-a1f0-5083494c84a4 (no session URL)
Fix by Codex CLI 0.171.0 gpt-6.1-terra (head c4a57fb)
The traced identity initialization now broadcasts over the whole matrix, including one-element matrices. The dense simple Broyden update conjugates the complex step in its right factor. Host and compiled tests cover both SimpleBroyden and the limited-memory dense fallback, checking the exact solution and both residuals.
Validation used Julia 1.12.4, four threads, a job-local depot, and a driver that imports the test dependencies and includes
test/Reactant/simple_tests.jl.DRIVERdenotes that driver. The same command was run with the added tests before and after the source fix:The four broken Core assertions match the previously reported count. Runic, typos and diff check exited zero. Core resolved the local SimpleNonlinearSolve and NonlinearSolveBase sources. The current master contains an unrelated change to parent-owned
solve.jl; it was not merged into this child fix. The full Reactant group and GPU paths were not rerun.Next counted review must come from a smart model in a fresh session, not this fix session.
🤖 Posted by an AI agent — harness: Codex CLI 0.171.0 · model: gpt-6.1-terra
Conversation: local session 01a21797-41fc-78a0-8ded-20cecc276f8e (no session URL)