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

Merged
merged 13 commits into from
Jun 6, 2024
Merged

feat: Sync from noir #6801

merged 13 commits into from
Jun 6, 2024

Conversation

AztecBot
Copy link
Collaborator

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: place return value witnesses directly after function arguments (noir-lang/noir#5142)
fix(experimental elaborator): Fix frontend tests when --use-elaborator flag is specified (noir-lang/noir#5145)
chore: Remove unused new_variables argument from resolve_type_inner (noir-lang/noir#5148)
chore: Remove hir to ast pass (noir-lang/noir#5147)
fix(experimental elaborator): Fix definition kind of globals and tuple patterns with --use-elaborator flag (noir-lang/noir#5139)
chore: default to using bn254 in noirc_frontend (noir-lang/noir#5144)
fix(experimental elaborator): Fix impl Trait when --use-elaborator is selected (noir-lang/noir#5138)
fix: wrapping in signed division (noir-lang/noir#5134)
chore(ci): don't raise MSRV issue if workflow cancelled (noir-lang/noir#5143)
fix: use predicate for curve operations (noir-lang/noir#5076)
fix(experimental elaborator): Fix global values used in the elaborator (noir-lang/noir#5135)
fix(experimental elaborator): Clear generics after elaborating type aliases (noir-lang/noir#5136)
fix(frontend): Resolve object types from method calls a single time (noir-lang/noir#5131)
feat: Separate runtimes of SSA functions before inlining (noir-lang/noir#5121)
chore: run all test programs in brillig as well as ACIR (noir-lang/noir#5128)
END_COMMIT_OVERRIDE

AztecBot and others added 4 commits May 31, 2024 15:22
…n arguments (noir-lang/noir#5142)

fix(experimental elaborator): Fix frontend tests when `--use-elaborator` flag is specified (noir-lang/noir#5145)
chore: Remove unused `new_variables` argument from `resolve_type_inner` (noir-lang/noir#5148)
chore: Remove hir to ast pass (noir-lang/noir#5147)
fix(experimental elaborator): Fix definition kind of globals and tuple patterns with `--use-elaborator` flag (noir-lang/noir#5139)
chore: default to using bn254 in `noirc_frontend` (noir-lang/noir#5144)
fix(experimental elaborator): Fix `impl Trait` when `--use-elaborator` is selected (noir-lang/noir#5138)
fix: wrapping in signed division (noir-lang/noir#5134)
chore(ci): don't raise MSRV issue if workflow cancelled (noir-lang/noir#5143)
fix: use predicate for curve operations (noir-lang/noir#5076)
fix(experimental elaborator): Fix global values used in the elaborator (noir-lang/noir#5135)
fix(experimental elaborator): Clear generics after elaborating type aliases (noir-lang/noir#5136)
fix(frontend): Resolve object types from method calls a single time (noir-lang/noir#5131)
feat: Separate runtimes of SSA functions before inlining (noir-lang/noir#5121)
chore: run all test programs in brillig as well as ACIR (noir-lang/noir#5128)
Copy link
Contributor

github-actions bot commented May 31, 2024

Changes to circuit sizes

Generated at commit: 89a29b54b6a4ad62a551225ac24a88709fbf1e10, compared to commit: 1fa7d84b6bf176d4585c333747ac4a61b8743e36

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_reset 0 ➖ 0.00% +128 ❌ +0.01%
private_kernel_reset_big 0 ➖ 0.00% +64 ❌ +0.00%
private_kernel_reset_medium 0 ➖ 0.00% +32 ❌ +0.00%
private_kernel_reset_small 0 ➖ 0.00% +16 ❌ +0.00%
parity_base -1 ✅ -0.29% 0 ➖ 0.00%
parity_root -1 ✅ -0.05% -1 ✅ -0.00%
rollup_base -2 ✅ -0.00% -2 ✅ -0.00%
rollup_merge -4 ✅ -0.30% -4 ✅ -0.00%
public_kernel_tail -70 ✅ -0.01% -70 ✅ -0.00%
private_kernel_tail_to_public -965 ✅ -0.21% -965 ✅ -0.05%
public_kernel_setup -981 ✅ -0.40% -981 ✅ -0.06%
public_kernel_app_logic -1,182 ✅ -0.40% -1,182 ✅ -0.06%
public_kernel_teardown -1,341 ✅ -0.45% -1,341 ✅ -0.07%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
private_kernel_reset 241,966 (0) 0.00% 2,546,190 (+128) +0.01%
private_kernel_reset_big 178,779 (0) 0.00% 1,701,907 (+64) +0.00%
private_kernel_reset_medium 147,187 (0) 0.00% 1,279,767 (+32) +0.00%
private_kernel_reset_small 131,390 (0) 0.00% 1,068,696 (+16) +0.00%
parity_base 346 (-1) -0.29% 79,811 (0) 0.00%
parity_root 2,139 (-1) -0.05% 1,129,295 (-1) -0.00%
rollup_base 191,347 (-2) -0.00% 2,143,101 (-2) -0.00%
rollup_merge 1,315 (-4) -0.30% 601,662 (-4) -0.00%
public_kernel_tail 983,065 (-70) -0.01% 4,475,573 (-70) -0.00%
private_kernel_tail_to_public 455,774 (-965) -0.21% 2,036,774 (-965) -0.05%
public_kernel_setup 244,113 (-981) -0.40% 1,650,853 (-981) -0.06%
public_kernel_app_logic 294,951 (-1,182) -0.40% 1,847,978 (-1,182) -0.06%
public_kernel_teardown 295,149 (-1,341) -0.45% 1,848,217 (-1,341) -0.07%

@TomAFrench
Copy link
Member

@guipublic fyi regression_5045 is failing to prove/verify in bb.

@Maddiaa0 Maddiaa0 enabled auto-merge (squash) June 6, 2024 11:14
@AztecBot
Copy link
Collaborator Author

AztecBot commented Jun 6, 2024

Benchmark results

Metrics with a significant change:

  • proof_construction_time_poseidon_hash_30_ms (1): 1,819 (+20%)
  • batch_insert_into_append_only_tree_32_depth_ms (1024): 730 (+55%)
  • batch_insert_into_append_only_tree_32_depth_hash_ms (1024): 0.683 (+55%)
  • protocol_circuit_witness_generation_time_in_ms (private-kernel-tail): 1,781 (-18%)
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 6,113 (+7%) 1,549 738 (+4%) 762 (+1%) 772
proof_construction_time_sha256_30_ms 13,237 (+12%) 3,177 (+1%) 1,443 (+3%) 1,454 (+2%) 1,473
proof_construction_time_sha256_100_ms 47,235 (+6%) 12,113 (+1%) 5,713 (+1%) 5,609 (+1%) 5,619 (+2%)
proof_construction_time_poseidon_hash_ms 77.0 (-1%) 34.0 35.0 (+3%) 58.0 (+2%) 87.0
proof_construction_time_poseidon_hash_30_ms ⚠️ 1,819 (+20%) 417 201 (+1%) 233 (+4%) 263
proof_construction_time_poseidon_hash_100_ms 5,722 1,576 745 (+2%) 776 (-2%) 792 (-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 1,412 1,412 1,412
l1_rollup_calldata_gas 9,464 9,452 9,440
l1_rollup_execution_gas 610,285 610,273 610,261
l2_block_processing_time_in_ms 716 (+3%) 1,284 (-1%) 2,720 (+11%)
l2_block_building_time_in_ms 24,737 (+12%) 46,225 (+2%) 92,311 (+6%)
l2_block_rollup_simulation_time_in_ms 24,626 (+12%) 45,876 (+2%) 91,917 (+6%)
l2_block_public_tx_process_time_in_ms 21,449 (+13%) 42,394 (+2%) 88,634 (+6%)

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 5,918 (-1%) 8,504 (-1%)
node_database_size_in_bytes 9,494,608 12,718,160
pxe_database_size_in_bytes 9,242 15,127

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 proving_time_in_ms input_size_in_bytes output_size_in_bytes proof_size_in_bytes num_public_inputs size_in_gates
private-kernel-init 138 (+2%) 467 13,166 (+1%) 20,634 64,614 89,536 2,731 524,288
private-kernel-inner 398 (-2%) 1,022 (-11%) 49,113 92,326 64,614 89,536 2,731 2,097,152
private-kernel-tail 371 (+1%) ⚠️ 1,781 (-18%) 44,667 (-5%) 96,545 68,261 11,648 297 2,097,152
base-parity 6.45 (-1%) 1,664 (-2%) 2,624 128 64.0 2,208 2.00 131,072
root-parity 49.4 (+1%) 62.7 (-2%) 42,087 (+4%) 27,100 64.0 2,720 18.0 2,097,152
base-rollup 6,664 (+4%) 2,396 83,887 (+3%) 119,738 756 3,648 47.0 4,194,304
root-rollup 110 78.4 (+6%) 24,412 (+4%) 25,309 620 3,456 41.0 1,048,576
public-kernel-app-logic 579 (+3%) 3,489 45,526 (-1%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-tail 1,156 (+2%) 24,753 (+3%) 179,858 (-5%) 403,238 7,646 11,648 297 8,388,608
private-kernel-reset-small 603 (+3%) 2,043 (-3%) 46,766 120,737 64,614 89,536 2,731 2,097,152
public-kernel-setup 661 (-1%) 2,719 (-1%) 42,312 (-5%) 108,073 86,550 116,768 3,582 2,097,152
public-kernel-teardown 566 3,504 (-1%) 44,976 (-1%) 108,073 86,550 116,768 3,582 2,097,152
merge-rollup 30.2 (+4%) N/A N/A 16,542 756 N/A N/A N/A
private-kernel-tail-to-public N/A 6,907 (+3%) 54,046 (+3%) N/A N/A 116,768 3,582 2,097,152

Stats on running time collected for app circuits

Function input_size_in_bytes output_size_in_bytes witness_generation_time_in_ms proof_size_in_bytes proving_time_in_ms size_in_gates num_public_inputs
ContractClassRegisterer:register 1,344 9,944 467 (+1%) N/A N/A N/A N/A
ContractInstanceDeployer:deploy 1,408 9,944 40.6 (-1%) N/A N/A N/A N/A
MultiCallEntrypoint:entrypoint 1,920 9,944 1,784 (+2%) N/A N/A N/A N/A
SchnorrAccount:constructor 1,312 9,944 1,429 (+1%) N/A N/A N/A N/A
SchnorrAccount:entrypoint 2,304 9,944 2,859 (+2%) 16,768 53,990 (-2%) 2,097,152 457
Token:privately_mint_private_note 1,280 9,944 1,553 (-1%) N/A N/A N/A N/A
FPC:fee_entrypoint_public 1,344 9,944 1,035 16,768 10,917 (+1%) 524,288 457
Token:transfer 1,376 9,944 5,282 16,768 53,170 (+1%) 2,097,152 457
Benchmarking:create_note 1,344 9,944 1,422 (+2%) N/A N/A N/A N/A
SchnorrAccount:spend_private_authwit 1,280 9,944 76.5 (-1%) N/A N/A N/A N/A
Token:unshield 1,376 9,944 3,905 N/A N/A N/A N/A
FPC:fee_entrypoint_private 1,376 9,944 4,823 (-3%) N/A N/A N/A N/A

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 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 11.1 (+7%) 17.7 (+5%) N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.644 (+7%) 0.544 (+5%) 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 50.0 (+3%) 95.6 (+25%) 133 246 (-1%) ⚠️ 730 (+55%) N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 288 543 1,055 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.510 (+3%) 0.590 (+25%) 0.456 0.446 (-1%) ⚠️ 0.683 (+55%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 61.8 (+4%) 138 (+22%) 185 (+1%) 354 (-1%) 700 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 108 208 355 691 1,363 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.526 (+4%) 0.622 (+23%) 0.490 (+1%) 0.480 (-1%) 0.480 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A 61.8 (+3%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A 103
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A 0.573 (+4%)

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 79,470 665,267

Transaction size based on fee payment method

| Metric | |
| - | |

@Maddiaa0 Maddiaa0 merged commit a44b8c8 into master Jun 6, 2024
89 checks passed
@Maddiaa0 Maddiaa0 deleted the sync-noir branch June 6, 2024 12:12
@@ -137,7 +137,7 @@ describe('e2e_fees private_payment', () => {
* TODO(6583): update this comment properly now that public execution consumes gas
*/

expect(tx.transactionFee).toEqual(200036352n);
expect(tx.transactionFee).toEqual(200032492n);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these exact fee asserts a good idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

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

6 participants