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(avm): Indirect memory support for arithmetic/bitwise opcodes #5328

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

jeanmon
Copy link
Contributor

@jeanmon jeanmon commented Mar 20, 2024

Resolves #5273

@jeanmon jeanmon force-pushed the jm/5273-indirect-mem-other-opcodes branch from e876ad8 to 4575e28 Compare March 20, 2024 11:10
@jeanmon jeanmon marked this pull request as ready for review March 20, 2024 11:10
@AztecBot
Copy link
Collaborator

Benchmark results

Metrics with a significant change:

  • note_trial_decrypting_time_in_ms (64): 106 (+80%)
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 5f0f4fca 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 66,364 239,128 469,784
l1_rollup_execution_gas 647,462 929,486 1,305,964
l2_block_processing_time_in_ms 1,256 (-8%) 4,711 (-4%) 9,489 (-1%)
note_successful_decrypting_time_in_ms 171 (+1%) 514 975 (-5%)
note_trial_decrypting_time_in_ms 73.3 (-4%) 32.7 (-4%) ⚠️ 106 (+80%)
l2_block_building_time_in_ms 18,202 (-1%) 68,844 (-1%) 136,790
l2_block_rollup_simulation_time_in_ms 8,031 (-2%) 28,583 (-5%) 56,335 (-1%)
l2_block_public_tx_process_time_in_ms 10,150 (+1%) 40,200 (+1%) 80,359 (+1%)

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 14,842 (+3%) 28,479 (+7%)
note_history_successful_decrypting_time_in_ms 1,287 (+6%) 2,556 (+4%)
note_history_trial_decrypting_time_in_ms 101 (+60%) 200 (+20%)
node_database_size_in_bytes 18,624,592 35,098,704
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 279 (-1%) 44,366 28,244
private-kernel-ordering 216 (+1%) 52,868 14,326
base-parity 1,807 (-3%) 128 311
base-rollup 713 (-2%) 165,787 925
root-parity 1,538 (-4%) 1,244 311
root-rollup 52.1 4,487 725
private-kernel-inner 642 73,771 28,244
public-kernel-app-logic 443 35,260 28,215
public-kernel-tail 176 (+2%) 40,926 28,215
merge-rollup 8.36 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.97 (-1%) 15.9 (-1%) 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.581 0.493 (-1%) 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.8 71.9 (-1%) 229 (-1%) 445 874 1,715 (-2%) 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.470 0.444 (-1%) 0.419 (-1%) 0.416 0.415 0.411 (-1%) N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 54.2 (+1%) 107 335 (-1%) 673 1,311 (-2%) 2,605 (-1%) 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.483 (+1%) 0.482 0.456 (-1%) 0.464 0.455 (-1%) 0.453 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.2
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.536

Miscellaneous

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

Metric 0 registered classes
tx_size_in_bytes 22,012

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes
tx_pxe_processing_time_ms 3,248 (+1%) 1,749
Metric 0 public data writes 1 public data writes
tx_sequencer_processing_time_ms 11.6 (-15%) 1,240

@IlyasRidhuan IlyasRidhuan merged commit d5ffa17 into master Mar 20, 2024
98 checks passed
@IlyasRidhuan IlyasRidhuan deleted the jm/5273-indirect-mem-other-opcodes branch March 20, 2024 14:18
sirasistant pushed a commit that referenced this pull request Mar 20, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.30.1</summary>

##
[0.30.1](aztec-package-v0.30.0...aztec-package-v0.30.1)
(2024-03-20)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.30.1</summary>

##
[0.30.1](barretenberg.js-v0.30.0...barretenberg.js-v0.30.1)
(2024-03-20)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-cli: 0.30.1</summary>

##
[0.30.1](aztec-cli-v0.30.0...aztec-cli-v0.30.1)
(2024-03-20)


### Miscellaneous

* **aztec-cli:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.30.1</summary>

##
[0.30.1](aztec-packages-v0.30.0...aztec-packages-v0.30.1)
(2024-03-20)


### Features

* Add CMOV instruction to brillig and brillig gen
([#5308](#5308))
([208abbb](208abbb))
* **avm:** Indirect memory support for arithmetic/bitwise opcodes
([#5328](#5328))
([d5ffa17](d5ffa17)),
closes
[#5273](#5273)
* **avm:** Indirect memory support for MOV
([#5257](#5257))
([10ef970](10ef970)),
closes
[#5205](#5205)
* Merge SMT Terms in one class
([#5254](#5254))
([f5c9b0f](f5c9b0f))
* Sorted execution trace
([#5252](#5252))
([a216759](a216759))


### Bug Fixes

* Fix recursion tests and reinstate in CI
([#5300](#5300))
([96c6f21](96c6f21))
* Skip uniswap l1 tests
([#5334](#5334))
([7a56941](7a56941))
* Update smt_verification README.md
([#5332](#5332))
([46b15e3](46b15e3))


### Miscellaneous

* Avm team as generated codeowners
([#5325](#5325))
([06d2786](06d2786))
* No Translator composer
([#5202](#5202))
([c8897ca](c8897ca))
* Remove toy vm files
([#5326](#5326))
([d940356](d940356))
* Replace relative paths to noir-protocol-circuits
([ea2ac09](ea2ac09))
</details>

<details><summary>barretenberg: 0.30.1</summary>

##
[0.30.1](barretenberg-v0.30.0...barretenberg-v0.30.1)
(2024-03-20)


### Features

* Add CMOV instruction to brillig and brillig gen
([#5308](#5308))
([208abbb](208abbb))
* **avm:** Indirect memory support for arithmetic/bitwise opcodes
([#5328](#5328))
([d5ffa17](d5ffa17)),
closes
[#5273](#5273)
* **avm:** Indirect memory support for MOV
([#5257](#5257))
([10ef970](10ef970)),
closes
[#5205](#5205)
* Merge SMT Terms in one class
([#5254](#5254))
([f5c9b0f](f5c9b0f))
* Sorted execution trace
([#5252](#5252))
([a216759](a216759))


### Bug Fixes

* Fix recursion tests and reinstate in CI
([#5300](#5300))
([96c6f21](96c6f21))
* Update smt_verification README.md
([#5332](#5332))
([46b15e3](46b15e3))


### Miscellaneous

* No Translator composer
([#5202](#5202))
([c8897ca](c8897ca))
* Remove toy vm files
([#5326](#5326))
([d940356](d940356))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request Mar 21, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.30.1</summary>

##
[0.30.1](AztecProtocol/aztec-packages@aztec-package-v0.30.0...aztec-package-v0.30.1)
(2024-03-20)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.30.1</summary>

##
[0.30.1](AztecProtocol/aztec-packages@barretenberg.js-v0.30.0...barretenberg.js-v0.30.1)
(2024-03-20)


### Miscellaneous

* **barretenberg.js:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-cli: 0.30.1</summary>

##
[0.30.1](AztecProtocol/aztec-packages@aztec-cli-v0.30.0...aztec-cli-v0.30.1)
(2024-03-20)


### Miscellaneous

* **aztec-cli:** Synchronize aztec-packages versions
</details>

<details><summary>aztec-packages: 0.30.1</summary>

##
[0.30.1](AztecProtocol/aztec-packages@aztec-packages-v0.30.0...aztec-packages-v0.30.1)
(2024-03-20)


### Features

* Add CMOV instruction to brillig and brillig gen
([#5308](AztecProtocol/aztec-packages#5308))
([208abbb](AztecProtocol/aztec-packages@208abbb))
* **avm:** Indirect memory support for arithmetic/bitwise opcodes
([#5328](AztecProtocol/aztec-packages#5328))
([d5ffa17](AztecProtocol/aztec-packages@d5ffa17)),
closes
[#5273](AztecProtocol/aztec-packages#5273)
* **avm:** Indirect memory support for MOV
([#5257](AztecProtocol/aztec-packages#5257))
([10ef970](AztecProtocol/aztec-packages@10ef970)),
closes
[#5205](AztecProtocol/aztec-packages#5205)
* Merge SMT Terms in one class
([#5254](AztecProtocol/aztec-packages#5254))
([f5c9b0f](AztecProtocol/aztec-packages@f5c9b0f))
* Sorted execution trace
([#5252](AztecProtocol/aztec-packages#5252))
([a216759](AztecProtocol/aztec-packages@a216759))


### Bug Fixes

* Fix recursion tests and reinstate in CI
([#5300](AztecProtocol/aztec-packages#5300))
([96c6f21](AztecProtocol/aztec-packages@96c6f21))
* Skip uniswap l1 tests
([#5334](AztecProtocol/aztec-packages#5334))
([7a56941](AztecProtocol/aztec-packages@7a56941))
* Update smt_verification README.md
([#5332](AztecProtocol/aztec-packages#5332))
([46b15e3](AztecProtocol/aztec-packages@46b15e3))


### Miscellaneous

* Avm team as generated codeowners
([#5325](AztecProtocol/aztec-packages#5325))
([06d2786](AztecProtocol/aztec-packages@06d2786))
* No Translator composer
([#5202](AztecProtocol/aztec-packages#5202))
([c8897ca](AztecProtocol/aztec-packages@c8897ca))
* Remove toy vm files
([#5326](AztecProtocol/aztec-packages#5326))
([d940356](AztecProtocol/aztec-packages@d940356))
* Replace relative paths to noir-protocol-circuits
([ea2ac09](AztecProtocol/aztec-packages@ea2ac09))
</details>

<details><summary>barretenberg: 0.30.1</summary>

##
[0.30.1](AztecProtocol/aztec-packages@barretenberg-v0.30.0...barretenberg-v0.30.1)
(2024-03-20)


### Features

* Add CMOV instruction to brillig and brillig gen
([#5308](AztecProtocol/aztec-packages#5308))
([208abbb](AztecProtocol/aztec-packages@208abbb))
* **avm:** Indirect memory support for arithmetic/bitwise opcodes
([#5328](AztecProtocol/aztec-packages#5328))
([d5ffa17](AztecProtocol/aztec-packages@d5ffa17)),
closes
[#5273](AztecProtocol/aztec-packages#5273)
* **avm:** Indirect memory support for MOV
([#5257](AztecProtocol/aztec-packages#5257))
([10ef970](AztecProtocol/aztec-packages@10ef970)),
closes
[#5205](AztecProtocol/aztec-packages#5205)
* Merge SMT Terms in one class
([#5254](AztecProtocol/aztec-packages#5254))
([f5c9b0f](AztecProtocol/aztec-packages@f5c9b0f))
* Sorted execution trace
([#5252](AztecProtocol/aztec-packages#5252))
([a216759](AztecProtocol/aztec-packages@a216759))


### Bug Fixes

* Fix recursion tests and reinstate in CI
([#5300](AztecProtocol/aztec-packages#5300))
([96c6f21](AztecProtocol/aztec-packages@96c6f21))
* Update smt_verification README.md
([#5332](AztecProtocol/aztec-packages#5332))
([46b15e3](AztecProtocol/aztec-packages@46b15e3))


### Miscellaneous

* No Translator composer
([#5202](AztecProtocol/aztec-packages#5202))
([c8897ca](AztecProtocol/aztec-packages@c8897ca))
* Remove toy vm files
([#5326](AztecProtocol/aztec-packages#5326))
([d940356](AztecProtocol/aztec-packages@d940356))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Indirect memory support: all current implemented opcodes
3 participants