chore(serialization): Disable the generation of C++ code for serialising ACIR#11139
chore(serialization): Disable the generation of C++ code for serialising ACIR#11139TomAFrench merged 6 commits intomasterfrom
Conversation
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: 3c7c9ec | Previous: 78a5445 | Ratio |
|---|---|---|---|
rollup-tx-merge |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
231bc4f to
fe76e28
Compare
TomAFrench
left a comment
There was a problem hiding this comment.
LGTM.
I'm happy to remove the non-compact msgpack format if we're not going to have anything which reads it.
|
I wouldn't be so hasty to remove it because it's just more readable. For example we don't have a JSON format at the moment (although we could, and JsonSchema would potentially be a good way to help others bootstrap the DTOs), but we can export to msgpack and use the incantation you found to transform it into JSON. That is much more legit if structs use field names, than if they are just arrays with numbers. Keeping it requires virtually no effort on our part at this point. Another benefit would be as an alternative format if we get into some kind of backwards incompatibility pickle. For example today I thought there was an optional field on |
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: bd4d83a | Previous: 833c0e3 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir-ecdsa_ |
3 s |
2 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Description
Problem
@ludamad asked that we completely stop generating the
msgpack_packmethods.Summary
Adds the following configuration options to the C++ codegen:
NOIR_CODEGEN_PACK_COMPACTinstructs it to useARRAYto serialise structs, otherwise it usesMAP; defaulttrueNOIR_CODEGEN_NO_PACKinstructs it to not emit code formsgpack_pack, which meansbbwill only be able to read the data, not write it; defaulttrueAdditional Context
bbdoesn't normally write ACIR, the only use for serialization was in a test. Adam thought that if somebody wants to generate ACIR for a test, they can 1) do it in memory and never write it to disk, or 2) use nargo. I suppose to avoid having to audit code they don't plan on using, they think it's better if it doesn't even exist, and this way there is no need for the Python script that existed in AztecProtocol/aztec-packages#19047 to wrangle the code.I left the option to emit this code on the Rust side in tact because I thought it served as a good reference about what the data is expected to look like (I do have some unit tests for this in Rust as well), and who knows, the use case might come back. I know, I know: we could always recover it from Git history as well. Maybe it is emotional attachment, having spent so much time coming up with it in the first place. Let me know if you insist on removing it.
I did not remove the ability to read the non-compact format, which is easy to switch on in
nargofor extra backwards compatibility, and should be easy to test as well using an env var. Ostensibly we can add another flag to disable even that. It just feels wrong that on the Rust side it's just a serializer library switch to go from one format to the other, and the reader handles both transparently, butbbshould only be able to read one of them.User Documentation
Check one:
PR Checklist
cargo fmton default settings.