Add 0-padded optimization in dense polynomial + sumcheck#5
Add 0-padded optimization in dense polynomial + sumcheck#5nicholas-mainardi wants to merge 9 commits intofeat/serialize_structsfrom
Conversation
dp-crypto/src/poly/dense.rs
Outdated
| } | ||
|
|
||
| pub fn pad_num_vars(&mut self, num_vars: usize) { | ||
| self.padded_num_vars = Some(num_vars); |
There was a problem hiding this comment.
Worth checking the number of variables isn't lower than the actual number of evaluation representations imo.
| self.z[i] = self.z[2 * i] + *r * (self.z[2 * i + 1] - self.z[2 * i]); | ||
| let len = self.unpadded_len(); | ||
| if len == 1 { | ||
| self.z[0] *= F::ONE - r |
There was a problem hiding this comment.
here you're not decreasing the number of padded or unpadded vars, so that means we could continue fixing it until eternity ?
There was a problem hiding this comment.
It is done at the end of the method https://github.com/Lagrange-Labs/dp-crypto/blob/feat/change_fixing_order_sumcheck/dp-crypto/src/poly/dense.rs#L388, as it needs to be done independently from which branch is taken in this if
| } | ||
|
|
||
| if let Some(nv) = self.padded_num_vars.as_mut() { | ||
| *nv -= 1 |
There was a problem hiding this comment.
it wasn't a check before but should we panic or saturating_sub here ?
There was a problem hiding this comment.
I added an assertion at the beginning of the method to check that num_vars > 0
2a05edd to
fccf93f
Compare
09e0a1b to
e385b17
Compare
fccf93f to
8b7c250
Compare
ce520e4 to
bf429d9
Compare
1fd681e to
414a199
Compare
f646b21 to
76f7067
Compare
No description provided.