Skip to content
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: optimize polynomial folding process in batch FRI prover #1651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crStiv
Copy link

@crStiv crStiv commented Jan 24, 2025

This PR optimizes the polynomial folding process in the batch FRI prover by performing folding directly in the value domain instead of the coefficient domain.

Technical details:

  • For a polynomial P(x) = sum_{i<r} x^i * P_i(x^r), we compute sum_{i<r} beta^i * P_i(x) directly in the value domain
  • This is mathematically equivalent to the original folding in coefficient domain
  • While we still need one final IFFT transformation for compatibility with the rest of the proof system, we avoid intermediate FFT transformations
  • The optimization reduces the number of field operations needed for folding

The change maintains the same mathematical properties while making the implementation more efficient.

Changes:

  • Removed coefficient domain folding
  • Implemented direct value domain folding with detailed documentation
  • Added explanatory comments for better code maintainability

The optimization addresses the TODO comment in the original code that suggested this improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant