Repository navigation
Pick a GPU-compatible default AD when u0 lacks fast scalar indexing - #1368
ChrisRackauckas-Claude wants to merge 7 commits into
Conversation
`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
Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): CHANGES, risk medium. Full reviewVERDICT: CHANGES 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
Non-blocking findings
What I ranAll on Julia 1.12.7 in scratch environments that
What I did not verify
🤖 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 |
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)
Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a1973b-c23f-7ee0-8f63-7b06167b1bbf, reviewed head 76eb05c
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 findingsNone. Non-blocking findings
What I ran
What I did not verifyReal 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 |
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)
What changed and why
Solving a
JLArray-backedNonlinearProblemunderJLArrays.allowscalar(false)failsbecause 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)isfalse,candidate backends are now filtered to finite-differencing ones
(
AutoFiniteDiff/AutoFiniteDifferences); if none is loaded, theArgumentErrornamesthe fix.
NonlinearSolveBaseForwardDiffExt'sadditional_incompatible_backend_checkapplies 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_autodiffresolves toAutoFiniteDiff()for non-scalar-indexable state, anymatrix-free path (
NewtonRaphson(linsolve = KrylovJL_GMRES()), orTrustRegionwithradius_update_scheme = Yuan/Bastin, which eagerly computeJ'fuvia a VJP operator)would crash during
JacobianOperator's eagerprepare_vjp, becauseDifferentiationInterface's genericPullbackSlowfallback builds Jacobian columns viabasis(x, j), which does a scalarsetindex!.I ran all four configurations the reviewer named, on
JLArrayunderallowscalar(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.:
Root cause of the discrepancy with the reviewer's static analysis:
DifferentiationInterfaceships
ext/DifferentiationInterfaceGPUArraysCoreExt, which overridesDI.basis(a::AbstractGPUArray, i)to wrap the single-element seed write inGPUArraysCore.@allowscalar:This extension auto-loads whenever
GPUArraysCoreis in the session (it is, transitivelyvia
JLArrays/GPUArrays), so thePullbackSlowper-column pushforward-based pullbackis 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 forthis 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 exactversions the downgrade-sublibraries job installed, read from its log) while keeping
NonlinearSolveBase/NonlinearSolveFirstOrder/SciMLJacobianOperatorson local devpaths (this PR's actual code) reproduces the CI failure byte-for-byte:
Root cause:
TrustRegion's default descent (MoreTrustRegionDescent) solves itssubproblem through an augmented, non-square
[J; √λ·D]system (4×2 here) viaLinearSolve.DefaultLinearSolver. AtLinearSolve5.6.0–5.13.0, the default-algorithminfrastructure (
_init_default_cacheval, a@generatedfunction) eagerly builds thecache for every algorithm in
DefaultAlgorithmChoice, includingCholeskyFactorization,before any algorithm is actually chosen — and that eager build calls
cholesky!(A)unconditionally, which requires a square matrix. For ordinary
Array/Matrix, aspecialized dispatch path avoids ever touching this generic fallback for non-square input;
for
JLArrayin this oldLinearSolverange, it does not. Not aJLArraysversionissue: I bisected by varying only
LinearSolvewhile holding every other package(including
JLArrays) at the downgrade floor — bumpingJLArraysalone to the newest0.3.x (0.3.3) did not fix it;
LinearSolve5.10.0–5.13.0 still fail,LinearSolve5.14.0 and above (tested up to current 5.18.2) pass.
Fix: raise
NonlinearSolveFirstOrder'sLinearSolvecompat 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 (
LinearSolvepinned to5.14.0, everything else unchanged at itsdowngrade floor) and the full, now-expanded
misc_tests__item11.jl(14 assertions) passescleanly.
I did not bump
NonlinearSolveBase's own (lower,"5.4")LinearSolvefloor:MoreTrustRegionDescent/construct_linear_solverlive there, so the same crash could inprinciple occur there too, but
NonlinearSolveBasehas noJLArraytest to exercise itand 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)
solveon aVectorNonlinearProblemwithNewtonRaphson()/TrustRegion()— outputcaptured on
masterand on this branch, byte-identical:Failing-before / passing-after (round 1, re-confirmed)
Before (src reverted to
master, keeping only the test file):ERROR: LoadError: Scalar indexing is disallowedfromForwardDiff.seed!on theJLArray. After (fix applied): passes.Test-group tails (Julia 1.10.12, this branch, round 2)
GROUP=Core(full suite, ~9000 assertions across allalgorithms, now including the 14-assertion
JLArraytest): all pass, e.g.Error/Fail/Some tests did not passanywhere in the run.GROUP=Core: all pass, noError/Failentries (e.g.Bounds transform (#955) 138/138,construct_extension_jac scalar and matrix u0 10/10,Dense LU refactorization allocations 14/14).GROUP=QA:GROUP=QA: still blocked locally by the pre-existing, unrelatedSciMLJacobianOperatorsregistry-lag issue noted in round 1 (confirmed reproduces withthis PR's diff reverted).
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 unwrapsAutoSparse). Fixing it would touch the same selection logic again for a case the useropted into explicitly; flagging it as a follow-up rather than widening this PR.
What I did not verify
JLArrays.JLArray(CPU-backed, GPU-arraysemantics).
NonlinearSolveBaseGROUP=QAlocally (pre-existing registry-lag gap, round 1).NonlinearSolveBase's own lowerLinearSolvefloor (5.4) hits the sameMoreTrustRegionDescent/JLArraycrash — plausible by the same root cause, butuntested since no local test exercises it.
All/Everythinggroups.Anything a reviewer should push back on
LinearSolvefloor bump ("5.6"→"5.14") is a compat-only change verified bybisection on this machine, not by reading
LinearSolve's own changelog/PR history forthe actual fixing commit — if a maintainer knows the exact PR, a tighter/more precisely
justified floor might be possible.
NonlinearSolveBase'sLinearSolvefloor should also move, per the note above.Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
NonlinearSolveBase's default AD/Jacobian selection andNonlinearSolveFirstOrder'sLinearSolvecompat floor. No public API signaturechanges; behavior changes only when
ArrayInterface.fast_scalar_indexing(u0) == false(GPU-style arrays) or when installed with a very old (pre-5.14)
LinearSolve;Vectoroutput confirmed byte-identical.
GROUP=Corepass for bothpackages; byte-identical Vector-output comparison; the downgrade-CI failure faithfully
reproduced locally and confirmed fixed by the
LinearSolvefloor bump alone (bisectedagainst
JLArraysseparately to rule it out as the cause).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, onba7a6fd2; its findings still applied at986d8585).Design change. The scalar-indexing restriction now applies only where a Jacobian is materialized.
select_forward_mode_autodiffis back to itsmasterbehavior.select_jacobian_autodiff(prob, nothing)still considers only finite differencing for au0without fast scalar indexing.select_reverse_mode_autodiff(prob, nothing)considers Zygote and finite differencing.construct_jacobian_cachereplaces an explicitAutoForwardDiff/AutoPolyesterForwardDiffwithselect_jacobian_autodiff(prob, nothing), with a warning naming the cause, but only when it builds a concrete Jacobian.NonlinearSolveBaseForwardDiffExtis back tomaster.Codex review:
AutoPolyesterForwardDiffguard unreachable: fixed. The check had been added to the extension'sUnion{AutoForwardDiff, AutoPolyesterForwardDiff}method, which the more specificAutoPolyesterForwardDiffmethod insrc/autodiff.jlshadows. The fallback now lives inconstruct_jacobian_cacheand dispatches on both types, so nothing shadows it. On the PR-head source, the reviewer's reproducer (with PolyesterForwardDiff loaded) fails withScalar indexing is disallowed. With this fix it prints a warning that it is usingAutoFiniteDiff()to build the Jacobian, thenretcode=Success u=[2.0000000000000027, 2.0]. A regression test was added for both backends; see the evidence below.Devin review:
jvp_autodiff = AutoForwardDiff()was overridden: fixed. Forward-mode selection is no longer filtered.GeneralizedFirstOrderAlgorithm's__inittakes its default JVP fromselect_forward_mode_autodiff(prob, nothing)when noautodiffis 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 assertsol.alg.jvp_autodiff isa AutoForwardDiffforNewtonRaphson(linsolve = KrylovJL_GMRES()). They also assert, with@test_logs min_level = Logging.Warn, that no warning appears for an explicitjvp_autodiff = AutoForwardDiff()orautodiff = AutoForwardDiff()with GMRES.TrustRegionwith Yuan, or with Bastin plus GMRES, selectsAutoZygoteand converges.lib/NonlinearSolveBase/test/nonscalar_autodiff.jluses a minimalAbstractVectorwithfast_scalar_indexing == false. It checks that forward selection keeps ForwardDiff, both by default and when requested explicitly. It also checks that the Jacobian and pullbackArgumentErrors carry the hint; that environment has neither FiniteDiff nor Zygote, and the test asserts this.986d8585.AutoSparsenote was moot: agreed.AutoSparseautodiff is rejected for nonlinear problems onmastertoo, so the earlier "Non-blocking review items" note does not apply.TrackedArraystates: no change. Trackedu0is intercepted by thesolve_upoverloads before backend selection, and this was not exercised. I did check thatRecursiveArrayTools.ArrayPartitionreportsfast_scalar_indexing == true, so it is unaffected.[sources]in this repo, and the repo does not bump versions per PR.master, as the reviewer confirmed. No change.Verification (round 3, commit
76eb05c9, Julia 1.13.0)misc_tests__item11.jl, run from a@testsetwith all four source files reverted to986d8585and the new tests kept:Pass 20, Fail 6, Error 4. The failures:ADTypes.AutoFiniteDiff() isa AutoForwardDifffails for the JVP checks.@test_logsfails on the explicit-ForwardDiff GMRES solves.Scalar indexing is disallowedfor the explicitAutoForwardDiffJacobian.MethodError ... _prepare_pushforward_auxfor the explicitAutoPolyesterForwardDiffJacobian.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 7after.NonlinearSolveBase
GROUP=Corepassed, includingAD selection for states without fast scalar indexing | 7 7.GROUP=QAgaveQA | 20 20.NonlinearSolveFirstOrder
GROUP=Corepassed, withNative bounded methods | 5989 5989,NewtonRaphson | 309 309,TrustRegion | 1176 1176andJLArray default AD without scalar indexing | 32 32.GROUP=QAgaveQA | 20 20.Runic (Runic.jl 1.10
--check) reports no changes, andtyposis 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.AutoPolyesterForwardDiffand it works.AutoFiniteDiff.Not verified (round 3)
JLArrayswas used.prelocally. CI covers them.SimpleNonlinearSolve,NonlinearSolveQuasiNewtonand the wrappers on a JLArray. Their default Jacobian selection is the same as at986d8585. An explicit ForwardDiff Jacobian inSimpleNonlinearSolve, which does not go throughconstruct_jacobian_cache, still hits scalar indexing, as it does onmaster.!ForwardDiff.can_dual(eltype(u0))check is also shadowed forAutoPolyesterForwardDiffonmaster. 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)
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-fix986d8585produces 20 passes, 6 failures, 4 errors. The original default Newton/JLArray reproducer on masterdd8a550berrors 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.🤖 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
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 asjlarray_autodiff_tests.jl, alongside the upstream forcing test.Failing before / passing after
On archived original head
76eb05c9, with local sublibraries developed,BASELINE_PROJECTidentifies that archived package environment:Exit 1, reproducing the CI inference error:
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].All four commands exited 0. Relevant output and final lines:
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 --checkAn 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)
Fix by Muse CLI Code muse-wonder-full-1.0 (head c679ccb)
rack ci compareclassed 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: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
tanhscalar rule toabs(real(x)) < 1 ? 1 - Ω ^ 2 : sech(x) ^ 2. TaylorDiff 0.3.5 evaluates ChainRules forward rules on aSymbolics.Numwhile 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 from0.3.1to0.3.6and bump the sublibrary patch version from0.1.13to0.1.14for the compat change.Failing before / passing after
A scratch environment pinning ChainRules 1.74.12, varying only TaylorDiff:
Validation
All Julia runs used Julia 1.13.2 with
JULIA_NUM_THREADS=4:Observed output:
Runic exited 0 with no diff and
typosproduced no output. One earlier local Core rerun errored on a missing precompiledRmath_jllshared 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 byrack 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)