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

Separate verifier crate #586

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Apr 24, 2024

This change is Reviewable

Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @spapinistarkware and the rest of your teammates on Graphite Graphite

@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.96%. Comparing base (41de2e8) to head (fffecde).

Additional details and impacted files
@@                          Coverage Diff                          @@
##           spapini/04-24-remove_field_macros     #586      +/-   ##
=====================================================================
+ Coverage                              93.91%   93.96%   +0.04%     
=====================================================================
  Files                                     67       67              
  Lines                                   8435     8435              
  Branches                                8435     8435              
=====================================================================
+ Hits                                    7922     7926       +4     
+ Misses                                   449      445       -4     
  Partials                                  64       64              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-separate_verifier_crate branch from f150710 to 6d7d396 Compare April 24, 2024 11:38
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 79 of 80 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @spapinistarkware)


crates/prover/src/core/backend/avx512/circle.rs line 329 at r2 (raw file):

        a.swap_with_slice(&mut c[0..n0]);
    }
    fold(poly.coeffs.as_slice(), &mappings)

Why did you change it?

Code quote:

poly.coeffs.as_slice()

crates/verifier/Cargo.toml line 15 at r2 (raw file):

rand = { version = "0.8.5", features = ["small_rng"] }
[lib]
bench = false

Is this needed?

Code quote:

[lib]
bench = false

crates/verifier/Cargo.toml line 25 at r2 (raw file):

[features]
avx512 = []

Remove

Code quote:

[features]
avx512 = []

crates/verifier/src/core/fields/cm31.rs line 63 at r2 (raw file):

}

#[cfg(test)]

Can you keep it? Those functions were suppose to use us only for tests.
Same for the others.

Code quote:

#[cfg(test)]

crates/verifier/src/core/fields/mod.rs line 35 at r2 (raw file):

}

pub trait MulGroup: Mul<Output = Self> + MulAssign + Sized + One + Copy {

Can you add short documentation?

Suggestion:

/// Trait for performing field multiplicative group operations.
pub trait MulGroup: Mul<Output = Self> + MulAssign + Sized + One + Copy {

Copy link
Contributor Author

@spapinistarkware spapinistarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @shaharsamocha7)


crates/verifier/src/core/fields/cm31.rs line 63 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Can you keep it? Those functions were suppose to use us only for tests.
Same for the others.

One crate cannot access the test config items of another crate.

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @spapinistarkware)


crates/verifier/src/core/fields/cm31.rs line 63 at r2 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

One crate cannot access the test config items of another crate.

Ok.
Can you just confirm with AlonH if there was other reason why it is only for tests?
(unblocking)

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-separate_verifier_crate branch from 6d7d396 to f1d89b8 Compare April 24, 2024 14:12
Copy link
Contributor Author

@spapinistarkware spapinistarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 78 of 80 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/core/backend/avx512/circle.rs line 329 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Why did you change it?

It was reimplementing this funcationality, whic is a bit silly.


crates/verifier/Cargo.toml line 25 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Remove

Done.


crates/verifier/src/core/fields/mod.rs line 35 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Can you add short documentation?

Done.

@spapinistarkware spapinistarkware force-pushed the spapini/04-24-remove_field_macros branch from 5b0ecc9 to 41de2e8 Compare April 25, 2024 09:03
@spapinistarkware spapinistarkware force-pushed the spapini/04-24-separate_verifier_crate branch from f1d89b8 to fffecde Compare April 25, 2024 09:03
@spapinistarkware spapinistarkware force-pushed the spapini/04-24-separate_verifier_crate branch from fffecde to 9817318 Compare April 25, 2024 12:50
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 33 files at r4.
Reviewable status: 61 of 87 files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)


crates/prover/src/core/backend/mod.rs line 56 at r4 (raw file):

    // TODO(Ohad): change to use a mutable slice.
    fn batch_inverse(column: &Self::Column, dst: &mut Self::Column);
}

Can we use here the same pattern as in FriOps?

Code quote:

pub trait FieldOps<F: Field>: ColumnOps<F> {
    // TODO(Ohad): change to use a mutable slice.
    fn batch_inverse(column: &Self::Column, dst: &mut Self::Column);
}

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 61 of 87 files reviewed, 1 unresolved discussion (waiting on @spapinistarkware)

Copy link
Contributor

@andrewmilson andrewmilson left a comment

Choose a reason for hiding this comment

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

Reviewed 51 of 80 files at r1, 1 of 2 files at r2, 2 of 2 files at r3, 33 of 33 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @spapinistarkware)


crates/prover/benches/eval_at_point.rs line 11 at r4 (raw file):

    use stwo_prover::core::poly::circle::{CanonicCoset, CircleEvaluation, PolyOps};
    use stwo_prover::core::poly::NaturalOrder;
    use stwo_verifier::core::fields::m31::BaseField;

I think it makes more sense to have a seperate stwo_fields crate. Seems strange importing fields from the verifier.


crates/prover/src/core/backend/avx512/circle.rs line 88 at r4 (raw file):

    fn twiddle_steps<F: Field>(mappings: &[F]) -> Vec<F>
    where
        F: MulGroup,

Nit:

Suggestion:

    fn twiddle_steps<F: Field + MulGroup>(mappings: &[F]) -> Vec<F>

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.

4 participants