-
Notifications
You must be signed in to change notification settings - Fork 375
feat: Compare bincode to CBOR, FlexBuffers and Protobuf - implement best #7513
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
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
f2640c0
Use ciborium for serialization of Program
aakoshh 348e43a
fixup! Use ciborium for serialization of Program
aakoshh d9df721
Compared bincode against CBOR
aakoshh 948cd8e
Use FlexBuffers for serialization
aakoshh 67e98a9
Measure and display FlexBuffer sizes
aakoshh 13a440f
Define protobuf schema for Program
aakoshh 44c8afe
Refactor package names
aakoshh d89166f
Merge remote-tracking branch 'origin/master' into 7511-compare-progra…
aakoshh 17654ca
Brillig opcodes
aakoshh ebb1369
Add ProtoReprF
aakoshh 08d17fb
Switch to ProtoSchema
aakoshh 33a32b6
BrilligOpcode encode
aakoshh f2fcc5c
Split up conversions
aakoshh 0734118
Encoder for usize
aakoshh a2494c2
All brillig encoding
aakoshh f96c33e
Separate native. Work with IntoIterator
aakoshh d4e8745
Move Expression to native
aakoshh 36701d8
Finish encoding acir
aakoshh 70deca7
WIP
aakoshh a66a9e7
Switch to protobuf serialization in Program
aakoshh e21fccc
Bincode vs Protobuf
aakoshh 717bdc6
Decode native types
aakoshh 856afe3
Decoding brillig enums
aakoshh db5f5ed
Decoding brillig
aakoshh c32d67c
Decoding acir WIP
aakoshh 28c2500
Rename _msg to _wrap
aakoshh ed6f56c
Decode acir
aakoshh 246f017
Use unsafe with env::set_var
aakoshh 7836684
Merge remote-tracking branch 'origin/master' into 7511-compare-progra…
aakoshh cd8952b
Format code
aakoshh ce4624b
Update expected serialized bytes in tests
aakoshh e37084b
Assert deserialization equals original
aakoshh 070bc74
Update bytecode in TS tests
aakoshh 8dac5f8
Encode/decode witness
aakoshh aae1e4d
Use protobuf in WitnessMap and WitnessStack
aakoshh 7eb28ac
Fix TS formatting
aakoshh 4aad815
Trying to add Arbitrary
aakoshh efb5910
Enable Arbitrary
aakoshh c3ba297
Recursive strategy for HeapValueType
aakoshh f901854
Proptest for serialization WIP
aakoshh 0d40a78
Comments about the env var
aakoshh b01d103
Assert roundtrip
aakoshh d5d774d
Reenable recursive strategy
aakoshh 30548b1
Implement all BlackBoxFuncCall
aakoshh eb341f7
Set serialization back to bincode. Add proptest for it.
aakoshh bb5541b
Revert "Update expected serialized bytes in tests"
aakoshh fbec87e
Revert "Update bytecode in TS tests"
aakoshh b3ff0c9
Fix clippy
aakoshh a166ae9
Remove bytecode JSON and PNG
aakoshh 27514bb
Merge remote-tracking branch 'origin/master' into 7511-compare-progra…
aakoshh e8df457
Use bincode in WitnessStack and WitnessMap again
aakoshh da0e82a
Fix docstring
aakoshh b9daf52
Add readme for the scripts
aakoshh 4281e4b
Merge branch 'master' into 7511-compare-program-ser
aakoshh 7ecbf3d
Add GITHUB_TOKEN for prost_prebuilt
aakoshh 93212ec
Comment about why unsafe is needed
aakoshh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| use std::path::Path; | ||
|
|
||
| fn main() { | ||
| let (protoc_bin, include_dir) = | ||
| protoc_prebuilt::init("29.3").expect("failed to initialize protoc"); | ||
|
|
||
| unsafe { | ||
| std::env::set_var("PROTOC", protoc_bin); | ||
| } | ||
|
|
||
| prost_build::compile_protos( | ||
| &[ | ||
| // DTOs for a `Program`, which work with the types in `acir.cpp` | ||
| "./src/proto/program.proto", | ||
| // DTOs for the `WitnessStack`, which work with the types in `witness.cpp` | ||
| "./src/proto/acir/witness.proto", | ||
| // A pared down DTO for `Program`, so Barretenberg can ignore the Brillig part. | ||
| // This is only included to make sure it compiles. | ||
| "./src/proto/acir/program.proto", | ||
| ], | ||
| &[Path::new("./src/proto"), include_dir.as_path()], | ||
| ) | ||
| .expect("failed to compile .proto schemas"); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we having this crate depend on itself to turn on a feature flag? If we need to have this feature on all the time like this then we should just not have a feature flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it's just for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is for testing, yes, but I somehow again encountered the problem that if I just enabled this feature then
noir-wasmdidn't compile. I think it happened when it was likeacir = { workspace = true, features = ["arb"] }instead of usingpath.Originally I tried to make it work like this:
The problem is that half of the stuff that needs
Arbitrarylive in thebrilligcrate, so for that to kick in I either need to add adev-dependencyon that crate witharb, which can trigger thewasmproblem, or I can rely on thearbfeature ofacirturning onbrillig/arb.