-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add FRI layer 0 commitment #186
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ff67b77
to
8b65c35
Compare
50a3450
to
cdce69c
Compare
Please document the arguments. Code quote: log_size_per_column: @Array<u32>,
samples_per_column: @Array<Array<PointSample>>,
random_coeff: QM31,
mut query_positions_per_log_size: Felt252Dict<Nullable<Span<usize>>>,
queried_values_per_column: @Array<Array<M31>>,
mut missing_values: Span<QM31>, |
8b65c35
to
e2c66d6
Compare
dcb2a6d
to
460e403
Compare
b4f7132
to
fcb1a9d
Compare
fcb1a9d
to
9d381d8
Compare
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.
Reviewable status: 0 of 29 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware and @shaharsamocha7)
stwo_cairo_verifier/src/pcs/quotients.cairo
line 30 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
Please document the arguments.
Done.
stwo_cairo_verifier/src/utils.cairo
line 14 at r3 (raw file):
/// Look up table where index `i` stores value `2^i`. const POW_2: [u32; 32] = [ 0b1, //
Formatter in new version wants to squash multiple into the same line. The empty comment stops that from happening
9d381d8
to
f8bd423
Compare
doesn't span have len? Suggestion: self.positions.len() |
it does, sierra is type safe. only felt252 can overflow. Code quote: // TODO(andrew): Check Cairo does checked sub in all profiles. |
Consider deduping inside this loop. Suggestion: for position in query_positions {
new_position = *position / folding_factor;
if new_position != prev_position
folded_positions.append(*position / folding_factor);
prev_position = new_position.
}; |
Does this work? Suggestion: fn first(self: @Span<T>) -> Option<@T> {
*self.pop_front()
} |
nice! Code quote: self = self_copy;
return Option::Some(other); |
Suggestion: /// * `query_idx`: The index of the query to compute the quotients for |
You have 4 loops here. I'd consider refactoring it in the future as
you can add a todo. Code quote: for batch_i in 0..n_batches { |
revert Code quote: use stwo_cairo_verifier::fields::m31::m31; |
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.
Reviewed 2 of 13 files at r1, 4 of 17 files at r3, 9 of 24 files at r5, all commit messages.
Reviewable status: 13 of 29 files reviewed, 7 unresolved discussions (waiting on @andrewmilson and @shaharsamocha7)
If the columns are stored by size is the dict still nessiary? Code quote: // TODO(andrew): Refactor. Use a dict. |
48a7536
to
8ef16b2
Compare
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.
Reviewable status: 13 of 29 files reviewed, 7 unresolved discussions (waiting on @ilyalesokhin-starkware and @shaharsamocha7)
stwo_cairo_verifier/src/queries.cairo
line 47 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
doesn't span have len?
Span
does but @Span
doesn't
stwo_cairo_verifier/src/queries.cairo
line 55 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
it does, sierra is type safe.
only felt252 can overflow.
Great. Removed
stwo_cairo_verifier/src/queries.cairo
line 75 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
Consider deduping inside this loop.
Done.
stwo_cairo_verifier/src/utils.cairo
line 166 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
Does this work?
Complains "ref argument must be a variable".
It's possible with
fn first(self: @Span<T>) -> Option<@T> {
let mut self_copy = *self;
self_copy.pop_front()
}
but leaving as is seems more consistent with the other Span impls like .len() being implemented on Span
not @Span
. WDYT?
stwo_cairo_verifier/src/pcs/quotients.cairo
line 38 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
If the columns are stored by size is the dict still nessiary?
Ahh nice. True
stwo_cairo_verifier/src/pcs/quotients.cairo
line 262 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
You have 4 loops here.
I'd consider refactoring it in the future as
- compute an array if (numerator, denumerator)
- batch_inverse + row_accumulator.
you can add a todo.
Discussed offline.
stwo_cairo_verifier/src/vcs/verifier.cairo
line 300 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
revert
Done.
stwo_cairo_verifier/src/pcs/quotients.cairo
line 242 at r5 (raw file):
/// * `sampled_batches`: OOD column samples grouped by eval point. /// * `queried_values_by_column`: Sampled query evals by trace column. /// * `row`: The index of the query to compute the quotients for.
Done.
8ef16b2
to
2d874fc
Compare
Previously, andrewmilson (Andrew Milson) wrote…
I find it strange that you must consume the span to get the first element. Maybe: |
? Code quote: // #[test]
// fn test_deserialise() {
// let test_proof = proofs::test_proof::proof();
// println!("TEST PROOF WORKED");
// } |
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.
Reviewed 11 of 24 files at r5, 6 of 6 files at r6.
Reviewable status: 27 of 29 files reviewed, 2 unresolved discussions (waiting on @andrewmilson, @shaharsamocha7, @span, and @t)
2d874fc
to
1cd7436
Compare
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.
Reviewable status: 26 of 29 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware, @shaharsamocha7, @span, and @t)
stwo_cairo_verifier/src/utils.cairo
line 166 at r5 (raw file):
Previously, ilyalesokhin-starkware wrote…
I find it strange that you must consume the span to get the first element.
Maybe:
No iter. Only into_iter() which is also implemented on Span
stwo_cairo_verifier/tests/verifier.cairo
line 20 at r6 (raw file):
Previously, ilyalesokhin-starkware wrote…
?
Done.
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.
Reviewed 2 of 24 files at r5, 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
1cd7436
to
d7ed8f9
Compare
This change is