-
Notifications
You must be signed in to change notification settings - Fork 79
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 constraint for Logup claimed cumsum #830
Add constraint for Logup claimed cumsum #830
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @shaharsamocha7 and the rest of your teammates on Graphite |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #830 +/- ##
==========================================
+ Coverage 92.15% 92.21% +0.06%
==========================================
Files 90 90
Lines 12306 12322 +16
Branches 12306 12322 +16
==========================================
+ Hits 11340 11363 +23
+ Misses 860 853 -7
Partials 106 106
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b3f754b
to
4c3990c
Compare
62fbf19
to
536f8f9
Compare
4c3990c
to
45206e8
Compare
536f8f9
to
da54d68
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 6 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti and @shaharsamocha7)
crates/prover/src/constraint_framework/logup.rs
line 84 at r2 (raw file):
Some((claimed_sum, claimed_row_index)) => { let [cur_cumsum, prev_row_cumsum, claimed_cumsum] = eval .next_extension_interaction_mask(self.interaction, [0, -1, claimed_row_index]);
It's more efficient using is_first
column and doing the constraint with cur_cumsum
and a row selector
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 3 of 6 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @shaharsamocha7)
crates/prover/src/constraint_framework/logup.rs
line 104 at r2 (raw file):
// Constrain that the claimed_sum in case that it is not equal to the total_sum. if let Some((claimed_cumsum, claimed_sum)) = claimed_cumsum {
Move this to the match
above.
45206e8
to
4a63b70
Compare
cef3cc6
to
f6fc394
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: 5 of 6 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti and @andrewmilson)
crates/prover/src/constraint_framework/logup.rs
line 84 at r2 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
It's more efficient using
is_first
column and doing the constraint withcur_cumsum
and a row selector
Added a TODO.
crates/prover/src/constraint_framework/logup.rs
line 104 at r2 (raw file):
Previously, Alon-Ti wrote…
Move this to the
match
above.
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.
Reviewable status: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @Alon-Ti and @shaharsamocha7)
crates/prover/src/constraint_framework/logup.rs
line 26 at r3 (raw file):
/// Represents the value of the prefix sum column at some index. /// Should be used to eliminate padded rows for the logup sum. pub type ClaimedPrefixSum = (SecureField, isize);
Would there ever be a negative index?
Suggestion:
usize
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: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @Alon-Ti and @andrewmilson)
crates/prover/src/constraint_framework/logup.rs
line 26 at r3 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
Would there ever be a negative index?
You can also feed negative numbers if you want (as the domain is cyclic)
I can change it to usize, but there would be a cast afterwords because next_extension_interaction_mask
gets a list of isize.
Should I make the change?
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: 5 of 6 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti and @shaharsamocha7)
crates/prover/src/constraint_framework/logup.rs
line 26 at r3 (raw file):
Previously, shaharsamocha7 wrote…
You can also feed negative numbers if you want (as the domain is cyclic)
I can change it to usize, but there would be a cast afterwords becausenext_extension_interaction_mask
gets a list of isize.
Should I make the change?
Given it's an index I think it should be usize. Offsets make sense as isize so I think it's better to be usize here and to cast to isize when it's needed as an offset
4a63b70
to
93e7e51
Compare
f6fc394
to
81e8174
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 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)
81e8174
to
cbe1dd7
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: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti and @andrewmilson)
crates/prover/src/constraint_framework/logup.rs
line 26 at r3 (raw file):
Previously, andrewmilson (Andrew Milson) wrote…
Given it's an index I think it should be usize. Offsets make sense as isize so I think it's better to be usize here and to cast to isize when it's needed as an offset
Done.
93e7e51
to
c011bab
Compare
cbe1dd7
to
257a05a
Compare
51bde84
to
ee7ec83
Compare
257a05a
to
aa70c61
Compare
aa70c61
to
97d0f88
Compare
97d0f88
to
92540c0
Compare
92540c0
to
8ba2299
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: 3 of 6 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti)
Add optional constraint for logup claimed sum
The constraint applies only in case that the claimed_sum is not the total sum
Uses for padding components with default rows
This change is