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

Prover constructs sumcheck #61

Merged
merged 7 commits into from
Jan 17, 2023
Merged

Prover constructs sumcheck #61

merged 7 commits into from
Jan 17, 2023

Conversation

codygunton
Copy link
Collaborator

@codygunton codygunton commented Jan 12, 2023

This PR makes the Honk Prover class construct a sumcheck object and execute this. Some of the higher-level changes this necessitates.

  • It may be desirable to pre-compute sumcheck classes for some expected sizes (values of multivariate_d, but at least for now I make this size a runtime parameter. This necessitates replacing some uses of std::array with std::vector.
  • Since Standard Honk and Standard Plonk have different sets of polynomials, we cannot reuse the Standard Plonk polynomial manifest (or its size). The polynomial manifest is selected using the Composer type, so I added another composer type for Standard Honk.
  • I add a constructor of a Multivariates object from a proving key (needed for prover to create the object) and from a transcript (Sumcheck class in verifier mode had previously not constructed multivariates).

I regret leaving the insertion of the sumcheck evaluations in a rough form in the prover. This is done for expediency.

@codygunton codygunton self-assigned this Jan 12, 2023
@codygunton codygunton force-pushed the cg/integrate-sumcheck branch from aa1307a to 771845c Compare January 13, 2023 19:13
@codygunton codygunton force-pushed the cg/integrate-sumcheck branch 3 times, most recently from 02fe345 to b0f7570 Compare January 17, 2023 16:35
@codygunton codygunton force-pushed the cg/integrate-sumcheck branch from c58872c to 4aac909 Compare January 17, 2023 17:31
@codygunton codygunton marked this pull request as ready for review January 17, 2023 18:24
cpp/src/aztec/honk/proof_system/prover.cpp Show resolved Hide resolved
}
};

explicit Multivariates(const std::shared_ptr<waffle::proving_key>& proving_key)
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be updated to handle shifted polynomials in follow-on

@@ -70,7 +74,18 @@ TEST(Sumcheck, Prover)
q_c, sigma_1, sigma_2, sigma_3, id_1, id_2, id_3, lagrange_1
};

auto transcript = Transcript(transcript::Manifest());
std::vector<transcript::Manifest::RoundManifest> manifest_rounds;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Follow-on: Stuff like this and mock_prover_contributions_to_transcript could be replaced with the real manifest and the mock_inputs_prior_to_challenge() fctn

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think, more generally, we need to decide on a policy about when we use real things vs mocked things. @arijitdutta67 maybe you can keep this in mind as you work on the sumcheck tests and implement @ledwards2225's suggestion if you think it makes sense to do so?

PolynomialDescriptor("W_2", "w_2_lagrange", false, false, WITNESS, W_2), //
PolynomialDescriptor("W_3", "w_3_lagrange", false, false, WITNESS, W_3), //
PolynomialDescriptor("Z_PERM", "z_perm", true, true, WITNESS, Z), //
// PolynomialDescriptor("Z_PERM_SHIFT", "z_perm_shift", true, true, WITNESS, Z_LOOKUP), //
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be reinstated in follow-on

@@ -11,7 +11,7 @@ struct StandardArithmetization {
W_R,
W_O,
Z_PERM,
Z_PERM_SHIFT,
Z_PERM_SHIFT, // TODO(Cody): Hid ethis.
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be addressed in follow-on

@@ -36,7 +36,8 @@ struct StandardHonk {
public:
using Arithmetization = proving_system::StandardArithmetization;
using MULTIVARIATE = Arithmetization::POLYNOMIAL;
static constexpr size_t STANDARD_UNROLLED_MANIFEST_SIZE = 12; // cf waffle::STANDARD_UNROLLED_MANIFEST_SIZE
// TODO(Cody): Where to specify? is this polynomial manifest size?
static constexpr size_t STANDARD_HONK_MANIFEST_SIZE = 16;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can this just be deleted? Not currently used anywhere. Or should the value be specified here then used by the polynomial manifest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left it in only as a comment, as a suggestion that perhaps this data should be specified as part of the flavor.

},
/* challenge_name = */ "rho",
/* num_challenges_in = */ STANDARD_UNROLLED_MANIFEST_SIZE - 1, /* TODO(Cody): this is bad. */
/* num_challenges_in = */ 11, /* TODO(Cody): magic number! Where should this be specified? */
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be addressed in follow-on

@@ -233,6 +234,9 @@ std::shared_ptr<waffle::proving_key> ComposerHelper<CircuitConstructor>::compute

compute_first_and_last_lagrange_polynomials(circuit_proving_key.get());

// TODO(Cody): this is a workaround
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be addressed in follow-on

@codygunton codygunton merged commit ed5eecf into master Jan 17, 2023
@codygunton codygunton deleted the cg/integrate-sumcheck branch January 17, 2023 19:05
dbanks12 pushed a commit that referenced this pull request Jan 26, 2023
* Hack poly mfst to get multivariates from pk.
* d is not a template param
* Prover executes sumcheck.
* Address some comments from Luke.
dbanks12 pushed a commit that referenced this pull request Jan 27, 2023
* Hack poly mfst to get multivariates from pk.
* d is not a template param
* Prover executes sumcheck.
* Address some comments from Luke.
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
* Hack poly mfst to get multivariates from pk.
* d is not a template param
* Prover executes sumcheck.
* Address some comments from Luke.
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
* Hack poly mfst to get multivariates from pk.
* d is not a template param
* Prover executes sumcheck.
* Address some comments from Luke.
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