Repository navigation
Forward ProblemTypeCtx metadata to OptimizationProblem - #5115
Merged
ChrisRackauckas merged 1 commit intoSep 12, 2026
Merged
Conversation
This was referenced Sep 12, 2026
`ODEProblem`, `DAEProblem` and `NonlinearProblem` pass the system's `ProblemTypeCtx` metadata as the problem's `problem_type`, which is how PDE discretizations get their solutions wrapped by `wrap_sol`. `OptimizationProblem` dropped it. Forward it (default `nothing`) now that SciMLBase's `OptimizationProblem` has a `problem_type` slot. Needed by the NeuralPDE parser rewrite (SciML/NeuralPDE.jl#1161). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> Agent-Harness: 2.1.269 (Claude Code) Agent-Model: claude-fable-5-1 Agent-Session: https://claude.ai/code/session_01WYPUXLxE9jVu2jXLFRd8ax Claude-Session: https://claude.ai/code/session_01WYPUXLxE9jVu2jXLFRd8ax
ChrisRackauckas-Claude
force-pushed
the
optprob-problem-type
branch
from
September 12, 2026 21:55
257f099 to
b041347
Compare
ChrisRackauckas
marked this pull request as ready for review
September 12, 2026 21:59
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 12, 2026
- Forward ProblemTypeCtx metadata to OptimizationProblem (#5115) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 13, 2026
- Add constraints_to_penalties: lower constraints to quadratic penalty costs (#5111) - Fix QA: approve the `limited`/`constraints_to_penalties` API additions (#5116) - Concretize initialization problems once at construction (#5062) - Make tovar public (#5120) - Fix SciCompDSL model macro hygiene (#5058) - Release ModelingToolkitBase 1.71.0 (#5126) - Forward ProblemTypeCtx metadata to OptimizationProblem (#5115) - Release ModelingToolkitBase 1.71.1 (#5127) Agent-Harness: Claude Code Agent-Model: claude-opus-5[1m] Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ChrisRackauckas
added a commit
that referenced
this pull request
Sep 13, 2026
The `ProblemTypeCtx` testset added in #5115 calls `SciMLBase.problem_type`, but the file never imported `SciMLBase`, so under `@safetestset` the two assertions error with `UndefVarError: SciMLBase not defined in Main`. Agent-Harness: Claude Code 2.1.269 Agent-Model: claude-fable-5-1 Agent-Session: https://claude.ai/code/session_01WYPUXLxE9jVu2jXLFRd8ax Claude-Session: https://claude.ai/code/session_01WYPUXLxE9jVu2jXLFRd8ax Co-authored-by: ChrisRackauckas-Claude <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
What changed and why
ODEProblem,DAEProblemandNonlinearProblempass the system'sProblemTypeCtxmetadata as the problem'sproblem_type, which is how PDE discretizations (MethodOfLines) get their solutions wrapped bywrap_sol.OptimizationProblemdropped it. This forwardsgetmetadata(sys, ProblemTypeCtx, nothing)into the newproblem_typeslot ofSciMLBase.OptimizationProblem, so the NeuralPDE parser rewrite (SciML/NeuralPDE.jl#1161), which lowers aPDESystemto an optimizationSystem, gets aPDENoTimeSolutionfromsolve.One line in
lib/ModelingToolkitBase/src/problems/optimizationproblem.jlplus a compat bump toSciMLBase = "3.54"; depends on SciML/SciMLBase.jl#1600 and pairs with SciML/Optimization.jl#1354.Verification
New testset at the end of
lib/ModelingToolkitBase/test/optimization/optimizationsystem.jl, run with SciMLBase#1600 dev'd on Julia 1.11.9:Without the change
SciMLBase.problem_type(prob)isnothingfor the system carryingProblemTypeCtx => "A", so the first@testfails.Not verified
The full ModelingToolkitBase test groups were not run locally; CI cannot resolve until SciMLBase 3.54 is released.
🤖 Generated with Claude Code (model: claude-fable-5-1)
https://claude.ai/code/session_01WYPUXLxE9jVu2jXLFRd8ax