Repository navigation
Reject remake(prob; p) on steady problems instead of ignoring it - #55
Merged
Merged
Conversation
The steady NonlinearProblem carried NullParameters and its residual and Jacobian ignored p, so remake(prob; p = [3.0]) solved the original problem and remake(prob; p = [k => 3.0]) left p unchanged or failed in SymbolicIndexingInterface. The problem now carries the assembled parameter values, a symbolic container resolves the keys of the pair form, and the residual and Jacobian throw the same ArgumentError as the DAE path. The DAE path already rejected both forms; the new test covers both. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Codex finding: the steady problem's p was the vector the check compares against, so editing prob.p in place changed the reference. p is now a copy, with a regression test. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remake(prob; p = ...)on a steady problem was silently ignored:_steady_problembuilt theNonlinearProblemwithNullParameters()and the residual and Jacobian never looked atp, soremake(prob; p = [3.0])solved the original problem, althoughdocs/src/extension_contract.mdsayssolverejects it. The pair formremake(prob; p = [D => 2.0])crashed withArgumentError: no applicable remake_buffer method for buffer type NullParameters. The transientDAEProblempath already rejected both forms correctly (assembled_parameter_checkinsrc/numeric_dae.jl), so only the steady path is fixed. The stack overflow and segfault Codex once reported for[k => 3.0]does not reproduce on current master.remake(prob; u0 = ...)p = [2.0](unchanged)p = [3.0]ArgumentError: parameter D was 2.0 when the operators were assembled but is 3.0 ...p = [D => 2.0](unchanged)remake_bufferonNullParameters)p = [D => 3.0]ArgumentError: parameter D was 2.0 ...The fix:
_steady_problemnow carries the assembled parameter values asp(stillNullParameterswhen there are none), and the residual and Jacobian checkpagainst them. A smallSteadyParametersstruct attached as theNonlinearFunction'ssyslets the pair form resolve to its slot inp, implementing theSymbolicIndexingInterfacemethods the remake path calls. The error message now lives in one function,check_assembled_valuesinsrc/numeric_dae.jl, shared by both paths. No reassembly is attempted. Codex found thatpshared the vector the check compares against, soprob.p[1] = 3.0silently changed the reference;pis now a copy, with a test that fails without the copy.Tests (
test/shared/frontend_tests/remake_p.jl, registered bytest/Frontend/remake_p.jl, 16 tests) cover steady and transient for an unchangedp, a numericp, a symbolic pair, and editingprob.pin place. Against master's source the steady[3.0]case did not throw and the pair form raised theNullParameterserror. Local results on Julia 1.12.1: Runic 1.13 clean; Frontend, Core, QA, Solution, DAE and Integration pass (the group runs were on the first commit; the second commit changes one line and adds the in-place test, rerun for that file and Runic); Codex approved. CI is currently billing-blocked. This should land before any release. Risk:SteadyParametersimplementsSymbolicIndexingInterfacemethods by hand; if SciMLBase's remake path starts calling another method it fails loudly rather than silently.🤖 Posted by an AI agent · harness: Claude Code 2.1.312 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c