Skip to content

Fix polyalgorithm init+solve! for Simple*/NoInitCache sub-caches (#1348) - #1349

Open
ChrisRackauckas-Claude wants to merge 9 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/1348-polyalg-noinit-cache
Open

ChrisRackauckas-Claude wants to merge 9 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/1348-polyalg-noinit-cache

Conversation

@ChrisRackauckas-Claude

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

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

What changed and why

solve!(init(prob, NonlinearSolvePolyAlgorithm((SimpleNewtonRaphson(), SimpleBroyden())))) threw FieldError because the generated polyalgorithm solve! probed get_fu / .trace / .retcode on each sub-cache, while NonlinearSolveNoInitCache (used by every Simple* algorithm) deliberately has none of those fields. The fix mirrors the working one-shot __generated_polysolve path: after each CommonSolve.solve!(subcache), read u, resid, trace, and retcode from the returned NonlinearSolution. Prototype _fuType comes from a stepping sibling when present, otherwise from evaluate_f(prob, u0). The selected sub-solution's actual trace is forwarded (including nothing). _traceType is chosen statically in the @generated body from each subcache's fieldtype (widening with Nothing only when a NoInit sibling is present), so heterogeneous tuple iteration does not allocate on ordinary solves. ::ReturnCode.T asserts are kept for Julia 1.10 inference (same intent as #1347). InternalAPI.reinit! forwards onto NonlinearSolveNoInitCache so retain_best escalation can refresh those sub-caches.

This PR supersedes #1347's change. Both edit the same generated solve! retcode read; this PR asserts sol.retcode::ReturnCode.T from the sub-solution. Restoring cache.caches[idx].retcode would report a NoInit cache's initialization status instead of the actual sub-solve outcome.

Fail before / pass after

FieldError on master for Simple* init+solve!; with the fix, issue regressions pass (including winner-trace fidelity and retain_best reinit). Round-2 found a runtime _polyalg_solve_trace_type scan that made ordinary IIP solves allocate (0→352 B / 0→32 B on 1.12); that helper is gone and successful-solve allocations again match master.

Verification

# issue + inference
julia +1.12: Issue 1348 42/42; inference 16/16
julia +1.10: Issue 1348 42/42; inference 16/16
# allocation probe.jl (round2/scratch) vs master base
# successful-solve allocations: exact match on 1.10 and 1.12 (see table below)
GROUP=Core NonlinearSolveBase: tests passed
Runic --check / typos: clean

Remeasured allocations (probe.jl, 12 warmed @allocated solve!, reinit! outside)

Successful solves (must match master; now do):

Julia Case (IIP success) Master This head
1.12 default / FastShortcut / RobustMultiNewton / NR-B 0 / 0 / 0 / 0 0 / 0 / 0 / 0
1.10 default / FastShortcut / RobustMultiNewton / NR-B 624 / 704 / 896 / 160 624 / 704 / 896 / 160

OOP successful solves also match master exactly on both versions.

Failure-path deltas vs master (not claimed allocation-neutral):

Julia Case Delta (head − master)
1.10 RobustMultiNewton fail IIP/OOP +48 B
1.10 NR-B fail IIP/OOP +64 B
1.10 default / FastShortcut fail −608 / −592 B
1.12 all measured fail cases 0 to −96 B (equal or improved)

At intermediate head db2d1950, successful IIP solves on 1.12 were 352 B / 32 B over master; that regression is fixed here.

CI status note

Known master-also sublibrary failures remain (FirstOrder Core/QA, Base QA, SCC Core). Documentation currently passes on this PR (earlier curl-28 linkcheck timeout was transient).

Not verified

  • Full root GROUP=Core / PolyAlgorithms on this exact commit (issue file + inference + NonlinearSolveBase Core + probe were run).
  • GPU / Downstream / macOS.

Risk assessment

  • Risk: medium
  • Blast radius: generated CommonSolve.solve!(::NonlinearSolvePolyAlgorithmCache) and InternalAPI.reinit!(::NonlinearSolveNoInitCache).
  • Evidence: FieldError fixed; winner-trace probes pass; successful-solve allocations match master on 1.10/1.12; inference 16/16; NonlinearSolveBase Core passed.
  • Independent review: Codex round 1 (stale/wrong trace) and round 2 (allocation regression) addressed.
  • Merge: needs human review; supersedes open Polyalgorithm solve!: assert retcode type for Julia 1.10 inference #1347.

Fixes #1348

Please ignore this draft until reviewed by @ChrisRackauckas.

Initial NoInitCache solve! fix and Simple* regressions: Cursor Agent / auto (job 1348-cursor). Round-1 retain_best regression and round-2 static _traceType / allocation fix: Cursor Agent CLI 2026.10.01-14929f9 / auto (job nsi1348c-cursor, chat 80ce7063-2ec0-4b6b-9be9-1c7233e907c0). Transcript: /log-followup2.txt. A separate Devin checkout explored an earlier helper variant; the commits on this PR are from Cursor Agent.

Risk assessment (independent review, codex-cli gpt-6-astra, reviewed head 39f57db)

  • Risk: medium
  • Blast radius: cached polyalgorithm solves, winner/failure solution selection, trace forwarding and NoInitCache reinitialization. No new dependencies or dependency-license changes; no identified breaking public API change.
  • Evidence: Reviewed head 39f57db, unchanged at end. Ran JULIA_NUM_THREADS=4 julia +release --project=env1349 run1349.jl: 42/42 assertions passed, including reinit, retain_best, mixed ladders, failure selection, trace identity and warmed allocation budgets. Ran julia +release --project=env1349 inference1349.jl: solve inference 8/8, solve! inference 8/8. Ran julia +release --project=envmaster baseline.jl on default-branch dd8a550: issue reproducer throws FieldError for missing NoInitCache.fu. Julia 1.13.2, four threads, local test environments/depot. CI currently 18 pass, 79 pending, 1 skipped, no failing PR jobs.
  • Independent review: codex-cli 0.162.1 gpt-6-astra rated it medium, high confidence: reported failure reproduced on default branch and focused regression/inference checks pass on the reviewed head.
  • Merge: needs human review — medium-risk generated solver code; most CI jobs are still pending.

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

ChrisRackauckas and others added 7 commits October 2, 2026 03:05
Read u/resid/trace/retcode from sub-solutions returned by solve!,
matching __generated_polysolve, instead of probing NoInitCache fields
that deliberately do not exist. Also teach InternalAPI.reinit! to
forward onto NoInitCache so retain_best escalation works.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/ibd/NonlinearSolve.jl/jobs/1348-cursor/log.txt on amdci2.julia.csail.mit.edu
Covers the reported FieldError, reinit!, alias_u0, mixed Simple/Newton
ladders, and the all-fail residual selection path.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/ibd/NonlinearSolve.jl/jobs/1348-cursor/log.txt on amdci2.julia.csail.mit.edu
Do not coerce a NoInit winner's `nothing` trace into a sibling stepping
cache's history. Widen `_traceType` to `Union{Nothing,T}` only when a
NoInit sub-cache is present so stepping-only ladders stay inferred.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/ibd/NonlinearSolve.jl/jobs/1348-cursor/log.txt on amdci2.julia.csail.mit.edu
Cover an immediate Simple* win and a Simple* win after a stepping
failure, plus resid/u consistency on the fallback path.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/ibd/NonlinearSolve.jl/jobs/1348-cursor/log.txt on amdci2.julia.csail.mit.edu
Round-1 review probe: after a Simple* win, parameter-changing
reinit!(...; retain_best=true) must not return the unused stepping
cache's stale history.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/nsi1348c-cursor/log.txt on amdci2.julia.csail.mit.edu
Runtime iteration over the heterogeneous subcache tuple allocated on
every ordinary solve (352 B / 32 B on Julia 1.12). Build `_traceType`
from `fieldtype` of each subcache in the `@generated` body so successful
IIP solves match master's 0 B again, while preserving winner-trace
semantics and NoInit `Union{Nothing,T}` widening.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local chat 80ce7063-2ec0-4b6b-9be9-1c7233e907c0, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/nsi1348c-cursor/log-followup2.txt on amdci2.julia.csail.mit.edu
State only the measured master IIP allocation budgets and how they
are obtained; leave review history to the PR body.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local chat 80ce7063-2ec0-4b6b-9be9-1c7233e907c0, transcript at /home/crackauc/sandbox/agent-jobs/NonlinearSolve.jl/jobs/nsi1348c-cursor/log-followup3.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <[email protected]>
Agent-Harness: Devin CLI 3000.11.3 (conflict resolution), Claude Code 2.1.285 (orchestration)
Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Agent-Session: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master); Devin log /Users/chrisrackauckas/sandbox/master/fusion-fixes/SciML_NonlinearSolve.jl-1349/log.txt
@ChrisRackauckas

Copy link
Copy Markdown
Member

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

Merged the default branch into this PR (clean merge, no conflicts; head 5a5296b) so CI runs on current master.


🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (merge), 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-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 01a19816-2c24-7e51-a248-42c7efb47514, reviewed head 39f57db

  • Verdict: MERGE
  • Risk: medium-high (MH1: shared polyalgorithm success/failure result assembly and trace typing affect cached default ladders as well as explicitly selected Simple* ladders).
  • 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: Fixes cached polyalgorithm solves containing Simple*/NoInitCache methods by reading the returned solutions and forwarding reinitialization. The regression fails on the unfixed base and passes at head; the sole failing CI assertion also fails on current master.

Blast radius: CommonSolve.solve!(::NonlinearSolvePolyAlgorithmCache), fallback selection, trace forwarding, and internal reinitialization of NonlinearSolveNoInitCache. No new dependencies or exported API; solver selection and numerical iteration formulas are unchanged.

Evidence: Own Julia 1.13.2 runs: added regression file 42/42 at head, but one control passes followed by missing-fu FieldError on the merge base. Analytic square/cube-root and parameter-changing trace/reuse assertions satisfy G1/G3. CI has 96 successful, one failed and three skipped checks; root Core, PolyAlgorithms, Downstream, AD, CUDA and IntegrationTest pass. The failed SCC assertion matches current master's failure exactly. The independent edge probe passes 51/51 and existing inference checks pass 16/16.

Blocking findings

None.

Non-blocking findings

None.

What I ran

  • Git inspection (exit 0): git -C src fetch origin '+refs/pull/1349/head:refs/remotes/pr/1349' master; git -C src checkout --detach refs/remotes/pr/1349; git -C src rev-parse HEAD origin/master; git -C src merge-base origin/master HEAD; git -C src diff origin/master...HEAD; git -C src diff --check dd8a550b79c4c9ea72a7b95b9233a34ffdb5bd8e...HEAD. Head matches the target. Base above is the unfixed merge base and the baseRefOid returned by the PR API; current origin/master is fb66652.
  • All Julia invocations use Julia 1.13.2 on aarch64, JULIA_NUM_THREADS=4, OPENBLAS_NUM_THREADS=1, JULIA_NUM_PRECOMPILE_TASKS=4, JULIA_PKG_PRECOMPILE_AUTO=0, an isolated TMPDIR and the supplied shared depot followed by default depots. Temporary environments develop the root package and seven local sublibraries, with identical resolved dependencies for head and base; no checkout test environment is modified.
  • Head: timeout 3600 julia +1.13.2 --startup-file=no run_head.jl (exit 0). The script activates the temporary environment, develops local packages, instantiates without automatic precompilation and includes test/Core/issue_tests__item4.jl inside a Test testset. Tail: PR 1349 added regression file | 42 42. This includes all four warmed IIP allocation budgets.
  • Base: timeout 3600 julia +1.13.2 --startup-file=no --project=env-base run_base.jl (exit 1). The source is an archive of dd8a550, and the script includes the unchanged head regression file. Tail: 1 passed, 0 failed, 1 errored; FieldError: type NonlinearSolveBase.NonlinearSolveNoInitCache has no field fu at the cached solve in test/Core/issue_tests__item4.jl:23. Therefore the added regression fails before and passes after, from my own runs; later assertions do not execute on base.
  • Final probe: timeout 3600 julia +1.13.2 --startup-file=no --project=env probe.jl (exit 0). It tests scalar Float32/Float64 roots and parameter reuse, exact one-step Newton failure results with aliasing and start_index choices, rectangular least squares, and existing test/Core/core_tests__item3.jl inference assertions. Tails: Independent analytic edge probes | 51 51; solve() inference | 8 8; solve!() inference | 8 8. Independent failure references are the exact Newton iterate 1.5 and residual 0.25 from u0=1, p=2, then iterate 3.25 and residual 1.5625 from u0=2, p=9. All three permitted Julia runs are complete.
  • Read-only GitHub inspection: PR state/body/checks, linked issue Polyalgorithm of Simple* methods: init + solve! throws FieldError (NonlinearSolveNoInitCache has no field fu) #1348, and paginated PR commits. Author trailers come from fc2c90e, the newest non-merge commit in the PR commits API.
  • CI inspected: root CI, IntegrationTest, PR failed SCC job, and completed master Sublibrary CI. gh run view 38859115164 --repo SciML/NonlinearSolve.jl --log-failed and the corresponding master command for run 41318239202 show the same isconcretetype(eltype(scc_sol_debug.original)) failure in lib/SCCNonlinearSolve/test/core_tests__item4.jl:100, with the same non-concrete NonlinearSolution type. The initial log download hit a read-only cache directory; supplying XDG_CACHE_HOME resolved that tooling limitation. Recent completed default-branch runs were inspected independently of the author's CI claims.

What I did not verify

No full package suite, downstream suite, GPU, MPI, reverse-mode AD, alternate Julia version or alternate platform was run locally. Relevant root CUDA/Adjoint and downstream CI checks pass; no GPU/AD/MPI rule or kernel is added or modified. Initialization-failure customization and arbitrary third-party no-init solvers were inspected but not executed. The base run stops at the first cache failure, so it does not establish a before/after result for each later assertion individually. Author context contained an embedded earlier assessment; the initial risk had already been hashed before opening that context, and the dedicated prior review is deferred until the complete independent review is frozen.

🤖 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:07
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

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

PR: #1349

Reviewed head: 39f57db
Raw SHA-256: a05645e7daa1087ee301efbc63fd4a15397cfcbf3e921c89373ab9effa7190b1
Source SHA-256: 8d5d50b2f250e1ddd63af44b982beea4e8204c4cea273717092a9ce0a3cdae0d
Source: standard-review-v1 (harness-log)
Reviewer session: 01a21f20-ea98-7f81-bb93-5dfa107c904f
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=0)

Risk assessment

  • Risk: medium (M2)
  • Verdict: CHANGES
  • Reviewed head: 39f57db

Review report

VERDICT: CHANGES
Round: 5
Head: 39f57db
Slot: 1
CI: CI unreadable; review only; merge gates unchanged
Session: 01a21f20-ea98-7f81-bb93-5dfa107c904f
Reviewer: codex-cli 0.170.0; model: gpt-6.2-sol

Risk

medium (M2: the explicit transformed-bounds fallback changes a returned state from unbounded to physical coordinates, verified against the original residual)

Blocking findings

  • Blocking priorities: P1, P1, P2, P2

  • [P1] lib/NonlinearSolveBase/src/solve.jl:471 — A reused solve-only ladder evaluates obsolete parameters before it runs a stage. With f(u, p) = u - sqrt(p) and a single SimpleNewtonRaphson() stage, I initialized at (u0, p) = (1.0, -1.0) and called reinit!(cache, 2.5; p = 9.0). A fresh cache with the new inputs returned (3.0, 0.0, Success). The reused cache threw DomainError with -1.0 in _polyalg_solve_fu_prototype. A second probe with valid parameters recorded residual calls at both the old and new parameter values and returned a sol.prob.p of 2.0 for a solve at 9.0.

    Implementation fix: In generated CommonSolve.solve!, use the selected solution's residual directly for ladders containing solve-only stages. Preserve the typed fast path for ordinary stepping caches and evaluate the initial residual once in the explicit initialization-failure branch. In lib/NonlinearSolveBase/src/polyalg.jl, synchronize the parent problem metadata in InternalAPI.reinit! so sol.prob describes the current solve. Add the domain fixture to test/Core/issue_tests__item4.jl. Assert success, the exact root and residual, and sol.prob.p == 9.0 after reuse.

  • [P1] lib/NonlinearSolveBase/src/solve.jl:975 — Aliased reinitialization lets one failed stage change the next stage's starting point. For u .^ 2 .- 1, the ladder (SimpleNewtonRaphson(), SimpleBroyden()) with alias_u0 = true and maxiters = 1 should try both stages from [4.0]. The independent steps produced [2.125] and [2.0]. The fresh ladder selected ([2.0], [3.0], MaxIters). Reinitializing a cache created at [3.0] to [4.0] instead returned ([1.0625], [0.12890625], MaxIters). This is Broyden's step from Newton's failed iterate.

    Implementation fix: Coordinate the NoInit reinit adapter in solve.jl with eager and deferred reinitialization in polyalg.jl. Copy the requested start into the parent start state and bind aliased NoInit child problems to the parent's resettable work buffer. Reset that buffer from the same start before every attempt, including retained-stage escalation, and keep the final copy into the caller-visible result buffer. Add the two-stage fixture to the Core regression and assert the cached and fresh results both equal ([2.0], [3.0], MaxIters). Cover ordinary reinit and an aliased retained solve that escalates.

  • [P2] lib/NonlinearSolveBase/src/polyalg.jl:459 — A first failed stage with a NaN residual masks a finite fallback. For f(u,p) = u < 0 ? oftype(u, NaN) : u^2 + 1, u0 = 0.5, and maxiters = 1, SimpleNewton returns (-0.75, NaN, MaxIters) and SimpleBroyden returns (0.0, 1.0, MaxIters). The cached ladder returns the NaN result. The shared helper normalizes later NaNs. It uses the raw first norm as the comparison threshold.

    Implementation fix: Normalize the first norm with the same rule as later norms in findmin_resids. Keep deterministic ordering on ties and when every attempted residual is nonfinite. Exercise the fixture through both solve!(init(...)) and solve(...) because both paths use this helper. Assert the returned state is 0.0, its residual is 1.0, and the return code remains MaxIters.

  • [P2] lib/NonlinearSolveBase/src/solve.jl:490 — The generated assertions reject a stage's returned residual or trace. With store_trace = Val(true), an outer ladder with (SimpleNewtonRaphson(), NonlinearSolvePolyAlgorithm((NewtonRaphson(),))) and start_index = 2 threw TypeError: expected Nothing for the inner Newton trace. The inner cache forwards traces and has no trace field of its own. A separate scalar SimpleNewton probe with an analytic Jacobian and a residual that changes from Float64 to BigFloat returned a zero BigFloat residual standalone. The cached ladder threw TypeError: expected Float64.

    Implementation fix: In CommonSolve.solve!, specialize result construction on the returned subsolution in the selected-stage branch for NoInit and nested caches, on both success and exhaustion. Keep cache-derived type assertions only where the cache contract guarantees the types. Add Core cases that verify the nested trace is the selected solution's actual trace and that an analytic one-step root at 2.0 preserves its zero BigFloat residual.

Non-blocking findings

  • lib/NonlinearSolveBase/src/solve.jl:635 — With store_original = Val(true), an exhausted Simple ladder returned original === nothing. The one-shot ladder returned its selected child solution for the same problem. Implementation fix: Pass the chosen sol_syms[i] as original in the cached exhaustion return, as the success return and __generated_polysolve already do. Extend the capped fallback test to check that original records the expected winning algorithm, state, residual and return code.

  • test/Core/issue_tests__item4.jl:101 — The last two assertions in the retained test follow @test sol_retain_second.trace === nothing and add no independent trace coverage. Implementation fix: Remove the history snapshot and those two assertions. Keep the checks that the retained solver wins, the solution equals the analytic root, and the returned trace is exactly the original solution's nothing trace.

  • lib/NonlinearSolveBase/src/solve.jl:621 — The changed fallback also corrects the state of an explicit transformed-bounds stepping ladder. For u - 2 on [0, 1] starting at 0.25 with maxiters = 1, the merge base returned u = 8.234721044665225 and resid = -1.0002652106106527. The head returned u = 0.9997347893893473 with the same residual, now agreeing with u - 2. Implementation fix: Add a cached case to test/PolyAlgorithms/bounded_defaults_tests.jl using (NewtonRaphson(), Broyden()). Assert an unsuccessful capped solve, 0 <= sol.u <= 1, and sol.resid ≈ sol.u - 2. The solution-selection edit already satisfies this case.

What I ran

  • GROUP=All julia --startup-file=no --project=. -e 'using Pkg; Pkg.test()' exited 0 on head with Julia 1.12.4. The harness reported Running tests for group: All and Testing NonlinearSolve tests passed. The new cached Simple test reported 42/42 passes.
  • julia --version reported 1.12.4. The head and merge-base scratch environments had identical manifests and used their respective local sublibraries. Julia 1.10.12 used explicit local sublibrary paths.
  • Included the added Core file under Test.@testset. On the merge base with Julia 1.12.4, it reported 1 pass and 1 error at the first cached Simple solve, a missing NonlinearSolveNoInitCache.fu field. On head with Julia 1.10.12 it reported 42/42 passes. The same focused run on head with Julia 1.12.4 also reported 42/42 passes.
  • Ran probes.jl, reinit_domain.jl, reinit_alias.jl, and default_compare.jl in the scratch projects. The analytic Simple root probe passed on head. The default in-place and out-of-place success and one-iteration cases, plus the default bounded capped case, matched base and head exactly in state, residual and return code. The findings above give the failing probe outputs.
  • git diff --check origin/master...HEAD, Runic check, and typos on the changed Julia files exited 0. The rename-aware path check found one solver source file, one test file and one test-runner registration. None governs authority, security, deployment, publishing, registration or merges.
  • uv run --locked python --version printed Python 3.13.13 and warned that --locked has no effect outside a Python project. The checkout has no uv.lock.

What I did not verify

  • Remote CI, QA, downstream packages, and other build platforms. The rectangular in-place least-squares probe encountered a function-wrapper error whose relationship to this change was unverified.

AUTHOR_GRADE: {"task":"bugfix","score":2,"difficulty":3,"rounds":5,"author_harness":"Cursor Agent CLI 2026.10.01-14929f9","author_model":"auto","note":"The added regression discriminates for the basic cached Simple solve. Live probes found a stale-parameter crash, cross-stage alias contamination, and lost fallback results."}

Head link: 39f57db


🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol
Conversation: local session 01a21f20-ea98-7f81-bb93-5dfa107c904f (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.

Polyalgorithm of Simple* methods: init + solve! throws FieldError (NonlinearSolveNoInitCache has no field fu)

2 participants