Skip to content

fix: Count array copies for slice functions#8867

Merged
jfecher merged 2 commits intomasterfrom
jf/slice-count
Jun 11, 2025
Merged

fix: Count array copies for slice functions#8867
jfecher merged 2 commits intomasterfrom
jf/slice-count

Conversation

@jfecher
Copy link
Contributor

@jfecher jfecher commented Jun 10, 2025

Description

Problem*

Summary*

--count-array-copies wasn't counting slice copies made from slice functions like .push_back, .push_front, or .insert.

Additional Context

I've also added --count-array-copies to the force recompile flags since if there's a cached program otherwise nothing will be printed.

I'd also like to get --count-array-copies tested by CI automatically. We handle stdout output currently but don't pass this flag so I couldn't add a regression test for the slice copy code. This should be a separate PR though.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher jfecher requested a review from a team June 10, 2025 17:33
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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: e6d50b1 Previous: 6f1b46f Ratio
rollup-merge 0.004 s 0.003 s 1.33

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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: e6d50b1 Previous: 6f1b46f Ratio
test_report_noir-lang_noir_bigcurve_ 317 s 228 s 1.39
test_report_zkpassport_noir_rsa_ 1 s 0 s +∞

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@vezenovm
Copy link
Contributor

I haven't investigated deeply but I think the fuzz failure in https://github.com/noir-lang/noir/actions/runs/15566297609/job/43880648547?pr=8867 is most likely the same as #8866. We expect an overflow and for the later constrain to be triggered, but the constant does not fit in our SSA interpreter type.

@jfecher jfecher added this pull request to the merge queue Jun 11, 2025
Merged via the queue into master with commit d831393 Jun 11, 2025
117 checks passed
@jfecher jfecher deleted the jf/slice-count branch June 11, 2025 20:33
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 12, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: interpret all execution_success programs
(noir-lang/noir#8887)
fix: always error if integer literal doesn't fit its type on the fron…
(noir-lang/noir#8885)
fix: Count array copies for slice functions
(noir-lang/noir#8867)
chore(ssa): Simplify truncate when the bit size we are truncating to is
greater than the value's max bit size
(noir-lang/noir#8875)
fix(ssa): Validate field to integer cast
(noir-lang/noir#8799)
feat: SSA interpreter checks return value
(noir-lang/noir#8883)
chore: add return value to every execution_success program that produces
an output (noir-lang/noir#8882)
chore(fuzz): Run fuzzing deterministically on CI
(noir-lang/noir#8868)
fix: (SSA interpreter) check requires_acir_gen_predicate for
enable_side_effects (noir-lang/noir#8869)
feat: allow printing each SSA interpreter definition
(noir-lang/noir#8865)
fix: handle unconditional break during SSA codegen in all cases
(noir-lang/noir#8855)
fix: update external lib commit tdd.nr
(noir-lang/noir#8823)
chore: bump dependencies (noir-lang/noir#8838)
chore(fuzz): Enable SSA Interpreter fuzzing on all passes
(noir-lang/noir#8610)
chore: Prune changelog older than ~1 year (<0.32.0)
(noir-lang/noir#8856)
chore(docs): Add links to awesome-noir in sidebar
(noir-lang/noir#8854)
chore: add a regression test for #8727
(noir-lang/noir#8851)
chore(fuzz): Handle overflows in comptime fuzzing
(noir-lang/noir#8847)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 12, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: interpret all execution_success programs
(noir-lang/noir#8887)
fix: always error if integer literal doesn't fit its type on the fron…
(noir-lang/noir#8885)
fix: Count array copies for slice functions
(noir-lang/noir#8867)
chore(ssa): Simplify truncate when the bit size we are truncating to is
greater than the value's max bit size
(noir-lang/noir#8875)
fix(ssa): Validate field to integer cast
(noir-lang/noir#8799)
feat: SSA interpreter checks return value
(noir-lang/noir#8883)
chore: add return value to every execution_success program that produces
an output (noir-lang/noir#8882)
chore(fuzz): Run fuzzing deterministically on CI
(noir-lang/noir#8868)
fix: (SSA interpreter) check requires_acir_gen_predicate for
enable_side_effects (noir-lang/noir#8869)
feat: allow printing each SSA interpreter definition
(noir-lang/noir#8865)
fix: handle unconditional break during SSA codegen in all cases
(noir-lang/noir#8855)
fix: update external lib commit tdd.nr
(noir-lang/noir#8823)
chore: bump dependencies (noir-lang/noir#8838)
chore(fuzz): Enable SSA Interpreter fuzzing on all passes
(noir-lang/noir#8610)
chore: Prune changelog older than ~1 year (<0.32.0)
(noir-lang/noir#8856)
chore(docs): Add links to awesome-noir in sidebar
(noir-lang/noir#8854)
chore: add a regression test for #8727
(noir-lang/noir#8851)
chore(fuzz): Handle overflows in comptime fuzzing
(noir-lang/noir#8847)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jul 16, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: interpret all execution_success programs
(noir-lang/noir#8887)
fix: always error if integer literal doesn't fit its type on the fron…
(noir-lang/noir#8885)
fix: Count array copies for slice functions
(noir-lang/noir#8867)
chore(ssa): Simplify truncate when the bit size we are truncating to is
greater than the value's max bit size
(noir-lang/noir#8875)
fix(ssa): Validate field to integer cast
(noir-lang/noir#8799)
feat: SSA interpreter checks return value
(noir-lang/noir#8883)
chore: add return value to every execution_success program that produces
an output (noir-lang/noir#8882)
chore(fuzz): Run fuzzing deterministically on CI
(noir-lang/noir#8868)
fix: (SSA interpreter) check requires_acir_gen_predicate for
enable_side_effects (noir-lang/noir#8869)
feat: allow printing each SSA interpreter definition
(noir-lang/noir#8865)
fix: handle unconditional break during SSA codegen in all cases
(noir-lang/noir#8855)
fix: update external lib commit tdd.nr
(noir-lang/noir#8823)
chore: bump dependencies (noir-lang/noir#8838)
chore(fuzz): Enable SSA Interpreter fuzzing on all passes
(noir-lang/noir#8610)
chore: Prune changelog older than ~1 year (<0.32.0)
(noir-lang/noir#8856)
chore(docs): Add links to awesome-noir in sidebar
(noir-lang/noir#8854)
chore: add a regression test for AztecProtocol#8727
(noir-lang/noir#8851)
chore(fuzz): Handle overflows in comptime fuzzing
(noir-lang/noir#8847)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants