fix(interpreter): Return fresh nested array on array get in ACIR#9831
Merged
vezenovm merged 2 commits intomv/do-not-clone-index-call-argsfrom Sep 15, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 67a534c | Previous: b74c482 | Ratio |
|---|---|---|---|
test_report_noir-lang_noir_bigcurve_ |
424 s |
328 s |
1.29 |
test_report_zkpassport_noir-ecdsa_ |
3 s |
1 s |
3 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
jfecher
reviewed
Sep 11, 2025
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: d2525c2 | Previous: 2a5315c | Ratio |
|---|---|---|---|
rollup-root |
0.005 s |
0.004 s |
1.25 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
jfecher
approved these changes
Sep 15, 2025
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.
Description
Problem*
Resolves #9830
This will unblock adding the tests in #9789.
Summary*
When fetching arrays in ACIR we treat them as entirely fresh objects. However, in the interpreter we implement arrays use shared mutable references. Thus, when we returned a nested array and then marked it mutable in the array set optimization we were in fact mutating the parent array we fetched from as well. This breaks the semantics of arrays in ACIR.
Looking at the SSA after the array set optimization:
We expect
v8to be its own fresh array. I changed the interpreter to check if we are returned an array from an array get and if we are to clone its elements and construct a new shared mutable reference to its elements.Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.