Skip to content

Pick a GPU-compatible default AD when u0 lacks fast scalar indexing - #1368

Open
ChrisRackauckas-Claude wants to merge 7 commits into
SciML:masterfrom
ChrisRackauckas-Claude:default-ad-nonscalar-arrays
Open

ChrisRackauckas-Claude wants to merge 7 commits into
SciML:masterfrom
ChrisRackauckas-Claude:default-ad-nonscalar-arrays

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Solving a JLArray-backed NonlinearProblem under JLArrays.allowscalar(false) fails
because NonlinearSolveBase's default AD/Jacobian selection
(select_forward_mode_autodiff/select_reverse_mode_autodiff/select_jacobian_autodiff)
always tries ForwardDiff-based backends first, and ForwardDiff's dual-seeding
scalar-indexes the state. When ArrayInterface.fast_scalar_indexing(u0) is false,
candidate backends are now filtered to finite-differencing ones
(AutoFiniteDiff/AutoFiniteDifferences); if none is loaded, the ArgumentError names
the fix. NonlinearSolveBaseForwardDiffExt's additional_incompatible_backend_check
applies the same rule for an explicitly-requested AutoForwardDiff/AutoPolyesterForwardDiff.

Round 2 (responding to a Devin SWE-2 first-pass review, round1/REVIEW.md): the reviewer
raised one blocking correctness concern (could not execute code) and one blocking CI
failure. Both are now resolved — see below.

Review finding 1 (matrix-free/Krylov VJP path) — investigated, NOT confirmed as a bug

The reviewer argued (by static reading only, no execution available) that because
vjp_autodiff resolves to AutoFiniteDiff() for non-scalar-indexable state, any
matrix-free path (NewtonRaphson(linsolve = KrylovJL_GMRES()), or TrustRegion with
radius_update_scheme = Yuan/Bastin, which eagerly compute J'fu via a VJP operator)
would crash during JacobianOperator's eager prepare_vjp, because
DifferentiationInterface's generic PullbackSlow fallback builds Jacobian columns via
basis(x, j), which does a scalar setindex!.

I ran all four configurations the reviewer named, on JLArray under allowscalar(false):
NewtonRaphson(linsolve=KrylovJL_GMRES()), TrustRegion(linsolve=KrylovJL_GMRES()),
TrustRegion(radius_update_scheme=Yuan), TrustRegion(radius_update_scheme=Bastin)
(the last two also combined with Krylov). All pass and return the correct root, e.g.:

=== NewtonRaphson(linsolve=KrylovJL_GMRES()) ===
retcode=Success u=[2.0000000000000036, 2.0]
=== TrustRegion(radius_update_scheme=Yuan) dense ===
retcode=Success u=[2.0000000000000027, 2.0]
=== TrustRegion(radius_update_scheme=Bastin) dense ===
retcode=Success u=[2.0, 2.0]

Root cause of the discrepancy with the reviewer's static analysis: DifferentiationInterface
ships ext/DifferentiationInterfaceGPUArraysCoreExt, which overrides
DI.basis(a::AbstractGPUArray, i) to wrap the single-element seed write in
GPUArraysCore.@allowscalar:

function DI.basis(a::AbstractGPUArray{T}, i) where {T}
    b = similar(a); fill!(b, zero(T))
    @allowscalar b[i] = oneunit(T)
    return b
end

This extension auto-loads whenever GPUArraysCore is in the session (it is, transitively
via JLArrays/GPUArrays), so the PullbackSlow per-column pushforward-based pullback
is already GPU-safe — the reviewer's read of basis (and of _prepare_pullback_aux,
which calls the zero-argument basis(x) that never indexes at all) didn't account for
this extension, understandably, since they had no shell to load it and check.

I still added the four configurations above as regression tests in
misc_tests__item11.jl (8 new @tests) to lock in this currently-correct behavior,
per the reviewer's "add tests" request.

Review finding 2 (downgrade CI) — confirmed, root-caused, fixed

Reproduced exactly: pinning JLArrays=0.3.0, ArrayInterface=7.19.0, GPUArrays=11.5.5, GPUArraysCore=0.2.0, LinearSolve=5.6.0, FiniteDiff=2.32.1, DifferentiationInterface=0.7.3, ADTypes=1.13.0, ForwardDiff=1.0.1, KernelAbstractions=0.9.44, Adapt=4.5.2 (the exact
versions the downgrade-sublibraries job installed, read from its log) while keeping
NonlinearSolveBase/NonlinearSolveFirstOrder/SciMLJacobianOperators on local dev
paths (this PR's actual code) reproduces the CI failure byte-for-byte:

ERROR: LoadError: DimensionMismatch: matrix is not square: dimensions are (4, 2)
 [2] cholesky!(A::JLArray{Float64, 2}, ::LinearAlgebra.NoPivot; check::Bool)
 ...
 [7] _init_default_cacheval(alg::LinearSolve.DefaultLinearSolver, ...)
     @ LinearSolve .../src/default.jl
 ...
 [17] init(..., alg::MoreTrustRegionDescent{...}, J::JLArray{Float64,2}, ...)
     @ NonlinearSolveBase .../src/descent/more_trust_region.jl:1062

Root cause: TrustRegion's default descent (MoreTrustRegionDescent) solves its
subproblem through an augmented, non-square [J; √λ·D] system (4×2 here) via
LinearSolve.DefaultLinearSolver. At LinearSolve 5.6.0–5.13.0, the default-algorithm
infrastructure (_init_default_cacheval, a @generated function) eagerly builds the
cache for every algorithm in DefaultAlgorithmChoice, including CholeskyFactorization,
before any algorithm is actually chosen — and that eager build calls cholesky!(A)
unconditionally, which requires a square matrix. For ordinary Array/Matrix, a
specialized dispatch path avoids ever touching this generic fallback for non-square input;
for JLArray in this old LinearSolve range, it does not. Not a JLArrays version
issue
: I bisected by varying only LinearSolve while holding every other package
(including JLArrays) at the downgrade floor — bumping JLArrays alone to the newest
0.3.x (0.3.3) did not fix it; LinearSolve 5.10.0–5.13.0 still fail, LinearSolve
5.14.0 and above (tested up to current 5.18.2) pass.

Fix: raise NonlinearSolveFirstOrder's LinearSolve compat floor from "5.6" to
"5.14" (the verified minimum). Bumped the package's patch version (2.10.0 → 2.10.1)
for the compat-only change. Re-ran the exact faithful downgrade reproduction above with
this floor applied (LinearSolve pinned to 5.14.0, everything else unchanged at its
downgrade floor) and the full, now-expanded misc_tests__item11.jl (14 assertions) passes
cleanly.

I did not bump NonlinearSolveBase's own (lower, "5.4") LinearSolve floor:
MoreTrustRegionDescent/construct_linear_solver live there, so the same crash could in
principle occur there too, but NonlinearSolveBase has no JLArray test to exercise it
and its own downgrade job doesn't fail, so I left it alone rather than widen the diff —
flagging it here for a maintainer to decide.

Vector-unchanged evidence (round 1, re-confirmed)

solve on a Vector NonlinearProblem with NewtonRaphson()/TrustRegion() — output
captured on master and on this branch, byte-identical:

GeneralizedFirstOrderAlgorithm retcode=Success u=[2.000000000000002, 2.0] resid=[8.881784197001252e-15, 0.0] stats=SciMLBase.NLStats(5, 6, 5, 5, 5)
GeneralizedFirstOrderAlgorithm retcode=Success u=[2.000000000000002, 2.0] resid=[8.881784197001252e-15, 0.0] stats=SciMLBase.NLStats(5, 6, 6, 5, 5)

Failing-before / passing-after (round 1, re-confirmed)

Before (src reverted to master, keeping only the test file):
ERROR: LoadError: Scalar indexing is disallowed from ForwardDiff.seed! on the
JLArray. After (fix applied): passes.

Test-group tails (Julia 1.10.12, this branch, round 2)

  • NonlinearSolveFirstOrder GROUP=Core (full suite, ~9000 assertions across all
    algorithms, now including the 14-assertion JLArray test): all pass, e.g.
    JLArray default AD without scalar indexing |   14     14  23.2s
    Native bounded methods                     | 5989   5989  6m40.2s
    NewtonRaphson                               |  435    435  8m16.3s
    TrustRegion                                 | 1596   1596  14m31.2s
    LevenbergMarquardt                          |   45     45  56.6s
    SciMLOperator Jacobians                     |   14     14  11.0s
    
    No Error/Fail/Some tests did not pass anywhere in the run.
  • NonlinearSolveBase GROUP=Core: all pass, no Error/Fail entries (e.g. Bounds transform (#955) 138/138, construct_extension_jac scalar and matrix u0 10/10, Dense LU refactorization allocations 14/14).
  • NonlinearSolveFirstOrder GROUP=QA:
    Test Summary: | Pass  Total   Time
    QA            |   18     18  34.1s
    
  • NonlinearSolveBase GROUP=QA: still blocked locally by the pre-existing, unrelated
    SciMLJacobianOperators registry-lag issue noted in round 1 (confirmed reproduces with
    this PR's diff reverted).
  • Runic on all changed files: no diff (already formatted). typos: clean.

Non-blocking review items

Reviewed all; left as-is per the reviewer's own "minor polish" / "user-explicit backends
are allowed to fail" characterization — in particular, AutoSparse(AutoForwardDiff())
passed explicitly by a user on a non-scalar-indexable state is not intercepted by
additional_incompatible_backend_check/is_finite_differences_backend (neither unwraps
AutoSparse). Fixing it would touch the same selection logic again for a case the user
opted into explicitly; flagging it as a follow-up rather than widening this PR.

What I did not verify

  • Real GPU hardware (CUDA/Metal/ROCm) — only JLArrays.JLArray (CPU-backed, GPU-array
    semantics).
  • NonlinearSolveBase GROUP=QA locally (pre-existing registry-lag gap, round 1).
  • Whether NonlinearSolveBase's own lower LinearSolve floor (5.4) hits the same
    MoreTrustRegionDescent/JLArray crash — plausible by the same root cause, but
    untested since no local test exercises it.
  • Downstream sublibraries and the All/Everything groups.

Anything a reviewer should push back on

  • The LinearSolve floor bump ("5.6" → "5.14") is a compat-only change verified by
    bisection on this machine, not by reading LinearSolve's own changelog/PR history for
    the actual fixing commit — if a maintainer knows the exact PR, a tighter/more precisely
    justified floor might be possible.
  • Whether NonlinearSolveBase's LinearSolve floor should also move, per the note above.

Please ignore until reviewed by @ChrisRackauckas.

Risk assessment

  • Risk: low
  • Blast radius: NonlinearSolveBase's default AD/Jacobian selection and
    NonlinearSolveFirstOrder's LinearSolve compat floor. No public API signature
    changes; behavior changes only when ArrayInterface.fast_scalar_indexing(u0) == false
    (GPU-style arrays) or when installed with a very old (pre-5.14) LinearSolve; Vector
    output confirmed byte-identical.
  • Evidence: failing-before/passing-after test output; full GROUP=Core pass for both
    packages; byte-identical Vector-output comparison; the downgrade-CI failure faithfully
    reproduced locally and confirmed fixed by the LinearSolve floor bump alone (bisected
    against JLArrays separately to rule it out as the cause).
  • Independent review: pending
  • Merge: needs human review — touches default AD selection and a dependency compat
    floor on a widely-used code path

🤖 Generated with Claude Code (model: claude-sonnet-5)

https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv

Review findings addressed

Round 3, responding to the Codex review of 986d8585 (gpt-6.1-sol) and to the Devin review posted on this PR (fusion-claude-opus-5-5, on ba7a6fd2; its findings still applied at 986d8585).

Design change. The scalar-indexing restriction now applies only where a Jacobian is materialized. select_forward_mode_autodiff is back to its master behavior. select_jacobian_autodiff(prob, nothing) still considers only finite differencing for a u0 without fast scalar indexing. select_reverse_mode_autodiff(prob, nothing) considers Zygote and finite differencing. construct_jacobian_cache replaces an explicit AutoForwardDiff/AutoPolyesterForwardDiff with select_jacobian_autodiff(prob, nothing), with a warning naming the cause, but only when it builds a concrete Jacobian. NonlinearSolveBaseForwardDiffExt is back to master.

Codex review:

  1. Explicit AutoPolyesterForwardDiff guard unreachable: fixed. The check had been added to the extension's Union{AutoForwardDiff, AutoPolyesterForwardDiff} method, which the more specific AutoPolyesterForwardDiff method in src/autodiff.jl shadows. The fallback now lives in construct_jacobian_cache and dispatches on both types, so nothing shadows it. On the PR-head source, the reviewer's reproducer (with PolyesterForwardDiff loaded) fails with Scalar indexing is disallowed. With this fix it prints a warning that it is using AutoFiniteDiff() to build the Jacobian, then retcode=Success u=[2.0000000000000027, 2.0]. A regression test was added for both backends; see the evidence below.

Devin review:

  1. Blocking: the JVP silently degraded to FD, and an explicit jvp_autodiff = AutoForwardDiff() was overridden: fixed. Forward-mode selection is no longer filtered. GeneralizedFirstOrderAlgorithm's __init takes its default JVP from select_forward_mode_autodiff(prob, nothing) when no autodiff is given. For scalar-indexable states this gives the same backend as before, because the first compatible forward backend is the same in both lists. Tests assert sol.alg.jvp_autodiff isa AutoForwardDiff for NewtonRaphson(linsolve = KrylovJL_GMRES()). They also assert, with @test_logs min_level = Logging.Warn, that no warning appears for an explicit jvp_autodiff = AutoForwardDiff() or autodiff = AutoForwardDiff() with GMRES.
  2. The VJP filter was broader than needed: fixed. Default pullback selection also accepts Zygote. Enzyme, Tracker and ReverseDiff are still skipped for such states. With Zygote loaded, an out-of-place JLArray TrustRegion with Yuan, or with Bastin plus GMRES, selects AutoZygote and converges.
  3. The error hint was untested, and NonlinearSolveBase had no unit test: fixed. lib/NonlinearSolveBase/test/nonscalar_autodiff.jl uses a minimal AbstractVector with fast_scalar_indexing == false. It checks that forward selection keeps ForwardDiff, both by default and when requested explicitly. It also checks that the Jacobian and pullback ArgumentErrors carry the hint; that environment has neither FiniteDiff nor Zygote, and the test asserts this.
  4. The NR+Krylov test guarded nothing: it now asserts the JVP backend, which fails on 986d8585.
  5. The AutoSparse note was moot: agreed. AutoSparse autodiff is rejected for nonlinear problems on master too, so the earlier "Non-blocking review items" note does not apply.
  6. TrackedArray states: no change. Tracked u0 is intercepted by the solve_up overloads before backend selection, and this was not exercised. I did check that RecursiveArrayTools.ArrayPartition reports fast_scalar_indexing == true, so it is unaffected.
  7. Compat and version mismatch: no change. The FirstOrder test depends on the new NonlinearSolveBase behavior through [sources] in this repo, and the repo does not bump versions per PR.
  8. Two concerns in one PR (LinearSolve floor): no change. The reviewer called it justified and reproduced the 5.13 → 5.14 boundary.
  9. Body attribution format: this section uses the prescribed footer. I can only append here, so the earlier text is left as is.
  10. Unrelated red CI: pre-existing on master, as the reviewer confirmed. No change.

Verification (round 3, commit 76eb05c9, Julia 1.13.0)

  • misc_tests__item11.jl, run from a @testset with all four source files reverted to 986d8585 and the new tests kept: Pass 20, Fail 6, Error 4. The failures:

    • ADTypes.AutoFiniteDiff() isa AutoForwardDiff fails for the JVP checks.
    • @test_logs fails on the explicit-ForwardDiff GMRES solves.
    • Scalar indexing is disallowed for the explicit AutoForwardDiff Jacobian.
    • MethodError ... _prepare_pushforward_aux for the explicit AutoPolyesterForwardDiff Jacobian.

    With the fix: JLArray default AD without scalar indexing | 32 32.

  • nonscalar_autodiff.jl (NonlinearSolveBase), same procedure: 2 errors before, from forward-mode selection on the non-scalar-indexable vector; 7 7 after.

  • NonlinearSolveBase GROUP=Core passed, including AD selection for states without fast scalar indexing | 7 7. GROUP=QA gave QA | 20 20.

  • NonlinearSolveFirstOrder GROUP=Core passed, with Native bounded methods | 5989 5989, NewtonRaphson | 309 309, TrustRegion | 1176 1176 and JLArray default AD without scalar indexing | 32 32. GROUP=QA gave QA | 20 20.

  • Runic (Runic.jl 1.10 --check) reports no changes, and typos is clean on every changed file.

  • Hand probe on JLArray with allowscalar(false), out-of-place and in-place, with nothing extra loaded, then with PolyesterForwardDiff, Zygote or Enzyme loaded. NR, NR+GMRES, TR, TR-Yuan, TR-Bastin+GMRES and LM all converge.

    • With PolyesterForwardDiff loaded, the default JVP is AutoPolyesterForwardDiff and it works.
    • With Enzyme loaded, the VJP stays AutoFiniteDiff.

Not verified (round 3)

  • Real GPU hardware. Only JLArrays was used.
  • Julia LTS (1.10) and pre locally. CI covers them.
  • The docs build. Three docstrings gained a plain-prose sentence, with no new cross-references.
  • SimpleNonlinearSolve, NonlinearSolveQuasiNewton and the wrappers on a JLArray. Their default Jacobian selection is the same as at 986d8585. An explicit ForwardDiff Jacobian in SimpleNonlinearSolve, which does not go through construct_jacobian_cache, still hits scalar indexing, as it does on master.
  • A pre-existing issue, untouched here: the extension's !ForwardDiff.can_dual(eltype(u0)) check is also shadowed for AutoPolyesterForwardDiff on master. That method dispatch is unchanged.

🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID f03b52ab-a58e-4e04-ba2d-e21251716c41 (headless, no URL)

Risk assessment (independent review, codex-cli gpt-6.1-sol, reviewed head 76eb05c)

  • Risk: low
  • Blast radius: NonlinearSolveBase's automatic Jacobian/pullback backend selection for AbstractArrays without fast scalar indexing; explicit ForwardDiff/Polyester fallback when constructing concrete Jacobians; FirstOrder's default JVP initialization. FirstOrder also requires LinearSolve >=5.14. No public names/signatures are removed, and JLArrays is test-only.
  • Evidence: Reviewed 76eb05c9b191ed600cff9c7f43d7259f35631d93; end SHA unchanged. On Julia 1.13.0 with JULIA_NUM_THREADS=4, the official JLArray regression passes 32/32, the Base selector regression passes 7/7, and an additional loaded-Polyester solver/JVP regression passes 6/6. The same official JLArray file on pre-fix 986d8585 produces 20 passes, 6 failures, 4 errors. The original default Newton/JLArray reproducer on master dd8a550b errors with scalar indexing disallowed. CI at both snapshots: 18 pending, no completed failures to compare; current runs include https://github.com/SciML/NonlinearSolve.jl/actions/runs/38923137772 and https://github.com/SciML/NonlinearSolve.jl/actions/runs/38923137822 . Pending CI does not establish a green build.
  • Independent review: codex-cli 0.163.0 gpt-6.1-sol rated it low, high confidence in the exercised paths: discriminating tests confirm the explicit-Polyester fix and preserve exact matrix-free JVPs; no silencing or unflagged breaking API change found. Risk assessed before reading the body's risk claims.
  • Merge: auto-merge candidate — small behavioral scope with reproduced failing-before/passing-after evidence and no observed PR-caused CI failure; complete the pending CI checks before merging.

🤖 Posted by an AI agent — harness: codex-cli · model: gpt-6.1-sol (independent reviewer; appended by Claude Code 2.1.301 · claude-opus-5-5)
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.164.0 gpt-6.1-sol (head c6b8a7e)

Merged upstream master normally to incorporate the Julia 1.10 polyalgorithm inference fix, which asserts the runtime-indexed subcache return code as ReturnCode.T. Both reported LTS failures also occurred on historical master; the latest master CI passes both affected checks. The merge preserves both FirstOrder tests that shared a filename: the JLArray test is byte-for-byte preserved as jlarray_autodiff_tests.jl, alongside the upstream forcing test.

Failing before / passing after

On archived original head 76eb05c9, with local sublibraries developed, BASELINE_PROJECT identifies that archived package environment:

GROUP=Core timeout 3600 julia +lts --startup-file=no --project="$BASELINE_PROJECT" -e 'using Pkg; Pkg.test()'

Exit 1, reproducing the CI inference error:

Test Summary:                | Pass  Error  Total   Time
PolyAlgorithm Type Inference |    8      1      9  16.2s
  solve() inference          |    8             8  10.7s
  solve!() inference         |           1      1   4.8s
ERROR: LoadError: Some tests did not pass: 8 passed, 0 failed, 1 errored, 0 broken.

The merged checkout passes the same inference test (16/16) and the full Core group.

Validation

All tests used Julia 1.10.12, JULIA_NUM_THREADS=4, OPENBLAS_NUM_THREADS=1, and local sublibrary development paths. Julia 1.10 requires explicitly developing those paths because it ignores [sources].

GROUP=Core timeout 7200 julia +lts --startup-file=no --project -e 'using Pkg; Pkg.test()'
GROUP=QA timeout 7200 julia +lts --startup-file=no --project -e 'using Pkg; Pkg.test()'
GROUP=NonlinearSolveBase timeout 7200 julia +lts --startup-file=no --project -e 'using Pkg; Pkg.test()'
GROUP=Core timeout 7200 julia +lts --startup-file=no --project=lib/NonlinearSolveFirstOrder -e 'using Pkg; Pkg.test()'

All four commands exited 0. Relevant output and final lines:

PolyAlgorithm Type Inference |   16     16  29.4s
     Testing NonlinearSolve tests passed
QA            |   26     26  2m06.7s
     Testing NonlinearSolve tests passed
AD selection for states without fast scalar indexing |    7      7  0.3s
     Testing NonlinearSolveBase tests passed
     Testing NonlinearSolve tests passed
Eisenstat-Walker forcing uses the current residual ratio |   40     40  4.7s
JLArray default AD without scalar indexing |   32     32  26.2s
SciMLOperator Jacobians |   14     14  5.7s
     Testing NonlinearSolveFirstOrder tests passed

Formatting and spelling, both exit 0 with no output:

julia +1.12 --project=@runic -m Runic --inplace lib/NonlinearSolveBase/src/autodiff.jl lib/NonlinearSolveBase/src/jacobian.jl lib/NonlinearSolveBase/test/nonscalar_autodiff.jl lib/NonlinearSolveBase/test/runtests.jl lib/NonlinearSolveFirstOrder/src/solve.jl lib/NonlinearSolveFirstOrder/test/jlarray_autodiff_tests.jl lib/NonlinearSolveFirstOrder/test/misc_tests.jl
git diff upstream/master | typos -
git diff --check

An initial nested FirstOrder invocation was stopped to enforce the process limit; the direct full Core command above completed successfully. Local verification does not cover macOS, real GPUs, downstream packages, the Everything suite, documentation builds, or completed CI on this new head.

Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).

Links


🤖 Posted by an AI agent — harness: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__NonlinearSolve.jl__1368 (no session URL)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Muse CLI Code muse-wonder-full-1.0 (head c679ccb)

rack ci compare classed two checks as base-green: sublibraries / lib/NonlinearSolveHomotopyContinuation / Julia 1 / Tests - Core (Julia 1) and the matching [QA] check. Both failed while precompiling TaylorDiff, before any test in this repository ran:

ERROR: LoadError: TypeError: non-boolean (Symbolics.Num) used in boolean context
  [1] derivatives_given_output(Ω::Symbolics.Num, ::typeof(tanh), x::Symbolics.Num)
    @ ChainRules .../src/rulesets/Base/fastmath_able.jl:42
  [3] get_term_raiser(func::Function)
    @ TaylorDiff .../src/utils.jl:56
  LoadError: The following 1 package failed to precompile: TaylorDiff

Root cause, confirmed by comparing the passing base run of 2026-11-03 with the failing head run of 2026-11-08 and by reading the installed package sources: the base run resolved ChainRules 1.74.8 and the head run resolved ChainRules 1.74.12, with TaylorDiff 0.3.5 and Symbolics 7.48.0 in both. ChainRules 1.74.12 changes the tanh scalar rule to abs(real(x)) < 1 ? 1 - Ω ^ 2 : sech(x) ^ 2. TaylorDiff 0.3.5 evaluates ChainRules forward rules on a Symbolics.Num while precompiling, so the value-dependent branch puts a symbolic term in a boolean context. TaylorDiff 0.3.6 takes its derivative expressions from DiffRules instead and precompiles with that ChainRules version. The HomotopyContinuation sublibrary project is identical on the base branch, so the same resolution fails there; the base check was green only because it ran before ChainRules 1.74.12 was resolved.

Changes:

  • lib/NonlinearSolveHomotopyContinuation/Project.toml: raise the TaylorDiff compat floor from 0.3.1 to 0.3.6 and bump the sublibrary patch version from 0.1.13 to 0.1.14 for the compat change.
  • Merged the current upstream default branch into this branch normally (no rebase), bringing in the BracketingNonlinearSolve verbosity change.

Failing before / passing after

A scratch environment pinning ChainRules 1.74.12, varying only TaylorDiff:

julia --startup-file=no repro_taylordiff.jl 0.3.5   # exit 1
julia --startup-file=no repro_taylordiff.jl 0.3.6   # exit 0
# 0.3.5
ERROR: LoadError: TypeError: non-boolean (Symbolics.Num) used in boolean context
PRECOMPILE_FAIL TaylorDiff 0.3.5: PkgPrecompileError: The following 1 package failed to precompile: TaylorDiff
# 0.3.6
   3.2 s  ✓ TaylorDiff
PRECOMPILE_OK TaylorDiff 0.3.6

Validation

All Julia runs used Julia 1.13.2 with JULIA_NUM_THREADS=4:

GROUP=Core timeout 3600 julia --project=lib/NonlinearSolveHomotopyContinuation -e 'using Pkg; Pkg.test()'
GROUP=QA timeout 3600 julia --project=lib/NonlinearSolveHomotopyContinuation -e 'using Pkg; Pkg.test()'
GROUP=QA timeout 3600 julia --project -e 'using Pkg; Pkg.test()'
julia --project=@runic -m Runic --inplace <changed Julia files>
git diff upstream/master | typos -

Observed output:

GROUP=Core (NonlinearSolveHomotopyContinuation), exit 0:
AllRoots      |  116    116  1m20.2s
Single Root   |   35     35  44.5s
Taylor Polynomialize |   40     40  1m00.0s
     Testing NonlinearSolveHomotopyContinuation tests passed

GROUP=QA (NonlinearSolveHomotopyContinuation), exit 0:
QA            |   19       1     20  47.1s
     Testing NonlinearSolveHomotopyContinuation tests passed

GROUP=QA (root), exit 0:
QA            |   28     28  46.8s
     Testing NonlinearSolve tests passed

Runic exited 0 with no diff and typos produced no output. One earlier local Core rerun errored on a missing precompiled Rmath_jll shared library in the shared depot; the identical command then passed in full as shown above, so that error was a stale shared precompile cache, not a test result. The remaining red checks on the previous head (CUDA, SCCNonlinearSolve Core, the HomotopyContinuation downgrade lane, and Documentation) are classed pre-existing by rack ci compare; the downgrade and Documentation logs show the same TaylorDiff precompile failure, which this floor also excludes, but neither lane was rerun locally. Completed CI on this new head, other sublibraries, Julia lts, and real GPU hardware were not verified locally.

Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).


🤖 Posted by an AI agent — harness: Muse CLI Code · model: muse-wonder-full-1.0
Conversation: local fixer job SciML__NonlinearSolve.jl__1368 (no session URL)

ChrisRackauckas and others added 2 commits October 7, 2026 17:23
`select_forward_mode_autodiff`, `select_reverse_mode_autodiff`, and
`select_jacobian_autodiff` scalar-index the state when probing
ForwardDiff-based backends, which fails for arrays such as `JLArray`
under `allowscalar(false)`. When
`ArrayInterface.fast_scalar_indexing(u0)` is `false`, candidate
backends are now restricted to finite-differencing ones
(`AutoFiniteDiff`/`AutoFiniteDifferences`); if none is loaded, the
`ArgumentError` names the fix. Vector/StaticArray problems are
unaffected (fast scalar indexing stays `true`), verified by a
byte-identical before/after comparison of `solve` output on a Vector
problem.

Adds a JLArray regression test (`allowscalar(false)`, NewtonRaphson
and TrustRegion) via a test-only `[extras]`/`[targets]` dependency on
JLArrays (MIT-licensed, matching NonlinearSolveFirstOrder).

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.293
Agent-Model: claude-sonnet-5
Agent-Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Extends the JLArray regression test to cover matrix-free Krylov linsolve
and the Yuan/Bastin trust-region radius updates, which exercise the VJP
operator a reviewer flagged as a possible scalar-indexing crash site.
Running them confirms `DifferentiationInterface`'s `GPUArraysCoreExt`
already makes that path GPU-safe; the tests lock in that behavior.

Raises the `LinearSolve` compat floor from "5.6" to "5.14": at the lower
floor, `LinearSolve`'s default-algorithm cache construction eagerly runs
`cholesky!` on every candidate algorithm, including on the non-square
augmented system `MoreTrustRegionDescent` builds for `JLArray`, before any
algorithm is chosen. Bisected against a faithful reproduction of the
downgrade-sublibraries job (every dependency pinned to the exact versions
that job installs); `LinearSolve` 5.6.0-5.13.0 fail, 5.14.0+ pass, and the
fix is independent of the `JLArrays` version.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.293
Agent-Model: claude-sonnet-5
Agent-Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): CHANGES, risk medium.

Full review

VERDICT: CHANGES
RISK: medium

PR: #1368 (head ba7a6fd, merge-base 0055e31). No linked/closing issue, so there was no parent or tracking issue to check sibling work against.

Blocking findings

  1. The JVP path for non-scalar-indexable state has regressed from exact ForwardDiff to finite differences, and an explicit jvp_autodiff = AutoForwardDiff() is now overridden. (Confirmed by running.)
    • Where: lib/NonlinearSolveBase/ext/NonlinearSolveBaseForwardDiffExt.jl:143-149 and lib/NonlinearSolveBase/src/autodiff.jl:79 / :185-191. additional_incompatible_backend_check and _autodiff_candidates feed every selector: Jacobian, forward-mode (JVP), and reverse-mode (VJP). Only dense Jacobian construction scalar-indexes, because ForwardDiff.seed! does duals[idx] = …. ForwardDiff's pushforward/JVP on a JLArray is GPU-safe and exact.
    • Evidence (scratch/probe2.jl, JLArrays.allowscalar(false), run against both master and the PR):
      # both envs
      pushforward AutoForwardDiff()   maxerr=0.0
      pushforward AutoFiniteDiff()    maxerr=7.55e-8
      # master
      NR Krylov default AD                Success nsteps=5 resid=1.79e-6 jvp_ad=AutoForwardDiff
      NR Krylov jvp=ForwardDiff explicit  Success nsteps=5 resid=1.79e-6 jvp_ad=AutoForwardDiff
      # PR
      NR Krylov default AD                Success nsteps=5 resid=4.53e-6 jvp_ad=AutoFiniteDiff
      NR Krylov jvp=ForwardDiff explicit  Success nsteps=5 resid=4.53e-6 jvp_ad=AutoFiniteDiff
          WARNING: The chosen AD backend `AutoForwardDiff()` does not support the chosen problem ... detected `AutoFiniteDiff()`
      
      The problem was Float32, n=200, a coupled A*u + u.^3 - b. scratch/probe_master_rev.log also shows that NewtonRaphson(linsolve = KrylovJL_GMRES()) on a JLArray already succeeds on master. That makes matrix-free Newton–Krylov, the main large-GPU configuration, a working path that this PR silently degrades. The warning text is also misleading: it says the backend package may not be loaded.
    • Rule: AGENTS.md says "Honor … JVP/VJP callbacks and AD backends" and "Krylov paths must work through operators without materializing the Jacobian". The PR overrides a backend the user chose explicitly and that works, and only the operator path needed no change at all.
    • Required change: apply the non-scalar-indexing exclusion only where a Jacobian is actually materialized. One way is the selection used for dense construct_jacobian_cache. Another is to materialize through a pushforward-per-column path, which is GPU-safe because DI's basis is @allowscalar-wrapped. Do not apply it in select_forward_mode_autodiff / additional_incompatible_backend_check for JVPs. When no concrete Jacobian is formed (Krylov / concrete_jac = false), the default JVP for a JLArray must stay AutoForwardDiff, and an explicit jvp_autodiff = AutoForwardDiff() must not be replaced. Add tests that assert the selected backend on the operator path (for example sol.alg.jvp_autodiff isa AutoForwardDiff for NR+GMRES on a JLArray) and that the explicit choice produces no warning. Today's tests only check retcode and root, so they cannot detect this degradation.

Non-blocking findings

  • The VJP filter is broader than needed. (Confirmed by running, scratch/probe3.jl.) For VJP selection _autodiff_candidates discards everything except FD. On a JLArray, DI.pullback with AutoZygote is exact (maxerr 0.0). AutoEnzyme (both modes) fails with EnzymeRuntimeActivityError. Master's default reverse pick, Enzyme, would therefore have failed, so the PR is an improvement there. But a loaded Zygote is skipped in favour of FD. Consider filtering by "known to scalar-index" (ForwardDiff/Polyester, plus Enzyme if desired) rather than "keep only FD", and say so in the comment at autodiff.jl:183-184.
  • The _nonscalar_state_hint error path is untested, and the selectors have no unit test in NonlinearSolveBase (the package that changed). All new tests live in NonlinearSolveFirstOrder and go through solve.
  • The NR+Krylov test is not a regression test. misc_tests__item11.jl:20-22 also passes on master (see probe_master_rev.log), so it guards nothing this PR changed. The TR+Krylov, Yuan and Bastin cases do need the Jacobian selection change.
  • AutoSparse note in the PR body is moot. NewtonRaphson(autodiff = AutoSparse(AutoForwardDiff())) errors on both master and the PR with "Specifying a sparse AD type for Nonlinear Problems was removed in v4", independent of this change.
  • TrackedArray state is also caught. ArrayInterface.fast_scalar_indexing is also false for Tracker.TrackedArray / ReverseDiff.TrackedArray (ArrayInterface exts), so a tracked u0 that reaches selection would also switch to FD. In-repo solve_up overloads intercept tracked inputs first, so this is suspected harmless; not exercised.
  • Compat and version mismatch. NonlinearSolveBase src behaviour changed without a version bump, while NonlinearSolveFirstOrder was bumped to 2.10.1. Its new test needs the new Base behaviour, but its NonlinearSolveBase = "2.54" compat allows the old Base. It is fine in-repo via [sources]. The repo does not usually bump per PR (for example 44e6a9a4), so this is minor.
  • Two concerns in one PR. The LinearSolve floor raise ("5.6" → "5.14") is a compat change bundled with the AD-selection change. It is justified because the new TrustRegion/JLArray test needs it, and I reproduced the bisection endpoint (see "What I ran").
  • PR body attribution does not follow CLAUDE.md. The body has no first-line UNREVIEWED banner, and the footer lacks the harness version and is not in the prescribed format. The commit trailers are correct.
  • Unrelated red CI jobs. CI on the head has red jobs: Core (lts, ubuntu/macos) solve!() inference, Trim (macos), and SCCNonlinearSolve Core isconcretetype(eltype(original)). The same jobs are red on master at the merge-base, in runs https://github.com/SciML/NonlinearSolve.jl/actions/runs/37942671576 and https://github.com/SciML/NonlinearSolve.jl/actions/runs/37266049518. They are not attributable to this PR.

What I ran

All on Julia 1.12.7 in scratch environments that Pkg.develop the PR's lib/ (or a git archive of origin/master lib/). The checkout itself was not modified.

  • New test file, fail before / pass after. I ran misc_tests__item11.jl in a @testset. PR: item11 | 14 14 pass. Master: errors with Scalar indexing is disallowed at item11.jl:8. This reproduces the author's failing-before / passing-after claim.
  • Selection and solver probes (scratch/probe.jl). These ran on the PR, the PR with Zygote+Enzyme loaded, and master with both loaded.
    • Vector selection is unchanged: Jacobian/forward → AutoForwardDiff, explicit ForwardDiff is kept.
    • On a JLArray the PR picks AutoFiniteDiff for all three selectors.
    • With the PR, JLArray solves succeed for iip NR, TR and NR+GMRES, oop LevenbergMarquardt, PseudoTransient, and explicit AutoForwardDiff (which falls back to FD). On master the iip NR and TR solves, LevenbergMarquardt, PseudoTransient and explicit AutoForwardDiff all fail with scalar indexing; iip NR+GMRES already succeeds there. The AutoSparse case errors on both (see Non-blocking).
    • A coupled n=40 Float64 problem was compared against a Vector reference for NR, TR, NR+GMRES and TR-Yuan. The PR agrees to 1.4e-12, 7e-15, 3.4e-12 and 1.4e-12 respectively, with residuals ≤ 7e-12. On master only the Krylov case runs; the other three throw scalar indexing.
  • scratch/probe2.jl: ForwardDiff vs FD pushforward on a JLArray, and Float32 n=200 NR+GMRES with the default and with explicit jvp_autodiff, on master and the PR. This is blocking finding 1.
  • scratch/probe3.jl: DI pullback/pushforward on a JLArray with Zygote, Enzyme Reverse/Forward, and FiniteDiff. Zygote is exact; Enzyme fails with runtime activity. FiniteDiff called directly through DI with no preparation fails with a MethodError on DI's PushforwardFast path. The solver uses prepared operators and works anyway, as the Krylov solves show.
  • LinearSolve floor claim. PR Base + SciMLJacobianOperators + master FirstOrder (floor 5.6), with LinearSolve pinned:
    • 5.13.0: DimensionMismatch: matrix is not square: dimensions are (4, 2), 3 pass / 1 error.
    • 5.14.0: 14/14 pass.
    • JLArrays was 0.3.3 and SciMLBase 3.57.0 in both. This confirms the 5.13 → 5.14 boundary with the other dependencies current. I did not reproduce the full downgrade-floor set.
  • CI. I read the head's checks with gh pr checks and gh run view --log-failed, and compared them with master runs.
  • Cleanup. No Julia processes were left running (checked with pgrep).

What I did not verify

  • Real GPU hardware (CUDA/Metal). Only JLArrays was used.
  • The author's full GROUP=Core / GROUP=QA runs for NonlinearSolveBase and NonlinearSolveFirstOrder. I did not run them, per the host limits. CI's FirstOrder and downgrade jobs on the head are green.
  • The exact downgrade-sublibraries floor set (only LinearSolve was pinned).
  • SimpleNonlinearSolve, NonlinearSolveQuasiNewton, arclength and wrappers. These also call select_jacobian_autodiff and get the same behaviour change, but I did not exercise them on a JLArray.
  • The _nonscalar_state_hint error message, i.e. the case where no FD backend is loaded.

🤖 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
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

ChrisRackauckas and others added 2 commits October 16, 2026 05:33
Address the review findings on default AD selection for states without
fast scalar indexing (GPU arrays):

- Forward-mode (JVP) selection is no longer narrowed. ForwardDiff
  pushforwards seed by broadcasting and work on such arrays, so
  NewtonRaphson/TrustRegion with a Krylov linsolve keep AutoForwardDiff
  as the default JVP, and an explicit jvp_autodiff = AutoForwardDiff()
  is kept without a warning. GeneralizedFirstOrderAlgorithm derives its
  default JVP from select_forward_mode_autodiff(prob, nothing) when no
  autodiff is given, which is unchanged for scalar-indexable states.
- construct_jacobian_cache replaces an explicit AutoForwardDiff or
  AutoPolyesterForwardDiff with select_jacobian_autodiff(prob, nothing),
  with a warning, only when it builds a concrete Jacobian for such a
  state. The check previously lived in the ForwardDiff extension's Union
  method, which the more specific AutoPolyesterForwardDiff method in
  src/autodiff.jl shadowed, so an explicit Polyester backend still hit
  scalar indexing.
- Default pullback selection for such states also accepts Zygote.
- Tests: a NonlinearSolveBase unit test for the selectors and the error
  hint; the FirstOrder JLArray test now checks the selected JVP backend,
  that explicit ForwardDiff on the matrix-free path warns nothing, and
  the finite-difference fallback for explicit ForwardDiff/Polyester
  Jacobians.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.301
Agent-Model: claude-opus-5-5
Agent-Session: local session ID f03b52ab-a58e-4e04-ba2d-e21251716c41 (headless claude -p, no URL)
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a1973b-c23f-7ee0-8f63-7b06167b1bbf, reviewed head 76eb05c

  • Verdict: MERGE-WITH-ISSUES
  • Risk: high (H2: automatic Jacobians switch to finite differences on GPU-style states; MH1 also applies to main-lane backend dispatch).
  • Round / slot: 1 / 1
  • Blocking priorities: none

Review written by the reviewer named above in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands.

Summary: The PR selects finite differences for concrete Jacobians of states without fast scalar indexing while preserving forward-mode JVPs and permitting Zygote pullbacks. The JLArray regression fails on the merge-base and passes all 32 assertions at head; existing CI failures require follow-up, with no new correctness blocker identified.

Blast radius: NonlinearSolveBase Jacobian and reverse-mode selectors and concrete Jacobian construction; FirstOrder Newton/trust-region initialization and matrix-free products; other callers of the shared selectors. FirstOrder also raises its LinearSolve lower bound to 5.14; JLArrays and Logging are test dependencies.

Evidence: Blind assessment was recorded and hashed before author context. Julia 1.13.2 head run: selector regression 7/7 and JLArray regression 32/32, exit 0; the identical JLArray file errors on the first Newton solve at merge-base dd8a550 (scalar indexing in ForwardDiff.seed!, exit 1). Final independent probe: 52/52, exit 0, including loaded Polyester/Zygote, in-place/out-of-place solves, parameter-changing reinitialization, and a rectangular least-squares reference. Inspected successful sublibrary CI logs and all three failed PR CI jobs; the LTS inference failure matches merge-base master CI, and the SCC assertion also fails on recent master.

Blocking findings

None.

Non-blocking findings

  1. non-blocking — test/Core/core_tests__item3.jl:27 and lib/SCCNonlinearSolve/test/core_tests__item4.jl:100: confirmed by reading executed CI logs. The PR has two LTS solve!() inference errors (8 passes, 1 error) and one SCC isconcretetype(eltype(scc_sol_debug.original)) failure (12 passes, 1 failure), so overall CI is not green. The exact LTS failure also occurs on merge-base master run 38812969394, and the exact SCC assertion fails on recent master run 41195235340. Track these existing failures and obtain a green run after the corresponding master fixes are incorporated; do not weaken these assertions.

What I ran

  • Read the complete review rules and root AGENTS.md; inspected git diff origin/master...HEAD, changed files, selector callers, Jacobian construction, FirstOrder initialization, and test wiring. Recorded and SHA-256-hashed the blind assessment before reading the description or commit body.
  • Git commands (exit 0): git status --short, git fetch origin '+refs/pull/1368/head:refs/remotes/pr/1368' master, git fetch origin '+refs/heads/master:refs/remotes/origin/master', git checkout --detach pr/1368, git rev-parse HEAD origin/master, git merge-base origin/master HEAD, git diff --stat origin/master...HEAD, git diff origin/master...HEAD, git ls-remote origin refs/heads/master, and git log -1 --no-merges --format=%B HEAD. Head matches the target. The current master tip is the Base header; the merge-base and API-reported comparison base are dd8a550b79c4c9ea72a7b95b9233a34ffdb5bd8e.
  • Julia runs use JULIA_NUM_THREADS=4, OPENBLAS_NUM_THREADS=1, an isolated temporary directory, the assigned writable shared depot followed by default depots, and JULIA_PKG_PRECOMPILE_AUTO=0. Scripts create separate review environments with Pkg.activate, develop the local NonlinearSolveBase/FirstOrder/SciMLJacobianOperators packages, and instantiate with registry updates disabled. No checkout test project is created.
  • Run 1: timeout 3600 julia +1.13.2 --startup-file=no run_head.jl, exit 0. First a minimal Base/ForwardDiff environment includes lib/NonlinearSolveBase/test/nonscalar_autodiff.jl: Base selector regression at head | 7 7. Then a FirstOrder/JLArrays environment includes lib/NonlinearSolveFirstOrder/test/misc_tests__item11.jl: JLArray regression at head | 32 32. Reference roots are analytically [2,2]; the Jacobian reference is analytically diag(2,4), with an explicit finite-difference error allowance. Dense Newton/trust-region, GMRES, Yuan/Bastin, explicit JVP retention and explicit ForwardDiff/Polyester Jacobian fallback execute.
  • Run 2: git archive dd8a550b79c4c9ea72a7b95b9233a34ffdb5bd8e extracted the merge-base into a separate review copy (exit 0); timeout 3600 julia +1.13.2 --startup-file=no run_base.jl develops that copy in a separate environment and includes the unchanged head JLArray test file. Exit 1: JLArray regression at merge-base dd8a550b | Error 1 Total 1; LoadError: Scalar indexing is disallowed, originating in ForwardDiff.seed! during the first default Newton solve. This directly establishes failing-before/passing-after against the actual merge-base, rather than an intermediate PR commit. Later assertions are not reached on base.
  • Run 3: timeout 3600 julia +1.13.2 --startup-file=no run_probe.jl, exit 0. Added and loaded PolyesterForwardDiff and Zygote in the head environment. Independent reference, loaded AD backends, reinitialization | 52 52. With scalar indexing disabled, in-place and out-of-place Newton (explicit Polyester concrete Jacobian and default GMRES) and Yuan/Bastin trust-region configurations converge to analytically known [2,2]; reinitializing each cache with parameter 9 yields [3,3]. Output records jvp=AutoPolyesterForwardDiff throughout, vjp=AutoZygote out of place, and vjp=AutoFiniteDiff in place. An independent 3-by-2 linear least-squares system with rows [1,0], [0,1], [1,1] converges to [1,2]; parameter-changing reinitialization gives [1.9999999999999998,3.0] against exact [2,3]. All solution assertions use rtol=1e-7. This fresh process also exercises the resolved GPUArraysCore environment. No further Julia runs were made.
  • Resolved packages: DifferentiationInterface 0.7.21, FiniteDiff 2.33.0, ForwardDiff 1.4.6, LinearSolve 5.18.3, JLArrays 0.3.3, SciMLBase 3.58.0, ArrayInterface 7.30.2. The head process loaded GPUArraysCore 0.2.2 during the minimal stage before the FirstOrder resolver selected 0.2.1; the fresh final probe uses the resolved environment.
  • Read-only GitHub commands: gh pr view 1368 --repo SciML/NonlinearSolve.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid; description/status/commit queries after the blind hash; gh pr checks 1368 --repo SciML/NonlinearSolve.jl (exit 1: three failed jobs); gh run list --repo SciML/NonlinearSolve.jl --branch master --event push --limit 5 and workflow-filtered lists; gh run view RUN_ID --repo SciML/NonlinearSolve.jl --log-failed for 38923137772, 38923137822, 41267074142, 41195235340 and 38812969394. Log reads succeed with a review-local writable GitHub CLI cache; the first attempt using the default read-only cache failed.
  • CI evidence: FirstOrder Core records JLArray default AD without scalar indexing | 32 32; Base Core records AD selection for states without fast scalar indexing | 7 7. Both sublibraries also pass their LTS/pre Core and QA jobs. PR main CI has the two LTS failures; merge-base master main CI has the same inference error on both operating systems. PR SCC failure matches recent master sublibrary CI. Latest master main CI 41267074142 fails a different inference assertion; it was not used as evidence for the PR's exact LTS failure.

What I did not verify

Real CUDA/Metal/ROCm hardware, alternative Julia versions locally, full package/downstream suites, benchmarks, documentation builds, every consumer of the shared selectors, or the exact LinearSolve 5.13/5.14 compatibility boundary. The Base selector test was run only on head, not on base; the JLArray base run aborts at its first solve, so later base assertions were not individually verified. No upstream comments, reviews, approvals, labels or pushes were made.

🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

@ChrisRackauckas-Claude
ChrisRackauckas-Claude marked this pull request as ready for review November 2, 2026 02:05
ChrisRackauckas and others added 3 commits November 7, 2026 23:39
Bring in the upstream polyalgorithm return-code type assertion and preserve
both FirstOrder test suites under distinct filenames.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex CLI 0.164.0
Agent-Model: gpt-6.1-sol
Agent-Session: local fixer job SciML__NonlinearSolve.jl__1368 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-wonder-full-1.0
Agent-Session: local fixer job SciML__NonlinearSolve.jl__1368 (no session URL)
TaylorDiff 0.3.5 evaluates ChainRules forward rules on Symbolics terms
while precompiling. ChainRules 1.74.12 gives tanh a value-dependent
rule, so that evaluation fails with a non-boolean Symbolics.Num in a
boolean context and TaylorDiff does not precompile. TaylorDiff 0.3.6
takes its derivative expressions from DiffRules instead.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Muse <noreply@meta.com>
Agent-Harness: Muse CLI Code
Agent-Model: muse-wonder-full-1.0
Agent-Session: local fixer job SciML__NonlinearSolve.jl__1368 (no session URL)

This branch has not been deployed

No deployments
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