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

refactor(honk): template honk composers by flavor #488

Merged
merged 10 commits into from
Jun 12, 2023

Conversation

maramihali
Copy link
Contributor

@maramihali maramihali commented May 31, 2023

Description

This PR adds composer templating by flavor and bring us closer to enabling Honk on Grumpkin. Additionally, it specs the forward declaration of composers in the stdlib and makes sure the stdlib classes do not import the composers directly from the proof system folders as this is very prone to linker problems

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /markdown/specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

@maramihali maramihali force-pushed the mm/honk-flavor-template branch 2 times, most recently from b2a3972 to 910669c Compare June 2, 2023 16:07
@maramihali maramihali force-pushed the mm/honk-flavor-template branch 2 times, most recently from 9c084ab to 2877918 Compare June 5, 2023 16:17
@maramihali maramihali changed the title Mm/honk composer templating Honk Composers Templating Jun 5, 2023
@maramihali maramihali marked this pull request as ready for review June 5, 2023 17:09
@maramihali maramihali requested a review from codygunton June 5, 2023 17:09
@maramihali maramihali force-pushed the mm/honk-flavor-template branch from 2877918 to c218260 Compare June 5, 2023 17:14
@maramihali maramihali changed the title Honk Composers Templating Template the Honk Composers and helpers by flavour Jun 12, 2023
@maramihali maramihali changed the title Template the Honk Composers and helpers by flavour refactor(honk): template honk composers by flavor Jun 12, 2023
@maramihali maramihali merged commit 1b03f9c into master Jun 12, 2023
@maramihali maramihali deleted the mm/honk-flavor-template branch June 12, 2023 19:33
Copy link
Collaborator

@codygunton codygunton left a comment

Choose a reason for hiding this comment

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

Nice work straightforwardly executed. There are some little follow-ons (chiefly the liberal use of the composers header), but overall it was indeed fine to go in.

@@ -1,5 +1,6 @@
#include "acir_format.hpp"
#include "barretenberg/common/log.hpp"
#include "barretenberg/stdlib/primitives/composers/composers.hpp"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this suddenly needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here and elsewhere, we'd rather be more specific than include this one header because it's implicitly including a lot of other stuff: all composers and circuit constructors.

@@ -957,6 +957,10 @@ typename Curve::Element pippenger_without_endomorphism_basis_points(typename Cur

// Explicit instantiation
// BN254
template void generate_pippenger_point_table<curve::BN254>(curve::BN254::AffineElement* points,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It turned out to not be necessary to explicitly instantiate this function (with or without extern, for either curve).


namespace proof_system::honk::flavor {
class StandardGrumpkin {
// TODO(Mara): At the moment this class is a duplicate of the Standard flavor with a different PCS for testing
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's probably right to just duplicate this as you have.

@@ -412,4 +419,23 @@ template typename honk::flavor::Ultra::Polynomial compute_sorted_list_accumulato
template void add_plookup_memory_records_to_wire_4<honk::flavor::Ultra>(
std::shared_ptr<typename honk::flavor::Ultra::ProvingKey>& key, typename honk::flavor::Ultra::FF eta);

template honk::flavor::UltraGrumpkin::Polynomial compute_permutation_grand_product<honk::flavor::UltraGrumpkin>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ugh, maybe this should go in a (stateless) class so we can greatly simplify explicit instantiation? Not asking you to do that, just complaining out loud.

ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
…etenberg#488)


---------

Co-authored-by: maramihali <[email protected]>
Co-authored-by: codygunton <[email protected]>
Co-authored-by: Mara Mihali <[email protected]>
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
…etenberg#488)


---------

Co-authored-by: maramihali <[email protected]>
Co-authored-by: codygunton <[email protected]>
Co-authored-by: Mara Mihali <[email protected]>
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.

2 participants