-
Notifications
You must be signed in to change notification settings - Fork 109
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
Logup cumsum constraint with cumsum_shift #978
Logup cumsum constraint with cumsum_shift #978
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #978 +/- ##
==========================================
- Coverage 92.33% 92.02% -0.32%
==========================================
Files 105 105
Lines 14252 14274 +22
Branches 14252 14274 +22
==========================================
- Hits 13159 13135 -24
- Misses 1019 1064 +45
- Partials 74 75 +1 ☔ View full report in Codecov by Sentry. |
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 7 files at r1.
Reviewable status: 1 of 7 files reviewed, 4 unresolved discussions (waiting on @shaharsamocha7)
crates/prover/src/constraint_framework/logup.rs
line 66 at r1 (raw file):
interaction: usize, total_sum: SecureField, claimed_sum: Option<ClaimedPrefixSum>,
doc why this remains here when only valid value is None
crates/prover/src/constraint_framework/logup.rs
line 72 at r1 (raw file):
assert!( claimed_sum.is_none(), "Claimed sum at internal index is not supported"
Suggestion:
"Partial prefix-sum is not supported"
crates/prover/src/constraint_framework/logup.rs
line 195 at r1 (raw file):
let mut last_col_coords = self.trace.pop().unwrap().columns; // compute cumsum_shift.
Suggestion:
// Compute cumsum_shift.
crates/prover/src/constraint_framework/logup.rs
line 201 at r1 (raw file):
let base_sums = packed_sums.map(|s| s.pointwise_sum()); let total_sum = SecureField::from_m31_array(base_sums); let cumsum_shift = total_sum / BaseField::from_u32_unchecked(1 << self.log_size);
?
Suggestion:
let coordinate_sums = last_col_coords.each_ref().map(|c| {
c.data
.iter()
.copied()
.sum::<PackedBaseField>()
.pointwise_sum()
});
let total_sum = SecureField::from_m31_array(coordinate_sums);
let cumsum_shift = total_sum / BaseField::from_u32_unchecked(1 << self.log_size);
crates/prover/src/constraint_framework/logup.rs
line 206 at r1 (raw file):
c.data .iter_mut() .for_each(|x| *x -= PackedBaseField::broadcast(cumsum_shift.to_m31_array()[i]))
broadcast outside of inner loop, it will look nicer
crates/prover/src/constraint_framework/mod.rs
line 186 at r1 (raw file):
assert!(!self.logup.is_finalized, "LogupAtRow was already finalized"); assert!(
will we ever get to this assert?
Previously, ohad-starkware (Ohad) wrote…
nvm won't give you trouble on this |
Previously, ohad-starkware (Ohad) wrote…
same |
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: 1 of 7 files reviewed, 2 unresolved discussions (waiting on @ohad-starkware)
crates/prover/src/constraint_framework/logup.rs
line 66 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
nvm won't give you trouble on this
I delete it in the next pr.
crates/prover/src/constraint_framework/logup.rs
line 206 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
broadcast outside of inner loop, it will look nicer
better?
crates/prover/src/constraint_framework/mod.rs
line 186 at r1 (raw file):
Previously, ohad-starkware (Ohad) wrote…
same
next pr
crates/prover/src/constraint_framework/logup.rs
line 195 at r1 (raw file):
let mut last_col_coords = self.trace.pop().unwrap().columns; // compute cumsum_shift.
Done.
ec20bc8
to
bbbe8a7
Compare
smar, ill start lgtming myself too |
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 4 of 7 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
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: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
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.
haha oops :)
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
1f7dbdd
to
bffd8f7
Compare
bbbe8a7
to
9e789d3
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 r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
bffd8f7
to
2660828
Compare
9e789d3
to
3ca832e
Compare
3ca832e
to
b5c7e2a
Compare
No description provided.