-
Notifications
You must be signed in to change notification settings - Fork 94
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
Multi-constraint Relations #444
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
59897f8
multi constraint paradigm in place for Standard
ledwards2225 bd6ae5e
multi contraint arith and perm for ultra
ledwards2225 2a7a923
try to fix build errorfor invoke
ledwards2225 4c89695
add lookup relation
ledwards2225 616c031
update gen perm sort relation
ledwards2225 24c945b
update elliptic relation
ledwards2225 83b3330
update relation correctness for ultra
ledwards2225 1f82ef1
update consistency tests for ultra
ledwards2225 4c00b5d
delete unused relations and rename relations hpp
ledwards2225 eafe1ad
reinstate ultra honk composer tests with all but aux relation
ledwards2225 d77aac4
delete unused param to fix gcc build
ledwards2225 dbcaafd
uncomment some tests
ledwards2225 03b1718
aux relation fully integrated
ledwards2225 a72c80d
cleanup and address some WORKTODOs
ledwards2225 05ced61
update function name after rebase
ledwards2225 ef20c44
remove unused variable for gcc
ledwards2225 94d29a5
cleanup
ledwards2225 17d634b
Merge branch 'master' into lde/relation_batching
ledwards2225 9bc506d
adressing Maras review comments mostly through updated docs
ledwards2225 b397511
Merge branch 'master' into lde/relation_batching
ledwards2225 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
5 changes: 2 additions & 3 deletions
5
cpp/src/barretenberg/honk/composer/standard_honk_composer.test.cpp
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
#include <tuple> | ||
|
||
#include "../polynomials/univariate.hpp" | ||
#include "relation.hpp" | ||
#include "relation_parameters.hpp" | ||
|
||
namespace proof_system::honk::sumcheck { | ||
|
||
|
@@ -12,6 +12,12 @@ template <typename FF> class ArithmeticRelation { | |
// 1 + polynomial degree of this relation | ||
static constexpr size_t RELATION_LENGTH = 4; | ||
|
||
static constexpr size_t NUM_CONSTRAINTS = 1; | ||
static constexpr std::array<size_t, NUM_CONSTRAINTS> CONSTRAINT_LENGTH = { 4 }; | ||
|
||
using RelationUnivariates = std::tuple<Univariate<FF, CONSTRAINT_LENGTH[0]>>; | ||
using RelationValues = std::array<FF, NUM_CONSTRAINTS>; | ||
|
||
/** | ||
* @brief Expression for the StandardArithmetic gate. | ||
* @details The relation is defined as C(extended_edges(X)...) = | ||
|
@@ -22,7 +28,7 @@ template <typename FF> class ArithmeticRelation { | |
* @param parameters contains beta, gamma, and public_input_delta, .... | ||
* @param scaling_factor optional term to scale the evaluation before adding to evals. | ||
*/ | ||
void add_edge_contribution(Univariate<FF, RELATION_LENGTH>& evals, | ||
void add_edge_contribution(RelationUnivariates& evals, | ||
const auto& extended_edges, | ||
const RelationParameters<FF>&, | ||
const FF& scaling_factor) const | ||
|
@@ -44,10 +50,17 @@ template <typename FF> class ArithmeticRelation { | |
tmp += q_o * w_o; | ||
tmp += q_c; | ||
tmp *= scaling_factor; | ||
evals += tmp; | ||
std::get<0>(evals) += tmp; | ||
}; | ||
|
||
void add_full_relation_value_contribution(FF& full_honk_relation_value, | ||
/** | ||
* @brief Add the result of each identity in this relation evaluated at the multivariate evaluations produced by the | ||
* Sumcheck Prover. | ||
* | ||
* @param full_honk_relation_value | ||
* @param purported_evaluations | ||
*/ | ||
void add_full_relation_value_contribution(RelationValues& full_honk_relation_value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's clear what this function is doing but also it would benefit from a bit of documentation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call - Added a Doxygen brief to this guy |
||
const auto& purported_evaluations, | ||
const RelationParameters<FF>&) const | ||
{ | ||
|
@@ -60,10 +73,10 @@ template <typename FF> class ArithmeticRelation { | |
auto q_o = purported_evaluations.q_o; | ||
auto q_c = purported_evaluations.q_c; | ||
|
||
full_honk_relation_value += w_l * (q_m * w_r + q_l); | ||
full_honk_relation_value += q_r * w_r; | ||
full_honk_relation_value += q_o * w_o; | ||
full_honk_relation_value += q_c; | ||
std::get<0>(full_honk_relation_value) += w_l * (q_m * w_r + q_l); | ||
std::get<0>(full_honk_relation_value) += q_r * w_r; | ||
std::get<0>(full_honk_relation_value) += q_o * w_o; | ||
std::get<0>(full_honk_relation_value) += q_c; | ||
}; | ||
}; | ||
} // namespace proof_system::honk::sumcheck |
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.
I think this is a really good change, I was confused about the naming of this file beforehand :)