chore!: Use msgpack-compact format by default#7810
Conversation
msgpack format by defaultmsgpack format by default
Adds `msgpack` serialisation to the generated Acir and Witness C++ code. I moved the alterations described in `dsl/README.md` into the code generation itself, so no manual work is required. The PR is running against a feature branch with the same name in Noir, here's the upstream PR: noir-lang/noir#7716 With this PR is merged, `bb` should be able to handle `msgpack` or `bincode`. Once that's released we can switch to using `msgpack` in Noir in both native and wasm by merging noir-lang/noir#7810. And then we can remove the `msgpack` format detection and the fallback to `bincode`. **TODO**: - [x] Get it to compile - [x] Change `nargo` to allow compiling contracts with `msgpack` format: added `NOIR_SERIALIZATION_FORMAT` env var - [x] Add a first byte to the data to say which serialization format it is. There is a chance that it would clash with existing bincode data though, so a fallback would anyway be necessary. (Or we should ascertain that bincode never starts with some specific bit sequence). - [x] ~Change the `bb` code so it tries `bincode`, then falls back to `msgpack` - this way the currently used format stays fast, but we can feed it new data.~ _This looks problematic, as exceptions in the wasm build is disabled in `arch.cmake` and `throw_or_abort` aborts in wasm. Instead we run [msgpack::parse](https://c.msgpack.org/cpp/namespacemsgpack.html#ad844d148ad1ff6c9193b02529fe32968) first to check if the data looks like msgpack; if not, we use bincode._ - [x] Run integration tests with `msgpack` on both sides in #13021 - [x] Ignore the Brillig opcodes in Barretenberg - [x] Change the serialization of `WitnessStack` and `WitnessMap` to use the env var, add fallbacks in `bb` for them - [x] Revert the change to `noir-repo-ref` before merging ### Use of `MSGPACK_FIELDS` The generated code is using `MSGPACK_FIELDS` for structs, to keep it more terse. At some point during debugging the memory issue below I changed it so that I can have more direct control by generating code for individual fields. That needed some helper functions which I looted from the `msgpack-c` library and injected into the namespaces as a `Helpers` struct. This approach might be useful if we wanted to have extra checks, for example rejecting the data if there are extra fields, indicating a type has been extended with things we don't recognise, or if we wanted handle renamed fields. I left it out so there is less code to maintain, but if we need it we can recover it from the [commit history](noir-lang/noir@b0a612d). ### Compile `nargo` with the `msgpack` feature ```bash echo af/msgpack-codegen > noir/noir-repo-ref noir/bootstrap.sh ``` ### Generate and compile C++ code ```bash cd noir/noir-repo && NOIR_CODEGEN_OVERWRITE=1 cargo test -p acir cpp_codegen && cd - cp noir/noir-repo/acvm-repo/acir/codegen/acir.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp cp noir/noir-repo/acvm-repo/acir/codegen/witness.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/witness_stack.hpp cd barretenberg/cpp && ./format.sh changed && cd - barretenberg/cpp/bootstrap.sh ``` ### Test `nargo` with `bb` One example of an integration test that uses `bb` and noir in the Noir repo is https://github.com/noir-lang/noir/actions/runs/13631231158/job/38099477964 We can call it like this: ```bash cd noir/noir-repo && cargo install --path tooling/nargo_cli && cd - ./barretenberg/cpp/bootstrap.sh export BACKEND=$(pwd)/barretenberg/cpp/build/bin/bb export NOIR_SERIALIZATION_FORMAT=msgpack noir/noir-repo/examples/prove_and_verify/test.sh ``` If it works, it should print this: ```console % unset NOIR_SERIALIZATION_FORMAT % noir/noir-repo/examples/prove_and_verify/test.sh [hello_world] Circuit witness successfully solved [hello_world] Witness saved to /mnt/user-data/akosh/aztec-packages/noir/noir-repo/examples/prove_and_verify/target/witness.gz Finalized circuit size: 18 Proof saved to "./proofs/proof" Finalized circuit size: 18 VK saved to "./target/vk" Proof verified successfully ``` Whereas if it doesn't: ```console % export NOIR_SERIALIZATION_FORMAT=msgpack % noir/noir-repo/examples/prove_and_verify/test.sh [hello_world] Circuit witness successfully solved [hello_world] Witness saved to /mnt/user-data/akosh/aztec-packages/noir/noir-repo/examples/prove_and_verify/target/witness.gz Length is too large ``` I attached the final artefacts to the PR so it's easier to test with just `bb`. [hello_world.json](https://github.com/user-attachments/files/19391072/hello_world.json) [witness.gz](https://github.com/user-attachments/files/19391074/witness.gz) ### Further testing With the `noir-repo-ref` pointing at the feature `af/msgpack-codegen` feature branch, we can run all the contract compilations and tests with `msgpack` as follows: ```shell export NOIR_SERIALIZATION_FORMAT=msgpack ./bootstrap.sh ci ``` This is tested in #13021 ### Peek into artefacts We can inspect the file in JSON format using [this](https://crates.io/crates/msgpack-cli) msgpack CLI tool. ```shell jq -r '.bytecode' ./target/program.json | base64 --decode | gunzip | tail -c +2 | mpk --to-json | jq ``` Thanks Tom for the [spell](AztecProtocol/msgpack-c#5 (comment)) 🙏 ### False bug At some point I thought had to make some fixes in `msgpack-c` itself to make this work: AztecProtocol/msgpack-c#5 A similar [blocking bug](#12841 (comment)) was encountered when running the entire `ci` build with msgpack format. It turned out it was a [dangling pointer](msgpack/msgpack-c#695 (comment)) issue, fixed in 5810e3b Much of the comments below are related to my struggles that came from this mistake; you can ignore them.
Adds `msgpack` serialisation to the generated Acir and Witness C++ code. I moved the alterations described in `dsl/README.md` into the code generation itself, so no manual work is required. The PR is running against a feature branch with the same name in Noir, here's the upstream PR: noir-lang/noir#7716 With this PR is merged, `bb` should be able to handle `msgpack` or `bincode`. Once that's released we can switch to using `msgpack` in Noir in both native and wasm by merging noir-lang/noir#7810. And then we can remove the `msgpack` format detection and the fallback to `bincode`. **TODO**: - [x] Get it to compile - [x] Change `nargo` to allow compiling contracts with `msgpack` format: added `NOIR_SERIALIZATION_FORMAT` env var - [x] Add a first byte to the data to say which serialization format it is. There is a chance that it would clash with existing bincode data though, so a fallback would anyway be necessary. (Or we should ascertain that bincode never starts with some specific bit sequence). - [x] ~Change the `bb` code so it tries `bincode`, then falls back to `msgpack` - this way the currently used format stays fast, but we can feed it new data.~ _This looks problematic, as exceptions in the wasm build is disabled in `arch.cmake` and `throw_or_abort` aborts in wasm. Instead we run [msgpack::parse](https://c.msgpack.org/cpp/namespacemsgpack.html#ad844d148ad1ff6c9193b02529fe32968) first to check if the data looks like msgpack; if not, we use bincode._ - [x] Run integration tests with `msgpack` on both sides in AztecProtocol/aztec-packages#13021 - [x] Ignore the Brillig opcodes in Barretenberg - [x] Change the serialization of `WitnessStack` and `WitnessMap` to use the env var, add fallbacks in `bb` for them - [x] Revert the change to `noir-repo-ref` before merging ### Use of `MSGPACK_FIELDS` The generated code is using `MSGPACK_FIELDS` for structs, to keep it more terse. At some point during debugging the memory issue below I changed it so that I can have more direct control by generating code for individual fields. That needed some helper functions which I looted from the `msgpack-c` library and injected into the namespaces as a `Helpers` struct. This approach might be useful if we wanted to have extra checks, for example rejecting the data if there are extra fields, indicating a type has been extended with things we don't recognise, or if we wanted handle renamed fields. I left it out so there is less code to maintain, but if we need it we can recover it from the [commit history](noir-lang/noir@b0a612d). ### Compile `nargo` with the `msgpack` feature ```bash echo af/msgpack-codegen > noir/noir-repo-ref noir/bootstrap.sh ``` ### Generate and compile C++ code ```bash cd noir/noir-repo && NOIR_CODEGEN_OVERWRITE=1 cargo test -p acir cpp_codegen && cd - cp noir/noir-repo/acvm-repo/acir/codegen/acir.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp cp noir/noir-repo/acvm-repo/acir/codegen/witness.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/witness_stack.hpp cd barretenberg/cpp && ./format.sh changed && cd - barretenberg/cpp/bootstrap.sh ``` ### Test `nargo` with `bb` One example of an integration test that uses `bb` and noir in the Noir repo is https://github.com/noir-lang/noir/actions/runs/13631231158/job/38099477964 We can call it like this: ```bash cd noir/noir-repo && cargo install --path tooling/nargo_cli && cd - ./barretenberg/cpp/bootstrap.sh export BACKEND=$(pwd)/barretenberg/cpp/build/bin/bb export NOIR_SERIALIZATION_FORMAT=msgpack noir/noir-repo/examples/prove_and_verify/test.sh ``` If it works, it should print this: ```console % unset NOIR_SERIALIZATION_FORMAT % noir/noir-repo/examples/prove_and_verify/test.sh [hello_world] Circuit witness successfully solved [hello_world] Witness saved to /mnt/user-data/akosh/aztec-packages/noir/noir-repo/examples/prove_and_verify/target/witness.gz Finalized circuit size: 18 Proof saved to "./proofs/proof" Finalized circuit size: 18 VK saved to "./target/vk" Proof verified successfully ``` Whereas if it doesn't: ```console % export NOIR_SERIALIZATION_FORMAT=msgpack % noir/noir-repo/examples/prove_and_verify/test.sh [hello_world] Circuit witness successfully solved [hello_world] Witness saved to /mnt/user-data/akosh/aztec-packages/noir/noir-repo/examples/prove_and_verify/target/witness.gz Length is too large ``` I attached the final artefacts to the PR so it's easier to test with just `bb`. [hello_world.json](https://github.com/user-attachments/files/19391072/hello_world.json) [witness.gz](https://github.com/user-attachments/files/19391074/witness.gz) ### Further testing With the `noir-repo-ref` pointing at the feature `af/msgpack-codegen` feature branch, we can run all the contract compilations and tests with `msgpack` as follows: ```shell export NOIR_SERIALIZATION_FORMAT=msgpack ./bootstrap.sh ci ``` This is tested in AztecProtocol/aztec-packages#13021 ### Peek into artefacts We can inspect the file in JSON format using [this](https://crates.io/crates/msgpack-cli) msgpack CLI tool. ```shell jq -r '.bytecode' ./target/program.json | base64 --decode | gunzip | tail -c +2 | mpk --to-json | jq ``` Thanks Tom for the [spell](AztecProtocol/msgpack-c#5 (comment)) 🙏 ### False bug At some point I thought had to make some fixes in `msgpack-c` itself to make this work: AztecProtocol/msgpack-c#5 A similar [blocking bug](AztecProtocol/aztec-packages#12841 (comment)) was encountered when running the entire `ci` build with msgpack format. It turned out it was a [dangling pointer](msgpack/msgpack-c#695 (comment)) issue, fixed in AztecProtocol/aztec-packages@5810e3b Much of the comments below are related to my struggles that came from this mistake; you can ignore them.
471822d to
3d59c68
Compare
9654758 to
4400174
Compare
There was a problem hiding this comment.
⚠️ 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: a3d1cb8 | Previous: 181f3c2 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir_rsa_ |
2 s |
1 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
4400174 to
3625ab7
Compare
msgpack format by defaultmsgpack format by default
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
rollup-block-root-single-tx |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
msgpack format by defaultmsgpack-compact format by default
There was a problem hiding this comment.
ACVM Benchmarks
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
purely_sequential_opcodes |
252540 ns/iter (± 474) |
256590 ns/iter (± 627) |
0.98 |
perfectly_parallel_opcodes |
221298 ns/iter (± 3127) |
232443 ns/iter (± 2166) |
0.95 |
perfectly_parallel_batch_inversion_opcodes |
2793592 ns/iter (± 1257) |
2262216 ns/iter (± 3305) |
1.23 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Test Suite Duration
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
test_report_AztecProtocol_aztec-packages_noir-projects_aztec-nr |
157 s |
154 s |
1.02 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-contracts |
164 s |
165 s |
0.99 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob |
168 s |
178 s |
0.94 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_private-kernel-lib |
365 s |
368 s |
0.99 |
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_types |
138 s |
141 s |
0.98 |
test_report_noir-lang_noir-bignum_ |
170 s |
173 s |
0.98 |
test_report_noir-lang_noir_bigcurve_ |
297 s |
288 s |
1.03 |
test_report_noir-lang_sha256_ |
17 s |
17 s |
1 |
test_report_noir-lang_sha512_ |
14 s |
15 s |
0.93 |
test_report_zkpassport_noir-ecdsa_ |
1 s |
2 s |
0.50 |
test_report_zkpassport_noir_rsa_ |
0 s |
2 s |
0 |
This comment was automatically generated by workflow using github-action-benchmark.
|
FYI @noir-lang/developerrelations on Noir doc changes. |
There was a problem hiding this comment.
Brillig Compilation Time
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
1.204 s |
1.194 s |
1.01 |
private-kernel-reset |
1.264 s |
1.248 s |
1.01 |
private-kernel-tail |
1.054 s |
1.05 s |
1.00 |
rollup-block-root-first-empty-tx |
1.358 s |
1.438 s |
0.94 |
rollup-block-root-single-tx |
1.36 s |
1.4 s |
0.97 |
rollup-block-root |
1.4 s |
1.43 s |
0.98 |
rollup-checkpoint-merge |
1.384 s |
1.364 s |
1.01 |
rollup-checkpoint-root-single-block |
1.92 s |
1.84 s |
1.04 |
rollup-checkpoint-root |
1.91 s |
1.89 s |
1.01 |
rollup-root |
1.402 s |
1.468 s |
0.96 |
rollup-tx-base-private |
1.544 s |
1.614 s |
0.96 |
rollup-tx-base-public |
1.612 s |
1.644 s |
0.98 |
rollup-tx-merge |
1.338 s |
1.356 s |
0.99 |
semaphore-depth-10 |
0.231 s |
0.25 s |
0.92 |
sha512-100-bytes |
0.199 s |
0.197 s |
1.01 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Opcode count
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
20088 opcodes |
20088 opcodes |
1 |
private-kernel-reset |
80496 opcodes |
80496 opcodes |
1 |
private-kernel-tail |
8554 opcodes |
8554 opcodes |
1 |
rollup-block-root-first-empty-tx |
1083 opcodes |
1083 opcodes |
1 |
rollup-block-root-single-tx |
968 opcodes |
968 opcodes |
1 |
rollup-block-root |
2170 opcodes |
2170 opcodes |
1 |
rollup-checkpoint-merge |
2127 opcodes |
2127 opcodes |
1 |
rollup-checkpoint-root-single-block |
1819690 opcodes |
1819690 opcodes |
1 |
rollup-checkpoint-root |
1820888 opcodes |
1820888 opcodes |
1 |
rollup-root |
2589 opcodes |
2589 opcodes |
1 |
rollup-tx-base-private |
302299 opcodes |
302299 opcodes |
1 |
rollup-tx-base-public |
258045 opcodes |
258045 opcodes |
1 |
rollup-tx-merge |
1302 opcodes |
1302 opcodes |
1 |
semaphore-depth-10 |
5699 opcodes |
5699 opcodes |
1 |
sha512-100-bytes |
13173 opcodes |
13173 opcodes |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Brillig Artifact Size
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
643.7 KB |
637.7 KB |
1.01 |
private-kernel-reset |
689.2 KB |
668.8 KB |
1.03 |
private-kernel-tail |
291.5 KB |
289.6 KB |
1.01 |
rollup-block-root-first-empty-tx |
238.9 KB |
240.3 KB |
0.99 |
rollup-block-root-single-tx |
238 KB |
239.2 KB |
0.99 |
rollup-block-root |
290.6 KB |
291.5 KB |
1.00 |
rollup-checkpoint-merge |
256.2 KB |
256.4 KB |
1.00 |
rollup-checkpoint-root-single-block |
518.4 KB |
470.2 KB |
1.10 |
rollup-checkpoint-root |
557.6 KB |
508.2 KB |
1.10 |
rollup-root |
403.1 KB |
404.9 KB |
1.00 |
rollup-tx-base-private |
630.8 KB |
620.6 KB |
1.02 |
rollup-tx-base-public |
745.3 KB |
694.3 KB |
1.07 |
rollup-tx-merge |
186 KB |
185.9 KB |
1.00 |
semaphore-depth-10 |
2068.7 KB |
2069.9 KB |
1.00 |
sha512-100-bytes |
162 KB |
164.1 KB |
0.99 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Compilation Time
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
2.324 s |
2.446 s |
0.95 |
private-kernel-reset |
8.718 s |
8.478 s |
1.03 |
private-kernel-tail |
2.548 s |
2.546 s |
1.00 |
rollup-block-root-first-empty-tx |
1.414 s |
1.516 s |
0.93 |
rollup-block-root-single-tx |
1.39 s |
1.44 s |
0.97 |
rollup-block-root |
1.49 s |
1.51 s |
0.99 |
rollup-checkpoint-merge |
1.47 s |
1.506 s |
0.98 |
rollup-checkpoint-root-single-block |
423 s |
398 s |
1.06 |
rollup-checkpoint-root |
392 s |
391 s |
1.00 |
rollup-root |
1.518 s |
1.594 s |
0.95 |
rollup-tx-base-private |
22.02 s |
22.76 s |
0.97 |
rollup-tx-base-public |
83.76 s |
84.64 s |
0.99 |
rollup-tx-merge |
1.39 s |
1.398 s |
0.99 |
semaphore-depth-10 |
0.916 s |
0.973 s |
0.94 |
sha512-100-bytes |
1.658 s |
1.633 s |
1.02 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Execution Time
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
0.047 s |
0.047 s |
1 |
private-kernel-reset |
0.208 s |
0.209 s |
1.00 |
private-kernel-tail |
0.008 s |
0.008 s |
1 |
rollup-block-root-first-empty-tx |
0.003 s |
0.003 s |
1 |
rollup-block-root-single-tx |
0.003 s |
0.002 s |
1.50 |
rollup-block-root |
0.004 s |
0.004 s |
1 |
rollup-checkpoint-merge |
0.003 s |
0.003 s |
1 |
rollup-checkpoint-root-single-block |
26.2 s |
28 s |
0.94 |
rollup-checkpoint-root |
26.1 s |
28.3 s |
0.92 |
rollup-root |
0.004 s |
0.004 s |
1 |
rollup-tx-base-private |
0.335 s |
0.333 s |
1.01 |
rollup-tx-base-public |
0.257 s |
0.265 s |
0.97 |
rollup-tx-merge |
0.002 s |
0.002 s |
1 |
semaphore-depth-10 |
0.009 s |
0.009 s |
1 |
sha512-100-bytes |
0.081 s |
0.095 s |
0.85 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Brillig Execution Time
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
0.036 s |
0.037 s |
0.97 |
private-kernel-reset |
0.092 s |
0.095 s |
0.97 |
private-kernel-tail |
0.005 s |
0.005 s |
1 |
rollup-block-root-first-empty-tx |
0.004 s |
0.004 s |
1 |
rollup-block-root-single-tx |
0.003 s |
0.003 s |
1 |
rollup-block-root |
0.003 s |
0.003 s |
1 |
rollup-checkpoint-merge |
0.002 s |
0.002 s |
1 |
rollup-root |
0.002 s |
0.002 s |
1 |
rollup-tx-base-private |
0.037 s |
0.037 s |
1 |
rollup-tx-base-public |
0.046 s |
0.043 s |
1.07 |
rollup-tx-merge |
0.002 s |
0.002 s |
1 |
semaphore-depth-10 |
0.023 s |
0.027 s |
0.85 |
sha512-100-bytes |
0.016 s |
0.016 s |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Artifact Size
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
911.2 KB |
889.3 KB |
1.02 |
private-kernel-reset |
2070.4 KB |
2052.5 KB |
1.01 |
private-kernel-tail |
467.1 KB |
457.9 KB |
1.02 |
rollup-block-root-first-empty-tx |
214.3 KB |
214.8 KB |
1.00 |
rollup-block-root-single-tx |
217.7 KB |
218 KB |
1.00 |
rollup-block-root |
286 KB |
286.5 KB |
1.00 |
rollup-checkpoint-merge |
369.6 KB |
369.7 KB |
1.00 |
rollup-checkpoint-root-single-block |
48351.8 KB |
49420.5 KB |
0.98 |
rollup-checkpoint-root |
48418.9 KB |
49450.4 KB |
0.98 |
rollup-root |
397.8 KB |
399.4 KB |
1.00 |
rollup-tx-base-private |
5432.6 KB |
5589.4 KB |
0.97 |
rollup-tx-base-public |
4729.1 KB |
4827.5 KB |
0.98 |
rollup-tx-merge |
168.3 KB |
167.9 KB |
1.00 |
semaphore-depth-10 |
551.2 KB |
570.9 KB |
0.97 |
sha512-100-bytes |
474 KB |
506.3 KB |
0.94 |
This comment was automatically generated by workflow using github-action-benchmark.
msgpack-compact format by defaultmsgpack-compact format by default
There was a problem hiding this comment.
Compilation Memory
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
284.93 MB |
284.93 MB |
1 |
private-kernel-reset |
509.54 MB |
509.54 MB |
1 |
private-kernel-tail |
257.87 MB |
257.86 MB |
1.00 |
rollup-block-root-first-empty-tx |
336.81 MB |
336.81 MB |
1 |
rollup-block-root-single-tx |
335.24 MB |
335.25 MB |
1.00 |
rollup-block-root |
337.8 MB |
337.8 MB |
1 |
rollup-checkpoint-merge |
338.13 MB |
338.13 MB |
1 |
rollup-checkpoint-root-single-block |
11280 MB |
11280 MB |
1 |
rollup-checkpoint-root |
11290 MB |
11290 MB |
1 |
rollup-root |
339.51 MB |
339.51 MB |
1 |
rollup-tx-base-private |
1070 MB |
1070 MB |
1 |
rollup-tx-base-public |
3030 MB |
3030 MB |
1 |
rollup-tx-merge |
334.39 MB |
334.39 MB |
1 |
semaphore_depth_10 |
97.86 MB |
97.86 MB |
1 |
sha512_100_bytes |
185.63 MB |
185.76 MB |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Execution Memory
Details
| Benchmark suite | Current: 90aa4cb | Previous: 79e93d8 | Ratio |
|---|---|---|---|
private-kernel-inner |
269.05 MB |
269.05 MB |
1 |
private-kernel-reset |
304.88 MB |
304.88 MB |
1 |
private-kernel-tail |
256.39 MB |
256.39 MB |
1 |
rollup-block-root |
335.8 MB |
335.8 MB |
1 |
rollup-checkpoint-merge |
334.77 MB |
334.77 MB |
1 |
rollup-checkpoint-root-single-block |
1750 MB |
1750 MB |
1 |
rollup-checkpoint-root |
1750 MB |
1750 MB |
1 |
rollup-root |
335.93 MB |
335.93 MB |
1 |
rollup-tx-base-private |
523.53 MB |
523.53 MB |
1 |
rollup-tx-base-public |
464.68 MB |
464.68 MB |
1 |
rollup-tx-merge |
333.87 MB |
333.87 MB |
1 |
semaphore_depth_10 |
74.01 MB |
74.01 MB |
1 |
sha512_100_bytes |
72.08 MB |
72.08 MB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
Description
Problem*
Need to test
bbwithmsgpackused in all tests in AztecProtocol/aztec-packages#13021 , but if we use theNOIR_SERIALIZATION_FORMATenv var to achieve it then some Noir unit tests that use hardcodedbincodedata as expectations fail.Builds on #7716
Incorporates #10928
Summary*
Updates
Program,WitnesStackandWitnessMapin theacirmodule to usemsgpackserialization by default. To be able to still go back tobincodeas it is today, I added a"bincode-legacy"format, which is a special format that is not indicated by the first byte of the, unlike the"bincode"format which does appear with value 1.This PR can later be merged when AztecProtocol/aztec-packages#13021 indicates that
bbwill be able to handle it. Until that version ofbbis released, the JavaScript tests in this PR will fail.When this PR was tested against BB version
3.0.0-nightly.20251104it worked, however thenextversion currently raises an exception if it detect msgpack, so it doesn't need to be audited; this would need to be removed when we update BB to use a version of nargo with this PR merged.Adam pointed us at https://github.com/AztecProtocol/aztec-packages/releases/tag/v3.0.0-nightly.20251216
This version returned new errors for a certain categories of circuits in
gates_report.sh:call_datain them:#[fold]:I added the artefacts to the ignore list, but let me know if we should instead configure
bbwith some CLI arg to make it work.Additional Context
Slightly changes the
NOIR_SERIALIZATION_FORMAT:msgpackby defaultbincode-legacy, it'sbincodewithout a format bytebincode, it'sbincodewith the format byteThis was necessary so that we do
msgpackby default, but we can still ask for the legacy format if we really want to. Note that at the moment Barretenberg only looks forbincode-legacyormsgpack.Another important point is that env vars are not detected in Wasm, so if JS is involved, it's going to be serialising data with msgpack, but it should be able to deserialise any format, based on the detection of the format byte, or falling back to bincode.
Updates the msgpack format to use
ByteMode::ForceIterables, otherwisebbcannot read the data and we get an error like this:It looks like it doesn't like
std::vector<uint8_t>as a sequence of variable length integers, but rather wants them to bebytes.Also updated the Rust API a little bit to make it easier to test both the legacy and the new default format.
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.