-
Notifications
You must be signed in to change notification settings - Fork 234
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
feat: cycle scalar <> bigfield interactions #6744
Conversation
Benchmark resultsNo metrics with a significant change found. Detailed resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Proof generationEach column represents the number of threads used in proof generation.
L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every kernel circuit run across all benchmarks.
Stats on running time collected for app circuits
Tree insertion statsThe duration to insert a fixed batch of leaves into each tree type.
MiscellaneousTransaction sizes based on how many contract classes are registered in the tx.
Transaction size based on fee payment method | Metric | | |
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05
.
Benchmark suite | Current: 32feb75 | Previous: 70926fc | Ratio |
---|---|---|---|
nativeconstruct_proof_ultrahonk_power_of_2/20 |
5866.837777000001 ms/iter |
5513.648204000006 ms/iter |
1.06 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ludamad @codygunton
@@ -34,7 +34,7 @@ template <typename Builder> void create_multi_scalar_mul_constraint(Builder& bui | |||
} | |||
|
|||
// Call batch_mul to multiply the points and scalars and sum the results | |||
auto output_point = cycle_group_ct::batch_mul(scalars, points); | |||
auto output_point = cycle_group_ct::batch_mul(points, scalars); |
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.
the signature of batch_mul in cycle_group was different from native and biggroup (scalars and points order was switched) so I modified it to be consistent.
…/aztec-packages into mm/cycle-scalar-group-work
EXPECT_EQ(one_native.x, expected_one_native.x); | ||
EXPECT_EQ(one_native.y, expected_one_native.y); | ||
|
||
EXPECT_TRUE(CircuitChecker::check(builder)); |
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.
You can remove this line, it doesn't do anything
cycle_scalar_ct scalar_from_elt = (elt); | ||
EXPECT_EQ(elt, scalar_from_elt.get_value()); | ||
|
||
EXPECT_TRUE(CircuitChecker::check(builder)); |
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.
This doesn't do anything
cycle_group_ct result2 = cycle_group_ct::batch_mul({ TestFixture::generators[0], TestFixture::generators[1] }, | ||
{ cycle_scalar_ct(scalar1), cycle_scalar_ct(scalar2) }); | ||
|
||
AffineElement result1_native = resut1.get_value(); |
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.
Typo "resut1"
EXPECT_EQ(result1_native.x, result2_native.x); | ||
EXPECT_EQ(result1_native.y, result2_native.y); | ||
|
||
EXPECT_TRUE(CircuitChecker::check(builder)); |
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.
This doesn't do anything
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.
The tests need to have a witness variant. Currently new tests just check if the constant conversion is correct
(lo + hi * shift).assert_equal(_in); | ||
lo = witness_t(in.get_context(), lo_v); | ||
hi = witness_t(in.get_context(), hi_v); | ||
(lo + hi * shift).assert_equal(in); |
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.
These values have to be range constrained with borrow, otherwise there are too many ways this split can happen (we are just checking the linear combination)
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.
Also it is possible to represent two fq scalars with one fr
hi = value_hi; | ||
// N.B. to be able to call assert equal, these cannot be constants | ||
} else { | ||
lo = witness_t(ctx, value_lo); |
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.
These values have to be range constrained with borrow in the same way
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.
LGTM
Adds missing methods in cycle_group and cycle_scalar required for the PCS in the ECCVM recursive verifier. As a summary, we add missing cycle_group constructors, a cycle group representation of
one
, a naive method to convert bigfield to cycle_scalar (but that adds constraints) and unify thebatch_mul
interface with the others present in our codebase (i.e. swap points and scalars).