Repository navigation
Make RobustNonMonotoneLineSearch traceable under Reactant.@jit - #112
ChrisRackauckas-Claude wants to merge 12 commits into
Conversation
Under ReactantCore.within_compile(), solve! runs a bounded @trace while backtracking loop and selects the step and return code with ifelse; the non-monotone history is a fixed-size traced vector updated with a mask, and nsteps is traced so a traced solver loop can carry the cache. The host path is unchanged. LineSearchSolution.retcode becomes a type parameter so it can hold a traced return code. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
Reactant lowers norm to sqrt(dot(x, x)), which underflows to 0 or overflows to Inf for finite residuals and changed accepted steps and return codes. The compiled path scales by maximum(abs, x) for the initial merit, the history and the trial merits; the host path still calls norm. Adds compiled regression tests for small Float64/Float32 and large finite merits. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
…en compiled
Making LineSearchSolution.retcode a type parameter broke dispatch on
LineSearchSolution{Float64, Nothing, Nothing}. The compiled solve! of
RobustNonMonotoneLineSearch returns an internal TracedLineSearchSolution
with the same step_size and retcode fields instead.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.292
Agent-Model: opus
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
SciMLTesting runs the "All" groups in one process. In the Downgrade job (GROUP=All, Julia lts) the root test environment loads LineSearch with the downgraded ReactantCore 0.1.21 before test/reactant is activated, so the latest Reactant there fails to precompile (`@annotate` not defined). in_all = false is SciMLTesting's setting for environment-specific groups; CI still runs GROUP=Reactant as its own job on Julia 1. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
…test Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
traced_merit called similar on the residual buffer, which has no method for a traced scalar. Only in-place residuals need a fresh buffer. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
Covers successful and failed searches checked inside @jit and after return, and makes the DF-SANE test loop stop on a failed line search as NonlinearSolve's DFSane does. Needs a SciMLBase release with successful_retcode for traced return codes. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.292 Agent-Model: opus Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/LineSearch.jl/jobs/ls109x-claude/log.txt on amdci2.julia.csail.mit.edu
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): CHANGES, risk medium. Full reviewVERDICT: CHANGES Reviewed head 1eb89a7 (#112, issue #109). Reviewer: Devin CLI, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium. Risk is medium because Blocking findings
Non-blocking findings
What I ran
What I did not verify
Links
🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.163.0 Agent-Model: gpt-6.1-sol Agent-Session: local job 112-codex (transcript kept on the agent host)
The Reactant extension in SciMLBase 3.58 supports successful_retcode on traced return codes. Enforce that floor in the package and Reactant env. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.163.0 Agent-Model: gpt-6.1-sol Agent-Session: local job 112-codex (transcript kept on the agent host)
Select NaN ratios explicitly before XLA clamp so invalid trials propagate as on the host. The regression fails twice before the guard and passes with it; the complete pinned Reactant test file passes 66 assertions. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.163.0 Agent-Model: gpt-6.1-sol Agent-Session: local job 112-codex (transcript kept on the agent host)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Codex <noreply@openai.com> Agent-Harness: Codex CLI 0.163.0 Agent-Model: gpt-6.1-sol Agent-Session: local job 112-codex (transcript kept on the agent host)
Fixes #109
Please ignore this draft until reviewed by @ChrisRackauckas.
RobustNonMonotoneLineSearchsupports a bounded Reactant-traced backtracking loop and carried history buffer, allowing a compiled DF-SANE-style caller to reuse the cache. The stacked return-code tests are merged, and both the root package and Reactant test environment require SciMLBase 3.58, whose Reactant extension supportssuccessful_retcodeinside compiled callers. Compiled interpolation explicitly propagates NaN ratios so invalid trial residuals produce the same failure as the host.The host
LineSearchSolutiontype and host search loop are unchanged. Compiled calls return an internalTracedLineSearchSolutionexposingstep_sizeandretcode, evaluate both trial directions each iteration, and do not increment function-evaluation statistics. ReactantCore is a hard dependency (MIT); Reactant remains a test-only dependency. Finite extreme merits use a scaled norm under compile.Changes completing this draft
SciMLBase.successful_retcode(sol.retcode)inside@jitand after return. The compiled DF-SANE loop stops when the line search fails.SciMLBase = "3.58"in the root and Reactant[compat]tables. QA's"3.0"and Enzyme's"2.53.1, 3.17"already allow 3.58; the developed root package enforces the effective floor in those environments.Local verification
All logs and scratch environments are under
<job>/scratch. Writable depot and temporary/cache directories are job-local;~/.juliais a read fallback. Julia defaults were not changed.Failing before / passing after
The
scratch/beforesource snapshot has the merged stacked tests, the final NaN test, the unguarded interpolation from ChrisRackauckas-Claude@c6e88d4, and the former SciMLBase compat so that 3.57.0 can resolve.setup_reactant.jldevelops that snapshot, adds Reactant 0.2.291 plus the requested exact SciMLBase version, and pins SciMLBase;run_reactant.jlincludes the official Reactant test file inside one parent testset. Both environments resolved ReactantCore 0.1.26. The final and before test files have identical SHA-256 hashes.Commands actually run from the job checkout:
SciMLBase 3.57.0, exit 1: all three return-code consumers throw the same error:
SciMLBase 3.58.0 on the identical unguarded snapshot, exit 1: the return-code tests and DF-SANE pass; only the NaN regression fails:
After developing the fixed checkout into a separate environment with the same Reactant 0.2.291 / SciMLBase 3.58.0 pins:
Exit 0:
Required package groups
Root manifest pinned SciMLBase 3.58.0. The Reactant subenvironment was independently pinned to 3.58.0; it resolved Reactant 0.2.294 / ReactantCore 0.1.26. Manifests are not committed.
All exited 0. Actual output tails:
Downgrade reproduction
Exit 0. This copies the earlier report's
downgrade.jl, runs it on Julia 1.10.12 with the stdlib skip list,mode=deps, version1, andno_promote=Mooncake, then runsPkg.build(verbose=true)and:Resolved floors: SciMLBase 3.58.0, ReactantCore 0.1.21, SciMLTesting 2.4.0. Actual tail:
Formatting, spelling, docs
All exited 0; Runic found no formatting differences, and typos emitted no diagnostics.
The docs were built from an identical source copy with Git metadata under
scratch/docs-repo, after developing that copy in its docs environment:Exit 0. The first complete build encountered HTTP 429 on the existing ColPrac link; the unchanged retry passed with link checking enabled:
Remote CI verification blocked
As of 2026-10-17 17:45:32 UTC, the seven validation workflows for this head remain queued (61 minutes since creation), with all nine visible checks still
QUEUED. There are no new-head test outputs to assess, so no remote CI success is claimed. Main's Tests workflow is also queued; main's format, docs, and downgrade workflows have completed successfully. The scheduling cause is not diagnosed.The separate Dependabot Auto-merge workflow reports
startup_failureon this head (https://github.com/SciML/LineSearch.jl/actions/runs/39050721816). The same conclusion is present on the prior head (https://github.com/SciML/LineSearch.jl/actions/runs/37780607189); its startup cause was not diagnosed here, and it exposes no check-run annotations through the queried endpoint.CI monitoring is handed to @ChrisRackauckas: read the runs when scheduled and investigate any regression before review/merge. The job stops with a written CI-verification blocker after completing the code and requested local checks.
Not verified
Remote CI results for the new head: the validation workflows are still queued after an hour.
Enzyme's separate test environment locally; GPU/TPU execution; Julia versions other than 1.12.7 and the 1.10.12 downgrade run.
A real
NonlinearSolve.DFSaneinvocation under compile. The test carries the cache through its DF-SANE-style loop and converges in 12 steps; this does not substantiate the original issue's 11-step claim.The traced path with the minimum Reactant 0.2.289 / ReactantCore 0.1.21 pairing. The host downgrade group excludes Reactant as declared in
test_groups.toml.Fresh independent review of this head. This job was explicitly assigned to work alone.
Reviewer decisions
The hard ReactantCore dependency and the compiled result's distinct internal container remain design choices for @ChrisRackauckas. Dispatch on host
LineSearchSolutiondoes not describe the compiled container. Compiled floating-point arithmetic can differ near acceptance thresholds, and compiled evaluation statistics differ as documented.Original implementation: Claude Code 2.1.292 (historical commits record the model alias
opus; exact model ID unknown), transcript<job>/log.txt. This follow-up: Codex CLI 0.163.0, model gpt-6.1-sol, transcript<job>/log.txt.Links
Risk assessment
LineSearchSolutiontype are unchanged.🤖 Generated with Codex CLI 0.163.0 (model: gpt-6.1-sol); local job 112-codex, transcript: /log.txt