fix(acir): Handle inserting into an empty vector at index 0 in ACIR#11703
Merged
fix(acir): Handle inserting into an empty vector at index 0 in ACIR#11703
Conversation
Contributor
Changes to circuit sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
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: 5d64d78 | Previous: bb4cd6c | Ratio |
|---|---|---|---|
private-kernel-tail |
0.011 s |
0.009 s |
1.22 |
rollup-checkpoint-merge |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
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 https://cantina.xyz/code/50033e8c-8b46-41bc-b019-62098708057b/findings?s=-status%253Aspam%252Cwithdrawn%252Cfixed&finding=2
Summary
Changes to
convert_vector_insertin ACIR gen to not return early when a vector we are inserting into has a known 0 length, but rather just avoid reading from it during insertion.Additional Context
The early return was added in #10882 , however it only covered ACIR: Brillig, comptime and the SSA interpreter all allowed insertion at index 0, returning a single element vector.
The reason this discrepancy wasn't caught by the integration test was that it contained another assertion on input values that always failed (
assert_eq(x, y);), and, as @asterite noted in #11685 theexecution_failuretests do not check why the execution fails at the moment, so it was a false negative.User Documentation
Check one:
PR Checklist
cargo fmton default settings.