Skip to content

chore(ssa): Thread SSA interpreter as an argument to avoid lifetimes #9658

Merged
vezenovm merged 2 commits intomv/const-eval-with-ssa-interpreter-2from
mv/interpreter-not-on-folding-context
Aug 27, 2025
Merged

chore(ssa): Thread SSA interpreter as an argument to avoid lifetimes #9658
vezenovm merged 2 commits intomv/const-eval-with-ssa-interpreter-2from
mv/interpreter-not-on-folding-context

Conversation

@vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Aug 27, 2025

Description

Problem*

Builds upon #9655

We want to only interpret globals a single time. When the interpreter lives on the Context which is per function, we are required to interpret the globals for each function.

Summary*

Threads an &mut Option<Interpreter<Empty>> through our constant folding specific to a function Context. This has a nice side benefit of removing the lifetime reference on Context.

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.

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: 72e0d62 Previous: f601afe Ratio
test_report_zkpassport_noir-ecdsa_ 3 s 1 s 3
test_report_zkpassport_noir_rsa_ 1 s 0 s +∞

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 Aug 27, 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: 72e0d62 Previous: 176a0fc Ratio
purely_sequential_opcodes 248486 ns/iter (± 954) 250921 ns/iter (± 649) 0.99
perfectly_parallel_opcodes 218646 ns/iter (± 2439) 218434 ns/iter (± 1900) 1.00
perfectly_parallel_batch_inversion_opcodes 2795630 ns/iter (± 1748) 2789362 ns/iter (± 8539) 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.

Artifact Size

Details
Benchmark suite Current: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 708.9 KB 708.9 KB 1
private-kernel-reset 2032.7 KB 2032.7 KB 1
private-kernel-tail 536.4 KB 536.5 KB 1.00
rollup-base-private 4319.4 KB 4320.9 KB 1.00
rollup-base-public 3334.1 KB 3334.3 KB 1.00
rollup-block-root-empty 3856.2 KB 3857 KB 1.00
rollup-block-root-single-tx 30756.1 KB 30756.4 KB 1.00
rollup-block-root 30785.7 KB 30786.1 KB 1.00
rollup-merge 188.2 KB 188.2 KB 1
rollup-root 390.4 KB 390.5 KB 1.00
semaphore-depth-10 631.5 KB 631.5 KB 1
sha512-100-bytes 525.5 KB 525.5 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: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 14792 opcodes 14792 opcodes 1
private-kernel-reset 68868 opcodes 68868 opcodes 1
private-kernel-tail 11177 opcodes 11177 opcodes 1
rollup-base-private 221335 opcodes 221335 opcodes 1
rollup-base-public 159954 opcodes 159954 opcodes 1
rollup-block-root-empty 68106 opcodes 68106 opcodes 1
rollup-block-root-single-tx 964509 opcodes 964509 opcodes 1
rollup-block-root 965795 opcodes 965795 opcodes 1
rollup-merge 1409 opcodes 1409 opcodes 1
rollup-root 2631 opcodes 2631 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.

Execution Time

Details
Benchmark suite Current: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 0.015 s 0.019 s 0.79
private-kernel-reset 0.155 s 0.153 s 1.01
private-kernel-tail 0.01 s 0.01 s 1
rollup-base-private 0.266 s 0.264 s 1.01
rollup-base-public 0.166 s 0.164 s 1.01
rollup-block-root 12.8 s 12.9 s 0.99
rollup-merge 0.002 s 0.002 s 1
rollup-root 0.004 s 0.004 s 1
semaphore-depth-10 0.019 s 0.019 s 1
sha512-100-bytes 0.102 s 0.1 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.

Compilation Time

Details
Benchmark suite Current: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 1.784 s 1.75 s 1.02
private-kernel-reset 8.038 s 7.686 s 1.05
private-kernel-tail 1.336 s 1.426 s 0.94
rollup-base-private 15.82 s 15.36 s 1.03
rollup-base-public 13.42 s 14.16 s 0.95
rollup-block-root-empty 24.46 s 21.32 s 1.15
rollup-block-root-single-tx 206 s 199 s 1.04
rollup-block-root 198 s 210 s 0.94
rollup-merge 1.326 s 1.358 s 0.98
rollup-root 1.472 s 1.47 s 1.00
semaphore-depth-10 0.778 s 0.777 s 1.00
sha512-100-bytes 1.769 s 1.624 s 1.09

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: 72e0d62 Previous: f601afe Ratio
test_report_AztecProtocol_aztec-packages_noir-projects_aztec-nr 98 s 99 s 0.99
test_report_AztecProtocol_aztec-packages_noir-projects_noir-contracts 113 s 109 s 1.04
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob 167 s 167 s 1
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_private-kernel-lib 206 s 208 s 0.99
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_reset-kernel-lib 32 s 32 s 1
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_rollup-lib 662 s 609 s 1.09
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types 94 s 97 s 0.97
test_report_noir-lang_noir-bignum_ 132 s 135 s 0.98
test_report_noir-lang_noir_bigcurve_ 320 s 347 s 0.92
test_report_noir-lang_sha256_ 15 s 15 s 1
test_report_noir-lang_sha512_ 12 s 14 s 0.86
test_report_zkpassport_noir-ecdsa_ 3 s 1 s 3
test_report_zkpassport_noir_rsa_ 1 s 0 s +∞

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: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 239.62 MB 239.58 MB 1.00
private-kernel-reset 549.15 MB 549.15 MB 1
private-kernel-tail 214.04 MB 213.94 MB 1.00
rollup-base-private 1350 MB 1350 MB 1
rollup-base-public 1400 MB 1400 MB 1
rollup-block-root-empty 1010 MB 1010 MB 1
rollup-block-root-single-tx 9690 MB 9690 MB 1
rollup-block-root 9690 MB 9690 MB 1
rollup-merge 330.61 MB 330.59 MB 1.00
rollup-root 341.38 MB 341.33 MB 1.00
semaphore_depth_10 104.75 MB 104.73 MB 1.00
sha512_100_bytes 233.04 MB 232.98 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.

Execution Memory

Details
Benchmark suite Current: 72e0d62 Previous: b544e60 Ratio
private-kernel-inner 212.98 MB 212.98 MB 1
private-kernel-reset 246.18 MB 246.18 MB 1
private-kernel-tail 197.81 MB 197.81 MB 1
rollup-base-private 501.57 MB 501.57 MB 1
rollup-base-public 434.03 MB 434.03 MB 1
rollup-block-root 1500 MB 1500 MB 1
rollup-merge 328.36 MB 328.36 MB 1
rollup-root 330.89 MB 330.89 MB 1
semaphore_depth_10 69.53 MB 69.53 MB 1
sha512_100_bytes 55.03 MB 55.03 MB 1

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

@vezenovm vezenovm merged commit ad2a326 into mv/const-eval-with-ssa-interpreter-2 Aug 27, 2025
118 checks passed
@vezenovm vezenovm deleted the mv/interpreter-not-on-folding-context branch August 27, 2025 19:08
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.

1 participant