Skip to content

chore(ssa): Run mem2reg before preprocess functions#11333

Merged
jfecher merged 1 commit intomasterfrom
mv/reactive-mem2reg-pre-preprocess
Jan 26, 2026
Merged

chore(ssa): Run mem2reg before preprocess functions#11333
jfecher merged 1 commit intomasterfrom
mv/reactive-mem2reg-pre-preprocess

Conversation

@vezenovm
Copy link
Contributor

Description

Problem

We had to previously disable running mem2reg earlier in the SSA pipeline #9987.

Summary

I went to investigate the cause of the bug and found that the aztec-nr tests pass with our current mem2reg. I also ran this reactivation against the full aztec-packages CI AztecProtocol/aztec-packages#19871 and it passed.

Additional Context

I am still working on determining the exact commit which fixed this bug.

User Documentation

Check one:

  • No user documentation needed.
  • Changes in docs/ included in this PR.
  • [For Experimental Features] Changes in docs/ 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.

@vezenovm vezenovm added the bench-show Display benchmark results on PR label Jan 26, 2026
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: 6d4fe35 Previous: bb12309 Ratio
purely_sequential_opcodes 181015 ns/iter (± 1806) 264330 ns/iter (± 3556) 0.68
perfectly_parallel_opcodes 169438 ns/iter (± 501) 232197 ns/iter (± 3953) 0.73
perfectly_parallel_batch_inversion_opcodes 2469014 ns/iter (± 19690) 2802943 ns/iter (± 6636) 0.88

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

@github-actions
Copy link
Contributor

Changes to number of Brillig opcodes executed

Generated at commit: 40a2fdbfd524687ea11ad28448cc3b9b0b8c2056, compared to commit: bb123097bfa6a73605c1962ad782ca4bb7fd9856

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
vector_regex_inliner_max +534 ❌ +19.45%
a_7_function_inliner_max -235 ✅ -11.57%
references_inliner_max -40 ✅ -21.74%
regression_unused_nested_array_get_inliner_max -59 ✅ -76.62%
regression_unused_nested_array_get_inliner_min -59 ✅ -76.62%
regression_unused_nested_array_get_inliner_zero -59 ✅ -76.62%

Full diff report 👇
Program Brillig opcodes (+/-) %
vector_regex_inliner_max 3,280 (+534) +19.45%
regression_6674_1_inliner_min 703 (+43) +6.52%
regression_6674_2_inliner_min 729 (+43) +6.27%
fold_numeric_generic_poseidon_inliner_zero 4,481 (+137) +3.15%
no_predicates_numeric_generic_poseidon_inliner_zero 4,481 (+137) +3.15%
vector_regex_inliner_zero 3,907 (+42) +1.09%
hashmap_inliner_min 75,792 (+574) +0.76%
hashmap_inliner_zero 71,558 (+526) +0.74%
bench_2_to_17_inliner_zero 452,577 (+3,272) +0.73%
fold_numeric_generic_poseidon_inliner_min 4,499 (+27) +0.60%
no_predicates_numeric_generic_poseidon_inliner_min 4,499 (+27) +0.60%
fold_2_to_17_inliner_zero 1,037,923 (+6,224) +0.60%
fold_2_to_17_inliner_min 1,037,955 (+6,224) +0.60%
bench_2_to_17_inliner_min 545,712 (+3,272) +0.60%
uhashmap_inliner_min 150,821 (+701) +0.47%
uhashmap_inliner_zero 145,766 (+545) +0.38%
array_sort_inliner_min 944 (+1) +0.11%
regression_5252_inliner_min 923,335 (+30) +0.00%
fold_2_to_17_inliner_max 766,012 (-4) -0.00%
brillig_cow_regression_inliner_max 188,852 (-1) -0.00%
brillig_cow_regression_inliner_zero 188,852 (-1) -0.00%
regression_5252_inliner_zero 910,855 (-570) -0.06%
poseidonsponge_x5_254_inliner_zero 182,976 (-120) -0.07%
poseidonsponge_x5_254_inliner_max 151,377 (-122) -0.08%
regression_5252_inliner_max 752,048 (-610) -0.08%
poseidon_bn254_hash_width_3_inliner_max 136,313 (-119) -0.09%
uhashmap_inliner_max 124,566 (-155) -0.12%
array_sort_inliner_max 824 (-4) -0.48%
array_sort_inliner_zero 824 (-4) -0.48%
numeric_type_alias_inliner_max 1,302 (-7) -0.53%
numeric_type_alias_inliner_zero 1,302 (-7) -0.53%
hashmap_inliner_max 56,091 (-588) -1.04%
regression_6674_1_inliner_max 665 (-13) -1.92%
regression_6674_2_inliner_max 665 (-13) -1.92%
nested_array_dynamic_inliner_max 2,473 (-52) -2.06%
references_inliner_zero 302 (-13) -4.13%
nested_array_in_vector_inliner_max 1,220 (-56) -4.39%
regression_6674_3_inliner_max 1,151 (-60) -4.95%
regression_6674_3_inliner_zero 1,151 (-60) -4.95%
a_7_function_inliner_max 1,796 (-235) -11.57%
references_inliner_max 144 (-40) -21.74%
regression_unused_nested_array_get_inliner_max 18 (-59) -76.62%
regression_unused_nested_array_get_inliner_min 18 (-59) -76.62%
regression_unused_nested_array_get_inliner_zero 18 (-59) -76.62%

@github-actions
Copy link
Contributor

Changes to Brillig bytecode sizes

Generated at commit: 40a2fdbfd524687ea11ad28448cc3b9b0b8c2056, compared to commit: bb123097bfa6a73605c1962ad782ca4bb7fd9856

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
a_7_function_inliner_max -104 ✅ -20.27%
regression_unused_nested_array_get_inliner_max -14 ✅ -41.18%
regression_unused_nested_array_get_inliner_min -14 ✅ -41.18%
regression_unused_nested_array_get_inliner_zero -14 ✅ -41.18%
references_inliner_max -62 ✅ -45.59%

Full diff report 👇
Program Brillig opcodes (+/-) %
vector_regex_inliner_max 2,185 (+277) +14.52%
regression_5252_inliner_zero 3,221 (-1) -0.03%
poseidonsponge_x5_254_inliner_zero 2,881 (-1) -0.03%
uhashmap_inliner_min 7,172 (-4) -0.06%
hashmap_inliner_zero 7,979 (-6) -0.08%
brillig_cow_regression_inliner_max 1,210 (-1) -0.08%
brillig_cow_regression_inliner_zero 1,210 (-1) -0.08%
poseidon_bn254_hash_width_3_inliner_max 4,827 (-4) -0.08%
regression_5252_inliner_max 4,012 (-4) -0.10%
poseidonsponge_x5_254_inliner_max 3,670 (-4) -0.11%
no_predicates_numeric_generic_poseidon_inliner_zero 496 (-2) -0.40%
fold_numeric_generic_poseidon_inliner_zero 496 (-2) -0.40%
uhashmap_inliner_zero 6,882 (-30) -0.43%
array_sort_inliner_max 423 (-2) -0.47%
array_sort_inliner_zero 423 (-2) -0.47%
uhashmap_inliner_max 11,068 (-96) -0.86%
fold_2_to_17_inliner_max 461 (-4) -0.86%
vector_regex_inliner_zero 1,663 (-15) -0.89%
numeric_type_alias_inliner_max 326 (-7) -2.10%
numeric_type_alias_inliner_zero 326 (-7) -2.10%
hashmap_inliner_max 17,928 (-569) -3.08%
nested_array_dynamic_inliner_max 1,546 (-60) -3.74%
regression_6674_1_inliner_max 209 (-13) -5.86%
regression_6674_2_inliner_max 209 (-13) -5.86%
nested_array_in_vector_inliner_max 944 (-81) -7.90%
references_inliner_zero 191 (-17) -8.17%
regression_6674_3_inliner_max 417 (-64) -13.31%
regression_6674_3_inliner_zero 417 (-64) -13.31%
regression_6674_2_inliner_min 221 (-37) -14.34%
regression_6674_1_inliner_min 199 (-37) -15.68%
a_7_function_inliner_max 409 (-104) -20.27%
regression_unused_nested_array_get_inliner_max 20 (-14) -41.18%
regression_unused_nested_array_get_inliner_min 20 (-14) -41.18%
regression_unused_nested_array_get_inliner_zero 20 (-14) -41.18%
references_inliner_max 74 (-62) -45.59%

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: 6d4fe35 Previous: bb12309 Ratio
test_report_AztecProtocol_aztec-packages_noir-projects_aztec-nr 155 s 157 s 0.99
test_report_AztecProtocol_aztec-packages_noir-projects_noir-contracts 167 s 163 s 1.02
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob 206 s 209 s 0.99
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_private-kernel-lib 370 s 373 s 0.99
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types 164 s 163 s 1.01
test_report_noir-lang_noir-bignum_ 172 s 168 s 1.02
test_report_noir-lang_noir_bigcurve_ 310 s 245 s 1.27
test_report_noir-lang_sha256_ 18 s 18 s 1
test_report_noir-lang_sha512_ 13 s 16 s 0.81
test_report_zkpassport_noir-ecdsa_ 3 s 2 s 1.50
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

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

Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
test_report_noir-lang_noir_bigcurve_ 310 s 245 s 1.27
test_report_zkpassport_noir-ecdsa_ 3 s 2 s 1.50
test_report_zkpassport_noir_rsa_ 2 s 1 s 2

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.

Execution Time

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 0.043 s 0.043 s 1
private-kernel-reset 0.222 s 0.221 s 1.00
private-kernel-tail 0.007 s 0.009 s 0.78
rollup-block-root-first-empty-tx 0.003 s 0.003 s 1
rollup-block-root-single-tx 0.003 s 0.002 s 1.50
rollup-block-root 0.004 s 0.003 s 1.33
rollup-checkpoint-merge 0.003 s 0.003 s 1
rollup-checkpoint-root-single-block 26.7 s 19.9 s 1.34
rollup-checkpoint-root 27.8 s 20.1 s 1.38
rollup-root 0.004 s 0.004 s 1
rollup-tx-base-private 0.339 s 0.341 s 0.99
rollup-tx-base-public 0.26 s 0.218 s 1.19
rollup-tx-merge 0.002 s 0.002 s 1
semaphore-depth-10 0.009 s 0.009 s 1
sha512-100-bytes 0.054 s 0.057 s 0.95

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: 6d4fe35 Previous: bb12309 Ratio
rollup-block-root-single-tx 0.003 s 0.002 s 1.50
rollup-block-root 0.004 s 0.003 s 1.33
rollup-checkpoint-root-single-block 26.7 s 19.9 s 1.34
rollup-checkpoint-root 27.8 s 20.1 s 1.38

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.

Artifact Size

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 1020.7 KB 1020.8 KB 1.00
private-kernel-reset 2161.9 KB 2168.1 KB 1.00
private-kernel-tail 486.7 KB 493.1 KB 0.99
rollup-block-root-first-empty-tx 224.9 KB 224.9 KB 1
rollup-block-root-single-tx 228.6 KB 228.6 KB 1
rollup-block-root 300.3 KB 300.3 KB 1
rollup-checkpoint-merge 387.4 KB 387.4 KB 1
rollup-checkpoint-root-single-block 48654.1 KB 48651.4 KB 1.00
rollup-checkpoint-root 48717.5 KB 48712.8 KB 1.00
rollup-root 419 KB 419 KB 1
rollup-tx-base-private 5452.2 KB 5452.2 KB 1
rollup-tx-base-public 4770.1 KB 4770.1 KB 1
rollup-tx-merge 175.2 KB 175.2 KB 1
semaphore-depth-10 551.5 KB 551 KB 1.00
sha512-100-bytes 473 KB 473 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.

Opcode count

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 19695 opcodes 19695 opcodes 1
private-kernel-reset 86626 opcodes 86626 opcodes 1
private-kernel-tail 9073 opcodes 9073 opcodes 1
rollup-block-root-first-empty-tx 1082 opcodes 1082 opcodes 1
rollup-block-root-single-tx 969 opcodes 969 opcodes 1
rollup-block-root 2173 opcodes 2173 opcodes 1
rollup-checkpoint-merge 1716 opcodes 1716 opcodes 1
rollup-checkpoint-root-single-block 1831644 opcodes 1831644 opcodes 1
rollup-checkpoint-root 1832840 opcodes 1832840 opcodes 1
rollup-root 2464 opcodes 2464 opcodes 1
rollup-tx-base-private 302267 opcodes 302267 opcodes 1
rollup-tx-base-public 257974 opcodes 257974 opcodes 1
rollup-tx-merge 1304 opcodes 1304 opcodes 1
semaphore-depth-10 5699 opcodes 5699 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.

Compilation Time

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 2.382 s 2.398 s 0.99
private-kernel-reset 7.638 s 7.968 s 0.96
private-kernel-tail 1.97 s 2.456 s 0.80
rollup-block-root-first-empty-tx 1.55 s 1.644 s 0.94
rollup-block-root-single-tx 1.49 s 1.49 s 1
rollup-block-root 1.54 s 1.32 s 1.17
rollup-checkpoint-merge 1.554 s 1.58 s 0.98
rollup-checkpoint-root-single-block 407 s 394 s 1.03
rollup-checkpoint-root 409 s 349 s 1.17
rollup-root 1.612 s 1.612 s 1
rollup-tx-base-private 19.56 s 20.14 s 0.97
rollup-tx-base-public 82.48 s 68.84 s 1.20
rollup-tx-merge 1.272 s 1.5 s 0.85
semaphore-depth-10 0.927 s 0.907 s 1.02
sha512-100-bytes 1.619 s 1.574 s 1.03

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.

Brillig Artifact Size

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 751.2 KB 751.8 KB 1.00
private-kernel-reset 656.9 KB 666.1 KB 0.99
private-kernel-tail 299.4 KB 305.6 KB 0.98
rollup-block-root-first-empty-tx 241.3 KB 244.5 KB 0.99
rollup-block-root-single-tx 245.4 KB 246.3 KB 1.00
rollup-block-root 306 KB 306.7 KB 1.00
rollup-checkpoint-merge 276.8 KB 276.8 KB 1
rollup-checkpoint-root-single-block 554.2 KB 554.1 KB 1.00
rollup-checkpoint-root 596.1 KB 596.3 KB 1.00
rollup-root 424.7 KB 424.7 KB 1
rollup-tx-base-private 618.9 KB 619.1 KB 1.00
rollup-tx-base-public 768.8 KB 768.7 KB 1.00
rollup-tx-merge 197.3 KB 197.3 KB 1
semaphore-depth-10 2068.8 KB 2068.6 KB 1.00
sha512-100-bytes 161.6 KB 161.4 KB 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.

Brillig Compilation Time

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 1.232 s 1.284 s 0.96
private-kernel-reset 1.27 s 1.264 s 1.00
private-kernel-tail 0.912 s 1.1 s 0.83
rollup-block-root-first-empty-tx 1.51 s 1.622 s 0.93
rollup-block-root-single-tx 1.45 s 1.47 s 0.99
rollup-block-root 1.46 s 1.25 s 1.17
rollup-checkpoint-merge 1.5 s 1.512 s 0.99
rollup-checkpoint-root-single-block 2.13 s 1.8 s 1.18
rollup-checkpoint-root 2.01 s 1.69 s 1.19
rollup-root 1.526 s 1.498 s 1.02
rollup-tx-base-private 1.632 s 1.682 s 0.97
rollup-tx-base-public 1.698 s 1.476 s 1.15
rollup-tx-merge 1.212 s 1.462 s 0.83
semaphore-depth-10 0.24 s 0.23 s 1.04
sha512-100-bytes 0.202 s 0.201 s 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.

Brillig Execution Time

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 0.033 s 0.033 s 1
private-kernel-reset 0.102 s 0.101 s 1.01
private-kernel-tail 0.004 s 0.005 s 0.80
rollup-block-root-first-empty-tx 0.003 s 0.003 s 1
rollup-block-root-single-tx 0.002 s 0.002 s 1
rollup-block-root 0.003 s 0.002 s 1.50
rollup-checkpoint-merge 0.002 s 0.002 s 1
rollup-root 0.002 s 0.002 s 1
rollup-tx-base-private 0.035 s 0.035 s 1
rollup-tx-base-public 0.045 s 0.036 s 1.25
rollup-tx-merge 0.001 s 0.002 s 0.50
semaphore-depth-10 0.024 s 0.025 s 0.96
sha512-100-bytes 0.017 s 0.017 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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Brillig Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
rollup-block-root 0.003 s 0.002 s 1.50
rollup-tx-base-public 0.045 s 0.036 s 1.25

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.

Compilation Memory

Details
Benchmark suite Current: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 288.71 MB 288.71 MB 1
private-kernel-reset 503.82 MB 503.98 MB 1.00
private-kernel-tail 261.8 MB 261.97 MB 1.00
rollup-block-root-first-empty-tx 360.35 MB 360.35 MB 1
rollup-block-root-single-tx 360.35 MB 360.35 MB 1
rollup-block-root 360.35 MB 360.35 MB 1
rollup-checkpoint-merge 360.35 MB 360.35 MB 1
rollup-checkpoint-root-single-block 11340 MB 11340 MB 1
rollup-checkpoint-root 11340 MB 11340 MB 1
rollup-root 361.11 MB 361.15 MB 1.00
rollup-tx-base-private 1090 MB 1090 MB 1
rollup-tx-base-public 3040 MB 3040 MB 1
rollup-tx-merge 360.35 MB 360.35 MB 1
semaphore_depth_10 98.18 MB 98.16 MB 1.00
sha512_100_bytes 184.87 MB 186.19 MB 0.99

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: 6d4fe35 Previous: bb12309 Ratio
private-kernel-inner 271.79 MB 271.8 MB 1.00
private-kernel-reset 309.42 MB 309.45 MB 1.00
private-kernel-tail 260.36 MB 260.46 MB 1.00
rollup-block-root 361.59 MB 361.59 MB 1
rollup-checkpoint-merge 361.66 MB 361.66 MB 1
rollup-checkpoint-root-single-block 1760 MB 1760 MB 1
rollup-checkpoint-root 1760 MB 1760 MB 1
rollup-root 362.09 MB 362.1 MB 1.00
rollup-tx-base-private 545.88 MB 545.88 MB 1
rollup-tx-base-public 487.15 MB 487.15 MB 1
rollup-tx-merge 361.15 MB 361.15 MB 1
semaphore_depth_10 74.24 MB 74.23 MB 1.00
sha512_100_bytes 72.52 MB 72.52 MB 1

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

@jfecher jfecher added this pull request to the merge queue Jan 26, 2026
Merged via the queue into master with commit f48f2c5 Jan 26, 2026
136 checks passed
@jfecher jfecher deleted the mv/reactive-mem2reg-pre-preprocess branch January 26, 2026 19:56
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.

2 participants