Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

chore: add cpp codegen for ACIR [DO NOT MERGE] #430

Closed
wants to merge 31 commits into from
Closed

Conversation

TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented Jul 12, 2023

Description

Problem*

Resolves #434

Summary*

This PR adds a quick implementation of serde_reflection. Pushing this up for visibility rather to get it merged as is.

serde_reflection fails if it has two different enums with the same name so I've had to rename brillig::Opcode to BrilligOpcode.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

acir/acir.cpp Outdated
Comment on lines 905 to 913
struct Circuit {
uint32_t current_witness_index;
std::vector<Circuit::Opcode> opcodes;
Circuit::PublicInputs public_parameters;
Circuit::PublicInputs return_values;

friend bool operator==(const Circuit&, const Circuit&);
std::vector<uint8_t> bincodeSerialize() const;
static Circuit bincodeDeserialize(std::vector<uint8_t>);
Copy link
Member Author

Choose a reason for hiding this comment

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

bberg would then just have to iterate through the opcodes field and construct a ConstraintSystem from this.

@kevaundray
Copy link
Contributor

Now that ACVM has been migrated into noir, we should find a way to put the codegen code in here into the acvm repo in noir for when we want to make serialization changes cc @kobyhallx and @TomAFrench

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce serde-reflection for ACIR cpp codegen
4 participants