Skip to content

chore(ssa): Restore the use of unchecked index operations#10110

Merged
vezenovm merged 5 commits intomasterfrom
af/9930-unchecked-index
Oct 13, 2025
Merged

chore(ssa): Restore the use of unchecked index operations#10110
vezenovm merged 5 commits intomasterfrom
af/9930-unchecked-index

Conversation

@aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Oct 7, 2025

Description

Problem*

Follow up for #10097
Resolves #9927

Summary*

Now that the SSA interpreter does not wrap around on overflows, we can use unchecked operations for index arithmetic to make ACIR bytecode more optimal.

Additional Context

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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Changes to circuit sizes

Generated at commit: 2487103138fcc68ceb635e68faee1a36725f0cf4, compared to commit: d09585f1a9b1370c3be58ffb3477eb0fa4349fd7

🧾 Summary (10% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
nested_array_dynamic -239 ✅ -7.38% -421 ✅ -3.46%
hashmap -2,464 ✅ -7.74% -3,453 ✅ -3.68%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
array_dynamic_nested_blackbox_input 119 (-16) -11.85% 17,416 (0) 0.00%
lambda_from_global_array 28 (-2) -6.67% 2,835 (-3) -0.11%
regression_7612 15 (-4) -21.05% 2,818 (-5) -0.18%
lambda_from_array 1,833 (-8) -0.43% 4,079 (-11) -0.27%
regression_struct_array_conditional 70 (-15) -17.65% 3,238 (-19) -0.58%
nested_array_in_slice 817 (-44) -5.11% 4,931 (-58) -1.16%
nested_array_dynamic 2,998 (-239) -7.38% 11,730 (-421) -3.46%
hashmap 29,385 (-2,464) -7.74% 90,372 (-3,453) -3.68%

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: 1d7d780 Previous: 84d900d Ratio
test_report_zkpassport_noir-ecdsa_ 3 s 2 s 1.50

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 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: c13d07f Previous: 84d900d Ratio
sha512-100-bytes 2.096 s 1.66 s 1.26

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

CC: @TomAFrench

@vezenovm vezenovm added the bench-show Display benchmark results on PR label Oct 7, 2025
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.

ACVM Benchmarks

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
purely_sequential_opcodes 262608 ns/iter (± 358) 252216 ns/iter (± 658) 1.04
perfectly_parallel_opcodes 229243 ns/iter (± 2740) 223184 ns/iter (± 3879) 1.03
perfectly_parallel_batch_inversion_opcodes 2786444 ns/iter (± 4996) 2257063 ns/iter (± 8139) 1.23

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

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.

Test Suite Duration

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
test_report_AztecProtocol_aztec-packages_noir-projects_aztec-nr 123 s 119 s 1.03
test_report_AztecProtocol_aztec-packages_noir-projects_noir-contracts 134 s 132 s 1.02
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob 389 s 343 s 1.13
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_private-kernel-lib 217 s 211 s 1.03
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_reset-kernel-lib 35 s 35 s 1
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types 156 s 157 s 0.99
test_report_noir-lang_noir-bignum_ 156 s 162 s 0.96
test_report_noir-lang_noir_bigcurve_ 336 s 329 s 1.02
test_report_noir-lang_sha256_ 15 s 16 s 0.94
test_report_noir-lang_sha512_ 13 s 13 s 1
test_report_zkpassport_noir-ecdsa_ 2 s 3 s 0.67
test_report_zkpassport_noir_rsa_ 1 s 1 s 1

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

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.

Compilation Time

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 1.684 s 1.73 s 0.97
private-kernel-reset 7.59 s 7.88 s 0.96
private-kernel-tail 1.346 s 1.448 s 0.93
rollup-block-root-first-empty-tx 1.422 s 1.398 s 1.02
rollup-block-root-single-tx 1.42 s 1.4 s 1.01
rollup-block-root 1.47 s 1.51 s 0.97
rollup-checkpoint-merge 1.424 s 1.434 s 0.99
rollup-checkpoint-root-single-block 206 s 210 s 0.98
rollup-checkpoint-root 220 s 222 s 0.99
rollup-root 1.578 s 1.556 s 1.01
rollup-tx-base-private 19.1 s 18.7 s 1.02
rollup-tx-base-public 128 s 130 s 0.98
rollup-tx-merge 1.396 s 1.418 s 0.98
semaphore-depth-10 0.882 s 0.778 s 1.13
sha512-100-bytes 1.571 s 1.536 s 1.02

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

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.

Execution Time

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 0.012 s 0.012 s 1
private-kernel-reset 0.149 s 0.157 s 0.95
private-kernel-tail 0.009 s 0.01 s 0.90
rollup-block-root-first-empty-tx 0.003 s 0.003 s 1
rollup-block-root-single-tx 0.003 s 0.003 s 1
rollup-block-root 0.004 s 0.004 s 1
rollup-checkpoint-merge 0.003 s 0.003 s 1
rollup-checkpoint-root-single-block 12.2 s 12.7 s 0.96
rollup-checkpoint-root 12.7 s 12.5 s 1.02
rollup-root 0.004 s 0.004 s 1
rollup-tx-base-private 0.307 s 0.305 s 1.01
rollup-tx-base-public 0.241 s 0.236 s 1.02
rollup-tx-merge 0.002 s 0.002 s 1
semaphore-depth-10 0.009 s 0.009 s 1
sha512-100-bytes 0.066 s 0.089 s 0.74

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

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.

Opcode count

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 14732 opcodes 15876 opcodes 0.93
private-kernel-reset 70303 opcodes 78291 opcodes 0.90
private-kernel-tail 11665 opcodes 12195 opcodes 0.96
rollup-block-root-first-empty-tx 1365 opcodes 1365 opcodes 1
rollup-block-root-single-tx 1049 opcodes 1049 opcodes 1
rollup-block-root 2410 opcodes 2410 opcodes 1
rollup-checkpoint-merge 2130 opcodes 2330 opcodes 0.91
rollup-checkpoint-root-single-block 962022 opcodes 962022 opcodes 1
rollup-checkpoint-root 963382 opcodes 963382 opcodes 1
rollup-root 2630 opcodes 2830 opcodes 0.93
rollup-tx-base-private 263910 opcodes 263910 opcodes 1
rollup-tx-base-public 245139 opcodes 245349 opcodes 1.00
rollup-tx-merge 1486 opcodes 1486 opcodes 1
semaphore-depth-10 5700 opcodes 5700 opcodes 1
sha512-100-bytes 13173 opcodes 13173 opcodes 1

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

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.

Artifact Size

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 721.6 KB 736.2 KB 0.98
private-kernel-reset 1983.6 KB 2111.5 KB 0.94
private-kernel-tail 539.1 KB 549.6 KB 0.98
rollup-block-root-first-empty-tx 179.9 KB 179.9 KB 1
rollup-block-root-single-tx 178.2 KB 178.2 KB 1
rollup-block-root 258.2 KB 258.2 KB 1
rollup-checkpoint-merge 370.8 KB 373.8 KB 0.99
rollup-checkpoint-root-single-block 27645.4 KB 27645.4 KB 1
rollup-checkpoint-root 27690.6 KB 27690.6 KB 1
rollup-root 411.6 KB 414.3 KB 0.99
rollup-tx-base-private 4920.2 KB 4920.2 KB 1
rollup-tx-base-public 4570.5 KB 4571.5 KB 1.00
rollup-tx-merge 186.2 KB 186.2 KB 1
semaphore-depth-10 570.7 KB 570.7 KB 1
sha512-100-bytes 506.3 KB 506.3 KB 1

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

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.

Execution Memory

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 255.45 MB 255.57 MB 1.00
private-kernel-reset 292.22 MB 293.11 MB 1.00
private-kernel-tail 243.93 MB 244 MB 1.00
rollup-block-root 338.92 MB 338.92 MB 1
rollup-checkpoint-merge 337.72 MB 337.79 MB 1.00
rollup-checkpoint-root-single-block 1020 MB 1020 MB 1
rollup-checkpoint-root 1020 MB 1020 MB 1
rollup-root 338.92 MB 338.99 MB 1.00
rollup-tx-base-private 452.47 MB 452.47 MB 1
rollup-tx-base-public 467.34 MB 467.36 MB 1.00
rollup-tx-merge 337.18 MB 337.18 MB 1
semaphore_depth_10 73.69 MB 73.69 MB 1
sha512_100_bytes 71.96 MB 71.96 MB 1

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

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.

Compilation Memory

Details
Benchmark suite Current: 869e546 Previous: d09585f Ratio
private-kernel-inner 266.46 MB 266.47 MB 1.00
private-kernel-reset 497.26 MB 498.21 MB 1.00
private-kernel-tail 248.35 MB 248.46 MB 1.00
rollup-block-root-first-empty-tx 341.01 MB 341.01 MB 1
rollup-block-root-single-tx 338.46 MB 338.47 MB 1.00
rollup-block-root 341.44 MB 341.44 MB 1
rollup-checkpoint-merge 340.77 MB 340.78 MB 1.00
rollup-checkpoint-root-single-block 6820 MB 6820 MB 1
rollup-checkpoint-root 6820 MB 6820 MB 1
rollup-root 345.07 MB 345.05 MB 1.00
rollup-tx-base-private 1050 MB 1050 MB 1
rollup-tx-base-public 2890 MB 2890 MB 1
rollup-tx-merge 338.65 MB 338.65 MB 1
semaphore_depth_10 92.18 MB 92.18 MB 1
sha512_100_bytes 185.49 MB 185.51 MB 1.00

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

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: 15d25c9 Previous: 84d900d Ratio
rollup-root 0.005 s 0.004 s 1.25

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

CC: @TomAFrench

@aakoshh aakoshh requested a review from a team October 8, 2025 17:42
Base automatically changed from af/9930-ssa-inter-overflow to master October 10, 2025 10:08
@aakoshh aakoshh force-pushed the af/9930-unchecked-index branch from 15d25c9 to 869e546 Compare October 10, 2025 10:16
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 'ACVM Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 869e546 Previous: d09585f Ratio
perfectly_parallel_batch_inversion_opcodes 2786444 ns/iter (± 4996) 2257063 ns/iter (± 8139) 1.23

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

CC: @TomAFrench

@aakoshh aakoshh requested review from a team and removed request for a team October 10, 2025 10:40
@vezenovm vezenovm added this pull request to the merge queue Oct 13, 2025
Merged via the queue into master with commit 86565a2 Oct 13, 2025
132 checks passed
@vezenovm vezenovm deleted the af/9930-unchecked-index branch October 13, 2025 18:20
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Oct 14, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore(ssa): Restore the use of unchecked index operations
(noir-lang/noir#10110)
END_COMMIT_OVERRIDE
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Oct 14, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore(ssa): Restore the use of unchecked index operations
(noir-lang/noir#10110)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bench-show Display benchmark results on PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSA interpreter fails on test: regression_7759

2 participants