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

docs: add documentation for FriE2F4 operation #1645

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

Description:
Add comprehensive documentation for the FriE2F4 operation in the core operations module. The documentation includes:

  • Description of FRI layer folding operation
  • List of operations performed
  • Detailed stack transition diagram with input and output states
  • Explanation of stack overflow table interaction

This documentation helps developers better understand the FRI protocol implementation in the Miden VM and improves code maintainability.

Description:
Add comprehensive documentation for the FriE2F4 operation in the core operations module. 
The documentation includes:
- Description of FRI layer folding operation
- List of operations performed
- Detailed stack transition diagram with input and output states
- Explanation of stack overflow table interaction

This documentation helps developers better understand the FRI protocol implementation 
in the Miden VM and improves code maintainability.
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few nits.

Could you also rebase this on top of the latest next branch?

core/src/operations/mod.rs Outdated Show resolved Hide resolved
core/src/operations/mod.rs Outdated Show resolved Hide resolved
@plafer plafer added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Feb 5, 2025
@VolodymyrBg
Copy link
Author

@plafer Done

@VolodymyrBg VolodymyrBg requested a review from plafer February 5, 2025 15:15
@plafer plafer changed the base branch from main to next February 5, 2025 17:48
@plafer
Copy link
Contributor

plafer commented Feb 5, 2025

@VolodymyrBg I just noticed that Operation variants do in fact have big docstrings - apologies for misleading you.

I don't recall exactly what you had initially, but basically something along the lines of this should work (even copy/paste).

@VolodymyrBg
Copy link
Author

@plafer
/// Performs FRI (Fast Reed-Solomon Interactive Oracle Proofs) layer folding by a factor of 4
/// for FRI protocol executed in a degree 2 extension of the base field.
///
/// This operation:
/// - Folds 4 query values (v0, v1), (v2, v3), (v4, v5), (v6, v7) into a single value (ne0, ne1)
/// - Computes new value of the domain generator power: poe' = poe^4
/// - Increments layer pointer (cptr) by 2
/// - Checks that the previous folding was done correctly
/// - Shifts the stack to move an item from the overflow table to stack position 15
///
/// Stack transition:
/// Input: [v7, v6, v5, v4, v3, v2, v1, v0, f_pos, d_seg, poe, pe1, pe0, a1, a0, cptr, ...]
/// Output: [t1, t0, s1, s0, df3, df2, df1, df0, poe^2, f_tau, cptr+2, poe^4, f_pos, ne1, ne0, eptr, ...]
/// where eptr is moved from the stack overflow table and is the address of the final FRI layer.

@plafer
Copy link
Contributor

plafer commented Feb 5, 2025

Yes that works

@VolodymyrBg
Copy link
Author

@plafer should i correct the file again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This PR does not require an entry in the `CHANGELOG.md` file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants