Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync from noir #5134

Merged
merged 13 commits into from
Mar 12, 2024
Merged

feat: Sync from noir #5134

merged 13 commits into from
Mar 12, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 11, 2024

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: generalise FunctionVisibility to ItemVisibility (noir-lang/noir#4495)
fix: Dynamic assert messages in brillig (noir-lang/noir#4531)
chore: organize the blackbox_solver crate (noir-lang/noir#4519)
fix(acir_gen): More granular element sizes array check (noir-lang/noir#4528)
chore: Release Noir(0.25.0) (noir-lang/noir#4352)
chore: document big integers (noir-lang/noir#4487)
fix: Add follow_bindings to follow Type::Alias links (noir-lang/noir#4521)
fix: Fix brillig slowdown when assigning arrays in loops (noir-lang/noir#4472)
chore: Move check_method_signatures to type checking phase (noir-lang/noir#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits (noir-lang/noir#4493)
fix(ssa): Handle mergers of slices returned from calls (noir-lang/noir#4496)
chore: Add HashMap docs (noir-lang/noir#4457)
chore: custom hash for eddsa (noir-lang/noir#4440)
chore: update various dependencies (noir-lang/noir#4513)
fix: Allow type aliases in main (noir-lang/noir#4505)
chore: add ModuleDeclaration struct (noir-lang/noir#4512)
fix: Force src impl for == on slices (noir-lang/noir#4507)
chore: pass import_directive by reference (noir-lang/noir#4511)
feat: Track stack frames and their variables in the debugger (noir-lang/noir#4188)
chore: add regression test for issue 4449 (noir-lang/noir#4503)
chore: pass macro processors by reference (noir-lang/noir#4501)
chore: bump bb to 0.26.3 (noir-lang/noir#4488)
fix: handling of gh deps in noir_wasm (noir-lang/noir#4499)
fix: iterative flattening pass (noir-lang/noir#4492)
chore: Move templated code for assert_message into the stdlib (noir-lang/noir#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config (noir-lang/noir#4486)
feat: run tests in parallel in nargo test (noir-lang/noir#4484)
END_COMMIT_OVERRIDE

…oir-lang/noir#4472)

chore: Move `check_method_signatures` to type checking phase (noir-lang/noir#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits (noir-lang/noir#4493)
fix(ssa): Handle mergers of slices returned from calls (noir-lang/noir#4496)
chore: Add HashMap docs (noir-lang/noir#4457)
chore: custom hash for eddsa (noir-lang/noir#4440)
chore: update various dependencies (noir-lang/noir#4513)
fix: Allow type aliases in main (noir-lang/noir#4505)
chore: add `ModuleDeclaration` struct (noir-lang/noir#4512)
fix: Force src impl for == on slices (noir-lang/noir#4507)
chore: pass `import_directive` by reference (noir-lang/noir#4511)
feat: Track stack frames and their variables in the debugger (noir-lang/noir#4188)
chore: add regression test for issue 4449 (noir-lang/noir#4503)
chore: pass macro processors by reference (noir-lang/noir#4501)
chore: bump bb to 0.26.3 (noir-lang/noir#4488)
fix: handling of gh deps in noir_wasm (noir-lang/noir#4499)
fix: iterative flattening pass (noir-lang/noir#4492)
chore: Move templated code for assert_message into the stdlib (noir-lang/noir#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config (noir-lang/noir#4486)
feat: run tests in parallel in `nargo test`  (noir-lang/noir#4484)
Copy link
Contributor

github-actions bot commented Mar 11, 2024

Changes to circuit sizes

Generated at commit: 11ad1a989dddde8e11763594d775b5e9f47a49e8, compared to commit: c8e1cb8c6bc07bda2cf4aec3b5d2b2120bfafd01

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail +49,354 ❌ +13.23% +49,739 ❌ +5.93%
private_kernel_init +2,211 ❌ +4.76% +2,211 ❌ +0.63%
rollup_base +10,496 ❌ +6.52% +10,496 ❌ +0.61%
private_kernel_inner +2,214 ❌ +2.36% +2,214 ❌ +0.43%
public_kernel_tail +824 ❌ +0.65% +824 ❌ +0.23%
public_kernel_app_logic +593 ❌ +1.08% +593 ❌ +0.19%
public_kernel_setup +191 ❌ +0.70% +191 ❌ +0.11%
public_kernel_teardown +191 ❌ +0.65% +191 ❌ +0.11%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_tail 422,493 (+49,354) +13.23% 888,984 (+49,739) +5.93%
private_kernel_init 48,685 (+2,211) +4.76% 350,742 (+2,211) +0.63%
rollup_base 171,586 (+10,496) +6.52% 1,730,898 (+10,496) +0.61%
private_kernel_inner 95,968 (+2,214) +2.36% 521,696 (+2,214) +0.43%
public_kernel_tail 127,111 (+824) +0.65% 365,170 (+824) +0.23%
public_kernel_app_logic 55,521 (+593) +1.08% 313,315 (+593) +0.19%
public_kernel_setup 27,607 (+191) +0.70% 179,676 (+191) +0.11%
public_kernel_teardown 29,353 (+191) +0.65% 181,423 (+191) +0.11%

@AztecBot
Copy link
Collaborator Author

AztecBot commented Mar 11, 2024

Benchmark results

Metrics with a significant change:

  • circuit_simulation_time_in_ms (private-kernel-inner): 630 (+75%)
  • circuit_simulation_time_in_ms (public-kernel-app-logic): 439 (+139%)
  • tx_pxe_processing_time_ms (0): 3,908 (+27%)
  • tx_pxe_processing_time_ms (1): 1,729 (+21%)
  • tx_sequencer_processing_time_ms (1): 1,230 (+73%)
  • note_history_trial_decrypting_time_in_ms (5): 110 (+77%)
  • l2_block_building_time_in_ms (8): 16,745 (+29%)
  • l2_block_building_time_in_ms (32): 67,493 (+33%)
  • l2_block_building_time_in_ms (64): 131,754 (+30%)
  • l2_block_public_tx_process_time_in_ms (8): 9,832 (+64%)
  • l2_block_public_tx_process_time_in_ms (32): 39,400 (+72%)
  • l2_block_public_tx_process_time_in_ms (64): 77,294 (+68%)
  • note_successful_decrypting_time_in_ms (8): 227 (+76%)
  • note_trial_decrypting_time_in_ms (8): 68.1 (+93%)
Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

Values are compared against data from master at commit 426bd6d2 and shown if the difference exceeds 1%.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 5,668 18,820 36,356
l1_rollup_calldata_gas 65,956 238,816 469,460
l1_rollup_execution_gas 666,588 953,677 1,336,768
l2_block_processing_time_in_ms 1,269 (-3%) 4,777 (-1%) 8,669 (-6%)
note_successful_decrypting_time_in_ms ⚠️ 227 (+76%) 478 (-14%) 895 (-11%)
note_trial_decrypting_time_in_ms ⚠️ 68.1 (+93%) 95.3 (+36%) 125 (-5%)
l2_block_building_time_in_ms ⚠️ 16,745 (+29%) ⚠️ 67,493 (+33%) ⚠️ 131,754 (+30%)
l2_block_rollup_simulation_time_in_ms 6,887 (-1%) 28,032 (+1%) 54,359 (-2%)
l2_block_public_tx_process_time_in_ms ⚠️ 9,832 (+64%) ⚠️ 39,400 (+72%) ⚠️ 77,294 (+68%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 13,954 26,221 (+4%)
note_history_successful_decrypting_time_in_ms 1,317 (+11%) 2,532 (+4%)
note_history_trial_decrypting_time_in_ms ⚠️ 110 (+77%) 171 (+13%)
node_database_size_in_bytes 19,054,672 35,868,752 (+1%)
pxe_database_size_in_bytes 29,859 59,414

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 278 (+2%) 44,338 27,700
private-kernel-ordering 217 (+6%) 52,324 14,326
base-rollup 631 (+1%) 177,083 925
root-rollup 67.5 (-1%) 4,176 789
private-kernel-inner ⚠️ 630 (+75%) 73,197 27,700
public-kernel-app-logic ⚠️ 439 (+139%) 35,198 28,215
public-kernel-tail 177 (+2%) 40,926 28,215
merge-rollup 8.26 2,696 925

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 9.94 15.9 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.6 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.576 (-1%) 0.491 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 45.6 (-1%) 71.4 223 (-3%) 447 (+1%) 840 (-3%) 1,664 (-3%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 96.0 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.469 (-1%) 0.441 0.407 (-3%) 0.418 (+1%) 0.400 (-3%) 0.399 (-3%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 53.8 (+2%) 104 (-2%) 326 (-2%) 660 (+1%) 1,278 (-2%) 2,530 (-2%) N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 104 207 691 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.479 (+1%) 0.472 (-1%) 0.445 (-2%) 0.454 0.444 (-2%) 0.439 (-3%) N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 61.1
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 109
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.535

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes
tx_size_in_bytes 22,014

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms ⚠️ 3,908 (+27%) ⚠️ 1,729 (+21%)
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 11.0 (-8%) ⚠️ 1,230 (+73%)

@TomAFrench
Copy link
Member

TomAFrench commented Mar 11, 2024

@jfecher @sirasistant is noir-lang/noir#4472 responsible for the bytecode size issues do you think?

@jfecher
Copy link
Contributor

jfecher commented Mar 11, 2024

@TomAFrench yes, based on what I've heard from @sirasistant.

Yeah size went up for the token contract from 7k fields to a bit more than 9k fields. But seems to run fine

I do think this PR is unfortunately somewhat required since it fixes a miscompilation which otherwise could cause code written one way to be compiled as if different code was written. Specifically, mutating one array could mutate another. One thing we could add to try to improve this optimization regression is to add decrement_rc instructions, and an optimization pass on RC in general. I'll open an issue for it.

TomAFrench and others added 9 commits March 11, 2024 22:37
* master:
  chore!: Remove open keyword from Noir (#4967)
noir-lang/noir#4495)

fix: Dynamic assert messages in brillig (noir-lang/noir#4531)
chore: organize the `blackbox_solver` crate (noir-lang/noir#4519)
fix(acir_gen): More granular element sizes array check (noir-lang/noir#4528)
chore: Release Noir(0.25.0) (noir-lang/noir#4352)
chore: document big integers (noir-lang/noir#4487)
fix: Add `follow_bindings` to follow `Type::Alias` links (noir-lang/noir#4521)
fix: Fix brillig slowdown when assigning arrays in loops (noir-lang/noir#4472)
chore: Move `check_method_signatures` to type checking phase (noir-lang/noir#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits (noir-lang/noir#4493)
fix(ssa): Handle mergers of slices returned from calls (noir-lang/noir#4496)
chore: Add HashMap docs (noir-lang/noir#4457)
chore: custom hash for eddsa (noir-lang/noir#4440)
chore: update various dependencies (noir-lang/noir#4513)
fix: Allow type aliases in main (noir-lang/noir#4505)
chore: add `ModuleDeclaration` struct (noir-lang/noir#4512)
fix: Force src impl for == on slices (noir-lang/noir#4507)
chore: pass `import_directive` by reference (noir-lang/noir#4511)
feat: Track stack frames and their variables in the debugger (noir-lang/noir#4188)
chore: add regression test for issue 4449 (noir-lang/noir#4503)
chore: pass macro processors by reference (noir-lang/noir#4501)
chore: bump bb to 0.26.3 (noir-lang/noir#4488)
fix: handling of gh deps in noir_wasm (noir-lang/noir#4499)
fix: iterative flattening pass (noir-lang/noir#4492)
chore: Move templated code for assert_message into the stdlib (noir-lang/noir#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config (noir-lang/noir#4486)
feat: run tests in parallel in `nargo test`  (noir-lang/noir#4484)
…/noir#4495)

fix: Dynamic assert messages in brillig (noir-lang/noir#4531)
chore: organize the `blackbox_solver` crate (noir-lang/noir#4519)
fix(acir_gen): More granular element sizes array check (noir-lang/noir#4528)
chore: Release Noir(0.25.0) (noir-lang/noir#4352)
chore: document big integers (noir-lang/noir#4487)
fix: Add `follow_bindings` to follow `Type::Alias` links (noir-lang/noir#4521)
fix: Fix brillig slowdown when assigning arrays in loops (noir-lang/noir#4472)
chore: Move `check_method_signatures` to type checking phase (noir-lang/noir#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits (noir-lang/noir#4493)
fix(ssa): Handle mergers of slices returned from calls (noir-lang/noir#4496)
chore: Add HashMap docs (noir-lang/noir#4457)
chore: custom hash for eddsa (noir-lang/noir#4440)
chore: update various dependencies (noir-lang/noir#4513)
fix: Allow type aliases in main (noir-lang/noir#4505)
chore: add `ModuleDeclaration` struct (noir-lang/noir#4512)
fix: Force src impl for == on slices (noir-lang/noir#4507)
chore: pass `import_directive` by reference (noir-lang/noir#4511)
feat: Track stack frames and their variables in the debugger (noir-lang/noir#4188)
chore: add regression test for issue 4449 (noir-lang/noir#4503)
chore: pass macro processors by reference (noir-lang/noir#4501)
chore: bump bb to 0.26.3 (noir-lang/noir#4488)
fix: handling of gh deps in noir_wasm (noir-lang/noir#4499)
fix: iterative flattening pass (noir-lang/noir#4492)
chore: Move templated code for assert_message into the stdlib (noir-lang/noir#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config (noir-lang/noir#4486)
feat: run tests in parallel in `nargo test`  (noir-lang/noir#4484)
* master:
  feat: Nullifier non membership (#5152)
  refactor: share code between provers (#4655)
  fix: Increase the json limit for RPC requests (#5161)
  fix: Move timers for ClientIVC breakdown (#5145)
  chore(master): Release 0.27.0 (#5100)
@TomAFrench
Copy link
Member

@sirasistant can I had this off to you to look into the aztec CI issues?

@sirasistant
Copy link
Contributor

yup! Will check

@TomAFrench
Copy link
Member

Thanks!

@sirasistant
Copy link
Contributor

Oh, it appears to be just a flaky test

@sirasistant sirasistant merged commit 58e15ed into master Mar 12, 2024
97 checks passed
@sirasistant sirasistant deleted the sync-noir branch March 12, 2024 18:15
AztecBot added a commit to noir-lang/noir that referenced this pull request Mar 12, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: generalise `FunctionVisibility` to `ItemVisibility`
(#4495)
fix: Dynamic assert messages in brillig
(#4531)
chore: organize the `blackbox_solver` crate
(#4519)
fix(acir_gen): More granular element sizes array check
(#4528)
chore: Release Noir(0.25.0)
(#4352)
chore: document big integers
(#4487)
fix: Add `follow_bindings` to follow `Type::Alias` links
(#4521)
fix: Fix brillig slowdown when assigning arrays in loops
(#4472)
chore: Move `check_method_signatures` to type checking phase
(#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits
(#4493)
fix(ssa): Handle mergers of slices returned from calls
(#4496)
chore: Add HashMap docs (#4457)
chore: custom hash for eddsa
(#4440)
chore: update various dependencies
(#4513)
fix: Allow type aliases in main
(#4505)
chore: add `ModuleDeclaration` struct
(#4512)
fix: Force src impl for == on slices
(#4507)
chore: pass `import_directive` by reference
(#4511)
feat: Track stack frames and their variables in the debugger
(#4188)
chore: add regression test for issue 4449
(#4503)
chore: pass macro processors by reference
(#4501)
chore: bump bb to 0.26.3 (#4488)
fix: handling of gh deps in noir_wasm
(#4499)
fix: iterative flattening pass
(#4492)
chore: Move templated code for assert_message into the stdlib
(#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config
(#4486)
feat: run tests in parallel in `nargo test`
(#4484)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
AztecBot added a commit to noir-lang/noir that referenced this pull request Mar 12, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: generalise `FunctionVisibility` to `ItemVisibility`
(#4495)
fix: Dynamic assert messages in brillig
(#4531)
chore: organize the `blackbox_solver` crate
(#4519)
fix(acir_gen): More granular element sizes array check
(#4528)
chore: Release Noir(0.25.0)
(#4352)
chore: document big integers
(#4487)
fix: Add `follow_bindings` to follow `Type::Alias` links
(#4521)
fix: Fix brillig slowdown when assigning arrays in loops
(#4472)
chore: Move `check_method_signatures` to type checking phase
(#4516)
chore(ci): fix JS publishing workflow checking out inconsistent commits
(#4493)
fix(ssa): Handle mergers of slices returned from calls
(#4496)
chore: Add HashMap docs (#4457)
chore: custom hash for eddsa
(#4440)
chore: update various dependencies
(#4513)
fix: Allow type aliases in main
(#4505)
chore: add `ModuleDeclaration` struct
(#4512)
fix: Force src impl for == on slices
(#4507)
chore: pass `import_directive` by reference
(#4511)
feat: Track stack frames and their variables in the debugger
(#4188)
chore: add regression test for issue 4449
(#4503)
chore: pass macro processors by reference
(#4501)
chore: bump bb to 0.26.3 (#4488)
fix: handling of gh deps in noir_wasm
(#4499)
fix: iterative flattening pass
(#4492)
chore: Move templated code for assert_message into the stdlib
(#4475)
chore: pull out separate function for compiling and running a test
chore: update cargo deny config
(#4486)
feat: run tests in parallel in `nargo test`
(#4484)
END_COMMIT_OVERRIDE

---------

Co-authored-by: TomAFrench <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.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.

None yet

4 participants