Skip to content

Refactor compute_deep_composition_poly function #200

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

Merged
merged 48 commits into from
Mar 23, 2023

Conversation

entropidelic
Copy link
Contributor

@entropidelic entropidelic commented Mar 21, 2023

compute_deep_composition_poly refactor

Description

Closes #183.
This PR refactors the compute_deep_composition_poly, mainly generalizing for the case the trace has more than one column, or what is the same, that there are more than one trace polynomials.
The function has been integrated with Fiat-Shamir too.

Type of change

Please delete options that are not relevant.

  • New-feature / Refactor

Checklist

  • Linked to Github Issue

@entropidelic entropidelic marked this pull request as ready for review March 21, 2023 21:43
@entropidelic entropidelic requested review from a team, schouhy and ajgara as code owners March 21, 2023 21:43
Comment on lines 67 to 69
for poly in trace_polys {
evaluations.push(poly.evaluate_slice(&evaluation_points));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

you could have the same programming style than in the precedent assignment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

@pablodeymo pablodeymo left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

Merging #200 (75c74f0) into main (6ee9655) will decrease coverage by 0.03%.
The diff coverage is 89.65%.

@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
- Coverage   95.58%   95.56%   -0.03%     
==========================================
  Files          62       62              
  Lines        6837     6872      +35     
==========================================
+ Hits         6535     6567      +32     
- Misses        302      305       +3     
Impacted Files Coverage Δ
proving_system/stark/src/air/context.rs 100.00% <ø> (ø)
proving_system/stark/src/air/mod.rs 66.66% <0.00%> (-33.34%) ⬇️
proving_system/stark/src/lib.rs 56.21% <45.45%> (-0.24%) ⬇️
proving_system/stark/src/air/frame.rs 82.81% <100.00%> (+3.96%) ⬆️
proving_system/stark/src/prover.rs 100.00% <100.00%> (ø)
proving_system/stark/src/verifier.rs 97.81% <100.00%> (+0.12%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

Just a few minor comments. Note I don't have a whole picture in terms of domain knowledge, so take those with a grain of salt. In terms of style and organization it looks OK.

Comment on lines +190 to +195
let poly = (trace_poly.clone()
- Polynomial::new_monomial(trace_poly.evaluate(eval), 0))
/ (Polynomial::new_monomial(FieldElement::<F>::one(), 1)
- Polynomial::new_monomial(eval.clone(), 0));

trace_terms = trace_terms + poly * coeff.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid some of the clones here?

Comment on lines +199 to +207
let even_composition_poly_term = (even_composition_poly.clone()
- Polynomial::new_monomial(
even_composition_poly.evaluate(&ood_evaluation_point.clone()),
0,
))
/ (Polynomial::new_monomial(FieldElement::one(), 1)
- Polynomial::new_monomial(ood_evaluation_point * ood_evaluation_point, 0));
let fourth_term = (odd_composition_poly.clone()

let odd_composition_poly_term = (odd_composition_poly.clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

Here as well.

@entropidelic entropidelic added this pull request to the merge queue Mar 23, 2023
Merged via the queue into main with commit 43cc888 Mar 23, 2023
@entropidelic entropidelic deleted the compute_deep_composition_poly-refactor branch March 23, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalize the deep composition polynomial
6 participants