Repository navigation
Let assignment rules determine their initial values - #240
Merged
ChrisRackauckas merged 1 commit intoSep 5, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
Remove fixed initial conditions for assignment-rule targets so changing an input's initial value does not leave a contradictory constraint. Exercise the solve return code and the resulting assignment value. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: OpenAI Codex <[email protected]> Agent-Harness: Codex CLI 0.153.4 Agent-Model: gpt-6-astra Agent-Session: local transcript /home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-08-31-01a070d3-9e50-71c2-98f5-129385e50fb7.jsonl
ChrisRackauckas
marked this pull request as ready for review
September 5, 2026 11:54
This was referenced Sep 5, 2026
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
Do not impose an initial condition on an SBML assignment-rule target. The importer currently evaluates the rule using the original defaults and stores that result as a fixed initial condition. Changing an input's initial value then leaves a contradictory constraint and produces
InitialFailure. Remove the target's default, including its original literal value, and let the assignment equation determine it.This follows the SBML assignment-rule semantics: the rule applies at all times and overrides the target's defining value attribute. Reference: https://sbml.org/software/libsbml/5.18.0/docs/formatted/java-api/org/sbml/libsbml/AssignmentRule.html . No new public API or dependencies.
Verification
Julia 1.11.9, ModelingToolkit 11.41.0, ModelingToolkitBase 1.68.2. The focused model has
lambda = 2*s1, an original species initial value of 1, and a literal lambda value of 999 which the assignment rule overrides. Constructing the problem withs1 => 3must initialize lambda to 6 and solve successfully.Identical standalone test before/after, using the same dependency environment and changing only SBMLToolkit source:
Before on clean main 3222444:
After:
GROUP=QA julia --project=SBML-assignment-main-env -e 'using Pkg; Pkg.test("SBMLToolkit")'passedQA/qa.jl | 28/28(15m26.1s), exit 0.Native Core commands:
The clean production checkout with the identical new official regression fails, exit 1:
With the fix, the complete native Core group passes, exit 0:
An independent historical reproduction also fails both assertions on the clean pre-MTK11-migration importer (2f65b7a, Catalyst 15.0.11, ModelingToolkit 9.84.0). The failure therefore predates that migration. The exact runtime-introducing commit was not established; source history alone is not claimed as a bisect.
Runic, diff spelling, and
git diff --checkpassed. No assertions were loosened and no tests or initialization checks were disabled.Not verified
Full downstream EasyModelAnalysis documentation and GPU paths were not verified. This source-only bug fix adds no docstrings or public API, so documentation was not built. Parameter overrides in models with constant SBML parameters require the separate fix at #239 ; this regression changes a species initial value and reproduces independently of that PR.
Please ignore this draft until reviewed by @ChrisRackauckas.
🤖 Generated with Codex CLI 0.153.4 (model: gpt-6-astra; session: local transcript
/home/crackauc/.codex/sessions/2026/09/05/rollout-2026-09-05T05-08-31-01a070d3-9e50-71c2-98f5-129385e50fb7.jsonl).