fix(instantiate): preserve nested array modifier element scope#324
Merged
jgoppert merged 1 commit intoJul 18, 2026
Merged
Conversation
Signed-off-by: Chuan He <hechuan@climamind.ai>
hechuan9
marked this pull request as ready for review
July 18, 2026 14:22
jgoppert
approved these changes
Jul 18, 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.
Summary
eachmodifiers during component-array expansion.Pump pumps[2](per(curve(eta=motorEta))), the two scalar instances now retainmotorEta[1]andmotorEta[2]respectively instead of both retaining the unsliced matrix.endlowering or downstream FMI compensation.Spec / MLS Alignment
eachand array-modifier distribution).rumoca-phase-instantiate, array expansion.Risk and Design Notes
index_array_expression_for_elementpath and leaves values unchanged when array projection cannot be proven.Testing
cargo test -p rumoca --test mod_propagation_test test_nested_modifier_on_array_component_selects_element_row -- --exacteachpreserves the complete shared array for both elements.0d9d172passes formatting, lint, documentation, coverage, Linux/macOS/Windows tests, all four MSL quality shards and the final MSL merge gate.Code Size Budget (required)
The net growth is the private recursive traversal needed to reach nested modification leaves plus one end-to-end regression. The first compression pass reduced the prior downstream candidate from 249 added lines across three files to 110 lines across two files by removing unrelated modifier-environment behavior and consolidating recursion around the existing conservative array-projection helper. No follow-up cleanup is planned because no parallel path or public abstraction remains.
Reviewer Checklist
fmt,clippy -D warnings,cargo test,cargo doc).#[allow(clippy::...)]added outside generated code.git commit -s); noCo-Authored-Byfor AI.