-
Notifications
You must be signed in to change notification settings - Fork 169
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
fix multiset checks: running product column should explicitly shift multiplicand #1223
Conversation
@@ -68,7 +68,8 @@ fn b_chip_trace_bitwise() { | |||
Felt::from(b), | |||
Felt::from(a & b), | |||
); | |||
let mut expected = value.inv(); | |||
let mut expected = (value + rand_elements[0]).inv(); | |||
expected *= ONE + rand_elements[0]; |
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.
@plafer noticed there are two ways to shift the multiplicands:
- we could decide to not shift the multiplicative identity i.e E::ONE
- or we shift all values including the multiplicative identity
my current approach is to shift all values, which means that in the tests I'd need to sometimes explicitly multiply the expected by (ONE + alpha) or (ONE + alpha).inv() (this is fine and works out well)
wondering if you have any considerations regarding what approach might be better e.g. more correct, more efficient e.t.c.
cc: @bobbinth
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.
I'm not sure I follow, but ultimately the tests should not change as a result of this change. In the case of this test specifically, the value in b_chip[2]
(line 72 pre-change) is going to be the same before and after the change.
All that we're changing is where in the code we do alphas[0] + ...
. That would be here and here for the requests, and here for the responses. And correspondingly, we'd remove the alphas[0] +
from all the implementors (e.g. here and here). This is the general idea.
Let me know if that clears things up
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.
ultimately the tests should not change as a result of this change.
Yes, that's how I think about this as well. We are just updating representation for ease of readability - the test should not change as a part of this PR (maybe it would make sense to update them, but that should happen in a different PR).
This reverts commit 26272b3.
I realised that it’s not quite straightforward to move alpha[0] + from the implementors and have the tests still pass without change. Model Before this PR, alpha was implicitly added to v before entering the multiset region and the value was taken as is, inside the multiset region. Most of the implementors don't follow the simple path of v + alpha[0]
|
Thank you for this comprehensive list! I had assumed when creating the issue that we were consistent always shifting by Given this new information, I would say: whenever we don't shift by A few notable cases:
I didn't look into each and every case but I think these guidelines should address everything - let me know if it doesn't. @bobbinth would like your thoughts on this. |
5f36479
to
df15de8
Compare
To make things easier to review, I will do this in 2 steps.
This way, the first PR or the first commit should only contain code changes, and the second PR or commit should only contain code deletions and test additions. This will enforce some constraints on the kind of changes I can make and make the review easier. |
@iammadab I appreciate you trying to make the review easier, but really I think it'd be simpler to do it all in one PR. It'll actually make the review easier: we can check the code to make sure everything is as discussed, and then similarly the tests. |
d8ae2e5
to
156a257
Compare
@iammadab I believe this got closed because we merged the |
Describe your changes
WIP for #1185
Checklist before requesting a review
next
according to naming convention.