Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The NLA validation can falsely classify a globally square system as underconstrained.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes analyser and generator handling of variables initialised from other variables.
Changes:
- Corrects unit scaling and computed-constant initialisation ordering.
- Detects cyclic or invalid initialisation dependencies.
- Adds diagnostics, bindings, generated fixtures, and regression tests.
| File | Description |
|---|---|
src/analyser.cpp |
Adds dependency-cycle and NLA validation. |
src/analyser_p.h |
Declares dependency helpers. |
src/generator.cpp |
Fixes scaling and generation ordering. |
src/generator_p.h |
Updates generator helper interfaces. |
src/issue.cpp |
Registers the new diagnostic rule. |
src/api/libcellml/issue.h |
Adds the public reference rule. |
src/bindings/python/__init__.py |
Exposes the Python enum value. |
src/bindings/javascript/issue.cpp |
Exposes the JavaScript enum value. |
tests/analyser/analyser.cpp |
Tests new analyser diagnostics. |
tests/bindings/python/test_issue.py |
Tests the Python binding. |
tests/generator/generator.cpp |
Tests computed-constant initialisation. |
tests/generator/generatorvariabletracker.cpp |
Tests untracked-variable generation. |
tests/resources/analyser/nla_systems_sharing_initialised_variable.cellml |
Covers shared NLA unknowns. |
tests/resources/analyser/variable_initialised_using_itself.cellml |
Covers cyclic initialisation. |
tests/resources/analyser/variable_initialised_using_nla_based_algebraic_variable.cellml |
Covers invalid algebraic initialisation. |
tests/resources/generator/cellml_unit_scaling_constant/model.c |
Updates expected C scaling. |
tests/resources/generator/cellml_unit_scaling_constant/model.py |
Updates expected Python scaling. |
tests/resources/generator/constant_initialised_using_computed_constant/model.cellml |
Defines ordering regression model. |
tests/resources/generator/constant_initialised_using_computed_constant/model.c |
Provides expected C output. |
tests/resources/generator/constant_initialised_using_computed_constant/model.h |
Provides expected C interface. |
tests/resources/generator/constant_initialised_using_computed_constant/model.py |
Provides expected Python output. |
tests/resources/generator/variable_initialised_using_untracked_variable/model.cellml |
Defines untracked-variable model. |
tests/resources/generator/variable_initialised_using_untracked_variable/model.c |
Provides expected C output. |
tests/resources/generator/variable_initialised_using_untracked_variable/model.h |
Provides expected C interface. |
tests/resources/generator/variable_initialised_using_untracked_variable/model.py |
Provides expected Python output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…by another variable.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
NLA-system grouping and overconstraint detection remain incorrect, and case 3 is rejected instead of implementing the linked issue’s expected behavior.
Review effort: Balanced
Findings: 3
Open (3)
Resolved since last review (1)
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.


Fixes #1487.