-
Notifications
You must be signed in to change notification settings - Fork 9
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
verify and ret #166
verify and ret #166
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ohad-starkware and the rest of your teammates on Graphite |
e9ce65a
to
fde4539
Compare
2214020
to
6c4f481
Compare
fde4539
to
2bf099c
Compare
6c4f481
to
89093cf
Compare
2bf099c
to
226d903
Compare
48fa695
to
b13cf94
Compare
226d903
to
7957833
Compare
e1fc64b
to
f4c76f5
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.
Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @ohad-starkware)
stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs
line 39 at r1 (raw file):
let cpu_inputs = cpu_inputs .into_iter() .map(|VmState { pc, ap, fp }| CasmState {
This should be rename to VmState
Code quote:
CasmState
stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs
line 278 at r1 (raw file):
M31_0, M31_0, M31_0,
I thought we got rid of those
Code quote:
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs
line 346 at r1 (raw file):
memory_id_to_value_trace_generator .write_trace(&mut tree_builder, &mut range_check_9_9_trace_generator); let (vi_claim, verify_instruction_interaction_generator) = verify_instruction_trace_generator
maybe we want to shorten all the names, but let's be consistent for now and rethink in the future.
Suggestion:
verify_instruction_claim
stwo_cairo_prover/crates/prover/src/components/mod.rs
line 11 at r1 (raw file):
pub mod verifyinstruction; pub fn pack_values<T: Pack>(values: &[T]) -> Vec<T::SimdType> {
Is this Pack trait new?
Are we going to implement it for every type?
I wonder if this function should be near the trait declaration itself
Code quote:
pub fn pack_values<T: Pack>(values: &[T]) -> Vec<T::SimdType> {
stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs
line 75 at r1 (raw file):
impl InteractionClaim { pub fn mix_into(&self, channel: &mut impl Channel) { // TODO(Ohad): mix claimed_sum.
Can't you implement this TODO now?
Code quote:
// TODO(Ohad): mix claimed_sum.
stwo_cairo_prover/crates/prover/src/components/opcodes/mod.rs
line 3 at r1 (raw file):
use stwo_prover::constraint_framework::logup::LookupElements; pub type RelationElements = LookupElements<3>;
Add a comment that this refers to the VmState?
Actually, why the VmState isn't defined here?
Suggestion:
pub type VmRelationElements = LookupElements<3>;
f4c76f5
to
b2c3ecc
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: all files reviewed, 6 unresolved discussions (waiting on @shaharsamocha7)
stwo_cairo_prover/crates/prover/src/cairo_air/mod.rs
line 346 at r1 (raw file):
Previously, shaharsamocha7 wrote…
maybe we want to shorten all the names, but let's be consistent for now and rethink in the future.
Done.
stwo_cairo_prover/crates/prover/src/components/mod.rs
line 11 at r1 (raw file):
Previously, shaharsamocha7 wrote…
Is this Pack trait new?
Are we going to implement it for every type?
I wonder if this function should be near the trait declaration itself
it's a trait in stwo, already implemented recursively for every type that is M31- based (arrays, tupples, array of tupples etc.).
do you think the function also belongs in two? I'm not sure, using this as a utility here.
stwo_cairo_prover/crates/prover/src/components/opcodes/mod.rs
line 3 at r1 (raw file):
Previously, shaharsamocha7 wrote…
Add a comment that this refers to the VmState?
Actually, why the VmState isn't defined here?
CasmState - defined by the air team as a prover type,
we should kill papini's vmstate and rename CasmState to VmState, but that would take coordinating with the air team
stwo_cairo_prover/crates/prover/src/components/ret_opcode/component.rs
line 75 at r1 (raw file):
Previously, shaharsamocha7 wrote…
Can't you implement this TODO now?
done
stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs
line 39 at r1 (raw file):
Previously, shaharsamocha7 wrote…
This should be rename to VmState
same answer as above
stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs
line 278 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I thought we got rid of those
in constraints yes
trace_gen is a bit more tricky, because I'm generating the struct appropriately, and it would mean inlining the arrays in lookup_data
here there's only one call to verify so should be okay, changed manually.
7957833
to
3890805
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: 7 of 13 files reviewed, 6 unresolved discussions (waiting on @shaharsamocha7)
stwo_cairo_prover/crates/prover/src/components/ret_opcode/prover.rs
line 278 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
in constraints yes
trace_gen is a bit more tricky, because I'm generating the struct appropriately, and it would mean inlining the arrays in lookup_data
here there's only one call to verify so should be okay, changed manually.
onecall to memory**
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 6 of 6 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ohad-starkware)
stwo_cairo_prover/crates/prover/src/components/mod.rs
line 11 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
it's a trait in stwo, already implemented recursively for every type that is M31- based (arrays, tupples, array of tupples etc.).
do you think the function also belongs in two? I'm not sure, using this as a utility here.
I think this function should be near the trait.
Not sure any of those belong to Stwo TBH
stwo_cairo_prover/crates/prover/src/components/opcodes/mod.rs
line 3 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
CasmState - defined by the air team as a prover type,
we should kill papini's vmstate and rename CasmState to VmState, but that would take coordinating with the air team
ok, let's send them a message about that
stwo_cairo_prover/crates/prover/src/components/verifyinstruction/component.rs
line 93 at r2 (raw file):
pub struct InteractionClaim { pub total_sum: SecureField, pub claimed_sum: Option<ClaimedPrefixSum>,
AlonT pr has new type names LogupSums
pub type LogupSums = (SecureField, Option<ClaimedPrefixSum>);
We should consider to integrate with that, not for this pr
Code quote:
pub total_sum: SecureField,
pub claimed_sum: Option<ClaimedPrefixSum>,
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: all files reviewed, 4 unresolved discussions (waiting on @ohad-starkware)
stwo_cairo_prover/crates/prover/src/components/verifyinstruction/prover.rs
line 310 at r1 (raw file):
M31_0, M31_0, M31_0,
I don't think we want to do this manual changes.
We will probably generate those files again, so we want to track the changes
Code quote:
+ ((input_col18) * (M31_256))),
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
M31_0,
b2c3ecc
to
6c78000
Compare
3890805
to
c851891
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: 12 of 13 files reviewed, 4 unresolved discussions (waiting on @shaharsamocha7)
stwo_cairo_prover/crates/prover/src/components/mod.rs
line 11 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I think this function should be near the trait.
Not sure any of those belong to Stwo TBH
they both belong in "stwo_air_utils", but it doesn't exist
stwo_cairo_prover/crates/prover/src/components/opcodes/mod.rs
line 3 at r1 (raw file):
Previously, shaharsamocha7 wrote…
ok, let's send them a message about that
sent
stwo_cairo_prover/crates/prover/src/components/verifyinstruction/component.rs
line 93 at r2 (raw file):
Previously, shaharsamocha7 wrote…
AlonT pr has new type names LogupSums
pub type LogupSums = (SecureField, Option<ClaimedPrefixSum>);
We should consider to integrate with that, not for this pr
will consider
stwo_cairo_prover/crates/prover/src/components/verifyinstruction/prover.rs
line 310 at r1 (raw file):
Previously, shaharsamocha7 wrote…
I don't think we want to do this manual changes.
We will probably generate those files again, so we want to track the changes
reverted
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 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ohad-starkware)
stwo_cairo_prover/crates/prover/src/components/mod.rs
line 11 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
they both belong in "stwo_air_utils", but it doesn't exist
so, TODO?
This change is