Repository navigation
Warn when filter_kwargs drops structural keywords (differential_vars, mass_matrix) - #5325
xtalax-droid wants to merge 9 commits into
Conversation
differential_vars and mass_matrix passed to a problem constructor were silently discarded; the system derives them, so say so and point to remake. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
process_SciMLProblem forwarded user kwargs to InitializationProblem, whose filter_kwargs warned a second time; strip the structural keywords before forwarding. Agent-Harness: Claude Code 2.1.310 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a19695-91ce-74b1-b609-df64b83e998a, reviewed head 43e6636
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: Adds warnings for ignored structural keywords and suppresses duplicate warnings during initialization. The mass_matrix warning recommends a problem-level remake that does not update the effective mass matrix. Blast radius: Symbolic problem constructors using filter_kwargs, including DAEProblem, ODEProblem, and their initialization problems; no mtkcompile or System-construction algorithm changes. Evidence: Head: all 35 assertions in array_equation_dae.jl pass, including both new warning tests (exit 0). Merge-base: 33 pass and 1 fails because the first new test captures no warning (exit 1); the second new test is not reached. Exact-head CI reports no checks; inspected older-head failures are not credited as current-head evidence. Adversarial probe: 13 passed, 1 failed, confirming that the recommended mass_matrix remake leaves the effective matrix unchanged; a function-level remake passes an analytic exponential check. The sealed provisional L6 assessment is conservatively finalized as M4 because adding a warning changes observable behavior without a documented diagnostic contract. Blocking findings
Non-blocking findingsNone. What I ran
What I did not verifyThe second added warning-uniqueness test passes on head but was not reached on base after the first added test failed. The probe checks the ineffective remake through its effective matrix; it does not solve the problem carrying mass_matrix in its problem kwargs. The failing-before run uses the merge-base; the Base header identifies fetched master. No full package, downstream, GPU, AD, tracing, MPI, other-version, or other-platform runs were performed; this diff changes none of those specialized execution paths. Exact-head CI has no reported checks. Older CI failures and the author's historical components-test claim were not reproduced on current master, and are not accepted as baseline evidence. 🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5 |
Resolves the conflict in array_equation_dae.jl by keeping both the structural-keyword tests from this branch and the mixed array initial parameters test from master. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
remake(prob; mass_matrix = M) only stores a problem keyword and leaves prob.f.mass_matrix untouched, so the warning now recommends remake(prob; f = remake(prob.f; mass_matrix = M)) for mass_matrix and remake(prob; differential_vars = mask) for differential_vars. The regression applies both remedies and checks the effective result. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
|
Pushed
🤖 Posted by an AI agent · harness: Claude Code 2.1.312 · model: claude-sonnet-5-5 |
Resolved lib/ModelingToolkitBase/test/array_equation_dae.jl by keeping both testsets. Agent-Harness: Claude Code 2.1.325 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
|
Pushed 🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5 |
Keep both the dropped-structural-keyword testsets and the array derivative code size testset from SciML#5353. Agent-Harness: Claude Code 2.1.325 Agent-Model: claude-sonnet-5-5 Agent-Session: de59b94f-0227-49ea-adb5-b158639dad0b Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
|
Pushed 🤖 Posted by an AI agent · harness: Claude Code 2.1.325 · model: claude-sonnet-5-5 |
PR: #5325 Reviewed head: 9cce0fb Risk assessment
Review reportVERDICT: CHANGES Risklow (L6: diagnoses previously silent keyword drops, with failing-before tests and the same derived structure in the tested ODE and DAE paths) Blocking findings
Non-blocking findings
What I ran
What I did not verifyThe full suite, other Julia versions and constructor families, and GitHub CI results. The blind review excluded earlier review text. AUTHOR_GRADE: {"task":"bugfix","score":3,"difficulty":2,"rounds":3,"author_harness":"Claude Code 2.1.325","author_model":"claude-sonnet-5-5","note":"The warning regression tests discriminate and the intended ODE and DAE remedies work. The shared diagnostic also recommends invalid remakes for unsupported constructor and keyword pairs."} Head link: 9cce0fb 🤖 Posted by an AI agent — harness: codex-cli 0.170.0 · model: gpt-6.2-sol |
filter_kwargssilently discards every keyword outsideSciMLBase.allowedkeywords. A user who passesdifferential_varstoDAEProblem(ormass_matrixtoODEProblem) sees it vanish with no diagnostic, while ModelingToolkit derives both from the system's structure and ignores the user's value.filter_kwargsnow emits one@warnper call naming the dropped structural keywords. The warning says the system derives them and that they should be applied withremake(prob; ...)on the returned problem. The keywords are still dropped, so the returned problem is unchanged. The warning is limited to an explicit list,STRUCTURAL_KWARGS = (:differential_vars, :mass_matrix), so internal paths and other dropped keys stay silent.process_SciMLProblemstrips those keywords before forwarding the user's keywords toInitializationProblem, so default initialization (build_initializeprob = true) does not warn a second time.Context: this is the "structural keywords are silently deleted" item from the FiniteElementMethod.jl upstream-blocker list; that package applies its differential mask with
remakebecause the constructor discards the keyword.Tests: new testset in
lib/ModelingToolkitBase/test/array_equation_dae.jlchecks that the warning fires, that the problem'sdifferential_varsequals the one built without the keyword, and that default initialization produces exactly one warning. Initialization group passes with no "Ignoring keyword" lines in the log. InterfaceI (run on the first commit) has one failure,components.jl:446"Causal connections generate causal equations", which also fails on master; the follow-up commit only touches the initialization forwarding and InterfaceI was not re-run on it.Codex review (two rounds) approved. A user who passes these keywords in a script that previously ran silently will now see a warning, which could matter under
@test_logsor warnings-as-errors.🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-sonnet-5-5
Review: unreviewed
Session: de59b94f-0227-49ea-adb5-b158639dad0b