-
Notifications
You must be signed in to change notification settings - Fork 295
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: op queue #5648
Merged
Merged
refactor: op queue #5648
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e138a4d
make ultra and raw ops private
ledwards2225 03f8586
raw and ultra ops are tied together
ledwards2225 828fa33
eq and reset name update
ledwards2225 38f22e4
reorganize ultra op populate
ledwards2225 6414b0f
use constant
ledwards2225 e9327e6
label empty row method as test method
ledwards2225 3d35d75
reorg access specification in op queue
ledwards2225 04e9626
add method for bad eq op since ops are now
ledwards2225 1fcac04
cleanup
ledwards2225 eb1e5a9
Merge branch 'master' into lde/op_queue_refactor
ledwards2225 2566209
Merge branch 'master' into lde/op_queue_refactor
ledwards2225 750f027
default in switch
ledwards2225 8bccdf8
one more time
ledwards2225 a86ea72
aaaand again
ledwards2225 e1f2efc
fuzzing method for setting raw ops
ledwards2225 8e6d944
Merge branch 'master' into lde/op_queue_refactor
ledwards2225 d7b2540
remove commented line
ledwards2225 90033a0
Merge branch 'master' into lde/op_queue_refactor
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
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 |
---|---|---|
|
@@ -29,11 +29,11 @@ TEST(ECCVMCircuitBuilderTests, BaseCase) | |
op_queue->mul_accumulate(b, y); | ||
op_queue->add_accumulate(a); | ||
op_queue->mul_accumulate(b, x); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
op_queue->add_accumulate(c); | ||
op_queue->mul_accumulate(a, x); | ||
op_queue->mul_accumulate(b, x); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
op_queue->mul_accumulate(a, x); | ||
op_queue->mul_accumulate(b, x); | ||
op_queue->mul_accumulate(c, x); | ||
|
@@ -86,7 +86,7 @@ TEST(ECCVMCircuitBuilderTests, ShortMul) | |
Fr x = small_x; | ||
|
||
op_queue->mul_accumulate(a, x); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
|
@@ -95,7 +95,6 @@ TEST(ECCVMCircuitBuilderTests, ShortMul) | |
|
||
TEST(ECCVMCircuitBuilderTests, EqFails) | ||
{ | ||
using ECCVMOperation = eccvm::VMOperation<G1>; | ||
std::shared_ptr<ECCOpQueue> op_queue = std::make_shared<ECCOpQueue>(); | ||
|
||
auto generators = G1::derive_generators("test generators", 3); | ||
|
@@ -104,14 +103,8 @@ TEST(ECCVMCircuitBuilderTests, EqFails) | |
|
||
op_queue->mul_accumulate(a, x); | ||
// Tamper with the eq op such that the expected value is incorect | ||
op_queue->raw_ops.emplace_back(ECCVMOperation{ .add = false, | ||
.mul = false, | ||
.eq = true, | ||
.reset = true, | ||
.base_point = a, | ||
.z1 = 0, | ||
.z2 = 0, | ||
.mul_scalar_full = 0 }); | ||
op_queue->add_erroneous_equality_op_for_testing(); | ||
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. niiice |
||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
EXPECT_EQ(result, false); | ||
|
@@ -121,7 +114,7 @@ TEST(ECCVMCircuitBuilderTests, EmptyRow) | |
{ | ||
std::shared_ptr<ECCOpQueue> op_queue = std::make_shared<ECCOpQueue>(); | ||
|
||
op_queue->empty_row(); | ||
op_queue->empty_row_for_testing(); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
|
@@ -137,8 +130,8 @@ TEST(ECCVMCircuitBuilderTests, EmptyRowBetweenOps) | |
Fr x = Fr::random_element(&engine); | ||
|
||
op_queue->mul_accumulate(a, x); | ||
op_queue->empty_row(); | ||
op_queue->eq(); | ||
op_queue->empty_row_for_testing(); | ||
op_queue->eq_and_reset(); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
|
@@ -154,7 +147,7 @@ TEST(ECCVMCircuitBuilderTests, EndWithEq) | |
Fr x = Fr::random_element(&engine); | ||
|
||
op_queue->mul_accumulate(a, x); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
|
@@ -170,7 +163,7 @@ TEST(ECCVMCircuitBuilderTests, EndWithAdd) | |
Fr x = Fr::random_element(&engine); | ||
|
||
op_queue->mul_accumulate(a, x); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
op_queue->add_accumulate(a); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
|
@@ -187,7 +180,7 @@ TEST(ECCVMCircuitBuilderTests, EndWithMul) | |
Fr x = Fr::random_element(&engine); | ||
|
||
op_queue->add_accumulate(a); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
op_queue->mul_accumulate(a, x); | ||
|
||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
|
@@ -204,10 +197,10 @@ TEST(ECCVMCircuitBuilderTests, EndWithNoop) | |
Fr x = Fr::random_element(&engine); | ||
|
||
op_queue->add_accumulate(a); | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
op_queue->mul_accumulate(a, x); | ||
|
||
op_queue->empty_row(); | ||
op_queue->empty_row_for_testing(); | ||
ECCVMCircuitBuilder circuit{ op_queue }; | ||
bool result = ECCVMTraceChecker::check(circuit); | ||
EXPECT_EQ(result, true); | ||
|
@@ -228,7 +221,7 @@ TEST(ECCVMCircuitBuilderTests, MSM) | |
expected += (points[i] * scalars[i]); | ||
op_queue->mul_accumulate(points[i], scalars[i]); | ||
} | ||
op_queue->eq(); | ||
op_queue->eq_and_reset(); | ||
}; | ||
|
||
// single msms | ||
|
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
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.
i know this is not on you but we really need eccvm documentation, this code is involved to read
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.
hah yes, agreed