-
Notifications
You must be signed in to change notification settings - Fork 174
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
Optimize FRI remainder polynomial check #1670
Optimize FRI remainder polynomial check #1670
Conversation
693f6a8
to
9dfec5e
Compare
7f5a4e6
to
361ffab
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.
Looks good! Thank you! Not a full review, but I left some comments inline.
where | ||
E: FieldElement, | ||
{ | ||
p.iter().fold(E::ZERO, |acc, &coeff| acc * E::from(x) + coeff) |
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.
p.iter().fold(E::ZERO, |acc, &coeff| acc * E::from(x) + coeff) | |
p.iter().reduce(|acc, &coeff| acc * E::from(x) + coeff).unwrap_or(E::ZERO) |
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 think fold
is a bit cleaner to me, but no strong preference, let me know
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.
That's perfectly fine, especially since this is a test, and it only saves one multiplication.
let remainder = channel.read_remainder::<4>(remainder_commitment)?; | ||
for (pos, eval) in final_pos_eval.iter() { | ||
if remainder[*pos] != *eval { | ||
let remainder_poly = channel.read_remainder::<4>(remainder_commitment)?; |
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.
Can we replace the const generic with a constant?
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.
With the recent changes, we don't need the const anymore so I removed it now
Thank you for pointing it out
@Al-Kindi-0 - v0.12.2 |
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.
Very cool! Love seeing the horner ops progressively improving the falcon & recursive verifier 🙂
Left a few nits to help readability
a517393
to
36abaf7
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.
Looks good! Thank you! I Overall, I'd probably move even more functionality into getters/setters instead of getting pointers and loading from memory (and I left a couple of comments about this) - but that's something we can do in follow-up PRs.
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.
Looks good! Thank you!
Follow-up to #1665.$64$ , $128$ , $256$ on the degree of the remainder polynomial where tested and the choice $128$ was found to be optimal when the number of FRI queries is $27$ .
Instead of using the probabilistic NTT to do the FRI remainder polynomial check, we use direct polynomial evaluation using
horner_eval_ext
.In the process of this PR, the strict bounds
The recursive verifier in #1665, verifies an execution trace of size
1 << 20
rows in:The recursive verifier in this PR, verifies an execution trace of size
1 << 20
rows in:Putting in draft until the preceding PRs get merged.