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 #8619

Merged
merged 10 commits into from
Sep 18, 2024
Merged

feat: Sync from noir #8619

merged 10 commits into from
Sep 18, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Sep 18, 2024

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix!: Infer globals to be u32 when used in a type (noir-lang/noir#6083)
fix: Fix comptime type formatting (noir-lang/noir#6079)
fix: don't crash on untyped global used as array length (noir-lang/noir#6076)
feat(perf): Remove unused loads in mem2reg and last stores per function (noir-lang/noir#5925)
fix: Correct stack trace order in comptime assertion failures (noir-lang/noir#6066)
chore!: removing implicit numeric generics (noir-lang/noir#5837)
fix: Always parse all tokens from quoted token streams (noir-lang/noir#6064)
fix: Update databus in flattening (noir-lang/noir#6063)
fix: Be more lenient with semicolons on interned expressions (noir-lang/noir#6062)
feat: check unconstrained trait impl method matches (noir-lang/noir#6057)
chore: remove unused TypeVariableKind::Constant (noir-lang/noir#6053)
END_COMMIT_OVERRIDE

AztecBot and others added 3 commits September 18, 2024 08:02
…s per function (noir-lang/noir#5925)

fix: Correct stack trace order in comptime assertion failures (noir-lang/noir#6066)
chore!: removing implicit numeric generics (noir-lang/noir#5837)
fix: Always parse all tokens from quoted token streams (noir-lang/noir#6064)
fix: Update databus in flattening (noir-lang/noir#6063)
fix: Be more lenient with semicolons on interned expressions (noir-lang/noir#6062)
feat: check unconstrained trait impl method matches (noir-lang/noir#6057)
chore: remove unused TypeVariableKind::Constant (noir-lang/noir#6053)
@TomAFrench TomAFrench enabled auto-merge (squash) September 18, 2024 10:49
@vezenovm vezenovm added the bench-all CI: Enables this CI job. label Sep 18, 2024
TomAFrench and others added 7 commits September 18, 2024 14:54
…ang/noir#6083)

fix: Fix comptime type formatting (noir-lang/noir#6079)
fix: don't crash on untyped global used as array length (noir-lang/noir#6076)
feat(perf): Remove unused loads in mem2reg and last stores per function (noir-lang/noir#5925)
fix: Correct stack trace order in comptime assertion failures (noir-lang/noir#6066)
chore!: removing implicit numeric generics (noir-lang/noir#5837)
fix: Always parse all tokens from quoted token streams (noir-lang/noir#6064)
fix: Update databus in flattening (noir-lang/noir#6063)
fix: Be more lenient with semicolons on interned expressions (noir-lang/noir#6062)
feat: check unconstrained trait impl method matches (noir-lang/noir#6057)
chore: remove unused TypeVariableKind::Constant (noir-lang/noir#6053)
fix: Fix comptime type formatting (noir-lang/noir#6079)
fix: don't crash on untyped global used as array length (noir-lang/noir#6076)
feat(perf): Remove unused loads in mem2reg and last stores per function (noir-lang/noir#5925)
fix: Correct stack trace order in comptime assertion failures (noir-lang/noir#6066)
chore!: removing implicit numeric generics (noir-lang/noir#5837)
fix: Always parse all tokens from quoted token streams (noir-lang/noir#6064)
fix: Update databus in flattening (noir-lang/noir#6063)
fix: Be more lenient with semicolons on interned expressions (noir-lang/noir#6062)
feat: check unconstrained trait impl method matches (noir-lang/noir#6057)
chore: remove unused TypeVariableKind::Constant (noir-lang/noir#6053)
@AztecBot
Copy link
Collaborator Author

Benchmark results

Metrics with a significant change:

  • proof_construction_time_sha256_100_ms (16): 6,624 (+21%)
  • proof_construction_time_sha256_30_ms (16): 1,778 (+26%)
  • protocol_circuit_simulation_time_in_ms (private-kernel-tail-to-public): 683 (-48%)
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.

Proof generation

Each column represents the number of threads used in proof generation.

Metric 1 threads 4 threads 16 threads 32 threads 64 threads
proof_construction_time_sha256_ms 5,742 1,560 (+1%) 698 745 (-2%) 764
proof_construction_time_sha256_30_ms 11,963 (+1%) 3,188 (+2%) ⚠️ 1,778 (+26%) 1,598 (+11%) 1,547 (+6%)
proof_construction_time_sha256_100_ms 44,098 12,122 (+3%) ⚠️ 6,624 (+21%) 5,946 (+9%) 5,675 (+7%)
proof_construction_time_poseidon_hash_ms 78.0 34.0 34.0 58.0 89.0 (+2%)
proof_construction_time_poseidon_hash_30_ms 1,528 418 201 (+1%) 224 (-1%) 269 (+2%)
proof_construction_time_poseidon_hash_100_ms 5,633 1,519 (+2%) 678 (+1%) 748 (+2%) 743 (-1%)

L2 block published to L1

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

Metric 4 txs 8 txs 16 txs
l1_rollup_calldata_size_in_bytes 4,612 8,260 15,556
l1_rollup_calldata_gas 52,852 97,730 187,072
l1_rollup_execution_gas 822,420 1,559,320 3,351,813
l2_block_processing_time_in_ms 252 (-3%) 450 811 (-1%)
l2_block_building_time_in_ms 9,134 (-2%) 17,920 (-1%) 35,800 (-2%)
l2_block_rollup_simulation_time_in_ms 9,133 (-2%) 17,920 (-1%) 35,800 (-2%)
l2_block_public_tx_process_time_in_ms 4,562 (-3%) 8,965 (-1%) 18,038 (-2%)

L2 chain processing

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

Metric 3 blocks 5 blocks
node_history_sync_time_in_ms 2,806 (+1%) 3,677 (-2%)
node_database_size_in_bytes 12,435,696 16,429,296
pxe_database_size_in_bytes 16,254 26,813

Circuits stats

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

Circuit simulation_time_in_ms witness_generation_time_in_ms input_size_in_bytes output_size_in_bytes proving_time_in_ms
private-kernel-init 74.8 (+3%) 396 21,172 44,898 N/A
private-kernel-inner 139 (-1%) 712 72,240 45,020 N/A
private-kernel-reset-tiny 317 720 (+1%) 64,551 44,886 N/A
private-kernel-tail 151 (-1%) 134 (+1%) 50,580 59,239 N/A
base-parity 6.08 N/A 160 96.0 N/A
root-parity 36.0 (-1%) N/A 73,964 96.0 N/A
base-rollup 399 (-3%) N/A 189,165 664 N/A
block-root-rollup 42.7 N/A 58,217 2,448 N/A
public-kernel-setup 84.6 N/A 114,433 79,670 N/A
public-kernel-app-logic 97.3 (-1%) N/A 114,251 79,670 N/A
public-kernel-tail 568 (-1%) N/A 487,098 16,414 N/A
private-kernel-reset-small 289 N/A 66,345 45,629 N/A
private-kernel-tail-to-public ⚠️ 683 (-48%) 622 444,788 1,825 N/A
public-kernel-teardown 83.8 (-1%) N/A 114,697 79,670 N/A
merge-rollup 20.0 (-1%) N/A 38,182 664 N/A
undefined N/A N/A N/A N/A 98,352 (-1%)

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms
ContractClassRegisterer:register 1,344 11,731 345
ContractInstanceDeployer:deploy 1,408 11,731 18.2 (-1%)
MultiCallEntrypoint:entrypoint 1,920 11,731 395 (-1%)
FeeJuice:deploy 1,376 11,731 388
SchnorrAccount:constructor 1,312 11,731 50.8 (+1%)
SchnorrAccount:entrypoint 2,336 11,731 344
FeeJuice:claim 1,344 11,731 33.3 (-4%)
Token:privately_mint_private_note 1,280 11,731 61.2
FPC:fee_entrypoint_public 1,344 11,731 45.8
Token:transfer 1,312 11,731 134
Benchmarking:create_note 1,344 11,731 50.2
SchnorrAccount:verify_private_authwit 1,280 11,731 24.9
Token:unshield 1,376 11,731 471 (-1%)
FPC:fee_entrypoint_private 1,376 11,731 636

AVM Simulation

Time to simulate various public functions in the AVM.

Function time_ms bytecode_size_in_bytes
FeeJuice:_increase_public_balance 6.39 (-5%) 1,040 (-5%)
FeeJuice:set_portal 4.05 (-24%) 1,042 (-6%)
Token:constructor 176 (-1%) 7,121 (-1%)
FPC:constructor 11.7 (-6%) 4,579 (-2%)
FeeJuice:check_balance 3.30 (+5%) 923
Token:mint_public 7.63 (-1%) 1,903 (-3%)
Token:assert_minter_and_mint 4.61 (-3%) 1,236 (-4%)
AuthRegistry:set_authorized 2.76 (-1%) 465
FPC:prepare_fee 50.3 (+1%) 1,290
Token:transfer_public 8.36 (+1%) 5,304 (-1%)
FPC:pay_refund 30.3 (-2%) 1,708 (-3%)
Benchmarking:increment_balance 9.33 (+6%) 1,405 (-4%)
Token:_increase_public_balance 4.86 (+3%) 1,087
FPC:pay_refund_with_shielded_rebate 44.3 (+1%) 1,708 (-3%)

Public DB Access

Time to access various public DBs.

Function time_ms
get-nullifier-index 0.591 (+2%)

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 256 leaves 512 leaves 1024 leaves
batch_insert_into_append_only_tree_16_depth_ms 2.18 (-1%) 3.93 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.8 31.7 N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.113 (-2%) 0.111 (+1%) N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 11.1 17.9 (+1%) 31.1 (-2%) 60.1 (+1%) 114 (-1%)
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 287 543 1,055
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.107 (-1%) 0.103 (+1%) 0.101 (-2%) 0.103 (+1%) 0.102 (-2%)
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 14.1 (-1%) 26.0 43.7 83.2 (+1%) 162 (+1%)
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 108 207 355 691 1,363
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.107 (-2%) 0.105 0.106 0.102 (-1%) 0.102
batch_insert_into_indexed_tree_40_depth_ms N/A N/A 16.5 (-1%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A 131 (-1%) N/A N/A N/A N/A
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A 0.106 N/A N/A N/A N/A

Miscellaneous

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

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 72,431 671,025

Transaction size based on fee payment method

| Metric | |
| - | |

@TomAFrench TomAFrench merged commit 3e0067a into master Sep 18, 2024
49 checks passed
@TomAFrench TomAFrench deleted the sync-noir branch September 18, 2024 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bench-all CI: Enables this CI job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants