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

Move SecureColumn #478

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Move SecureColumn #478

merged 1 commit into from
Mar 21, 2024

Conversation

spapinistarkware
Copy link
Collaborator

@spapinistarkware spapinistarkware commented Mar 15, 2024

This change is Reviewable

Copy link

graphite-app bot commented Mar 15, 2024

Your org has enabled the Graphite merge queue for merging into dev

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 95.43%. Comparing base (4dc88e9) to head (2f3df09).

Files Patch % Lines
src/core/fields/secure.rs 70.00% 6 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           spapini/03-13-Use_only_canonic_domains     #478   +/-   ##
=======================================================================
  Coverage                                   95.43%   95.43%           
=======================================================================
  Files                                          59       59           
  Lines                                        8699     8699           
  Branches                                     8699     8699           
=======================================================================
  Hits                                         8302     8302           
  Misses                                        347      347           
  Partials                                       50       50           

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

Copy link
Collaborator 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: 5 of 8 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @shaharsamocha7)

a discussion (no related file):

Previously, shaharsamocha7 wrote…

Is fields/secure.rs the correct place for that logic?
Seems like this is a different field from qm31.

Also the logic here fits under poly dir, WDYT?

It's not just for poly. SecureColumn is for any column of secure fields.
It's the same field as qm31, but it's more of gadgets on top of it.
Not sure where is best to put it


@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 69b2fb9 to 6c0f065 Compare March 19, 2024 14:38
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 6c0f065 to 38b36f9 Compare March 19, 2024 14:48
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 38b36f9 to 2b184d6 Compare March 19, 2024 14:52
@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch from 2b184d6 to 4dc88e9 Compare March 19, 2024 15:22
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 1 of 3 files at r2, all commit messages.
Reviewable status: 6 of 8 files reviewed, 5 unresolved discussions (waiting on @alonh5 and @spapinistarkware)


src/core/fields/secure.rs line 12 at r2 (raw file):

pub const SECURE_EXTENSION_DEGREE: usize =
    <SecureField as ExtensionOf<BaseField>>::EXTENSION_DEGREE;

You have a const here

pub const SECURE_FIELD_EXTENSION_DEGREE: usize = 4;

Maybe those can be combined?

Code quote:

pub const SECURE_EXTENSION_DEGREE: usize =
    <SecureField as ExtensionOf<BaseField>>::EXTENSION_DEGREE;

src/core/fields/secure.rs line 14 at r2 (raw file):

    <SecureField as ExtensionOf<BaseField>>::EXTENSION_DEGREE;

pub struct SecureColumn<B: Backend> {

Document

Code quote:

pub struct SecureColumn<B: Backend> {

src/core/fields/secure.rs line 15 at r2 (raw file):

pub struct SecureColumn<B: Backend> {
    pub cols: [Col<B, BaseField>; SECURE_EXTENSION_DEGREE],

Suggestion:

pub columns: [Col<B, BaseField>; SECURE_EXTENSION_DEGREE],

src/core/fields/secure.rs line 45 at r2 (raw file):

}

pub struct SecureCirclePoly(pub [CPUCirclePoly; SECURE_EXTENSION_DEGREE]);

I think that the previous place of that part of this file was better.

Code quote:

pub struct SecureCirclePoly(pub [CPUCirclePoly; SECURE_EXTENSION_DEGREE]);

src/core/fields/secure.rs line 71 at r2 (raw file):

}

pub fn combine_secure_value(value: [SecureField; SECURE_EXTENSION_DEGREE]) -> SecureField {

This function should be documented.

Code quote:

pub fn combine_secure_value(value: [SecureField; SECURE_EXTENSION_DEGREE]) -> SecureField {

@spapinistarkware spapinistarkware force-pushed the spapini/03-13-Use_only_canonic_domains branch 2 times, most recently from 004de96 to 07a69ae Compare March 21, 2024 09:14
@spapinistarkware spapinistarkware force-pushed the spapini/03-15-Move_SecureColumn branch 2 times, most recently from 1f8868b to 585aa23 Compare March 21, 2024 09:54
Copy link
Collaborator 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: 4 of 8 files reviewed, 5 unresolved discussions (waiting on @alonh5 and @shaharsamocha7)


src/core/fields/secure.rs line 12 at r2 (raw file):

Previously, shaharsamocha7 wrote…

You have a const here

pub const SECURE_FIELD_EXTENSION_DEGREE: usize = 4;

Maybe those can be combined?

Done.


src/core/fields/secure.rs line 14 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Document

Done.


src/core/fields/secure.rs line 15 at r2 (raw file):

pub struct SecureColumn<B: Backend> {
    pub cols: [Col<B, BaseField>; SECURE_EXTENSION_DEGREE],

Done.


src/core/fields/secure.rs line 45 at r2 (raw file):

Previously, shaharsamocha7 wrote…

I think that the previous place of that part of this file was better.

Done.


src/core/fields/secure.rs line 71 at r2 (raw file):

Previously, shaharsamocha7 wrote…

This function should be documented.

Done.

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 10 of 10 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @alonh5 and @spapinistarkware)


src/core/channel.rs line 126 at r4 (raw file):

        let felts: [BaseField; FELTS_PER_HASH] = self.draw_base_felts();
        SecureField::from_m31_array(
            felts[..<SecureField as ExtensionOf<BaseField>>::EXTENSION_DEGREE]

Why not using the const that you defined there?

Suggestion:

felts[..SECURE_EXTENSION_DEGREE]

src/core/poly/circle/secure_poly.rs line 28 at r4 (raw file):

    /// Evaluates the polynomial at a point, given evaluations of its composing base field
    /// polynomials' evaluations at that point.

Suggestion:

    /// Evaluates the polynomial at a point, given evaluations of its composing base field
    /// polynomials at that point.

src/core/poly/circle/secure_poly.rs line 29 at r4 (raw file):

    /// Evaluates the polynomial at a point, given evaluations of its composing base field
    /// polynomials' evaluations at that point.
    pub fn eval_from_partial_evals(value: [SecureField; SECURE_EXTENSION_DEGREE]) -> SecureField {

?

Suggestion:

evals

Copy link
Collaborator 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: 9 of 11 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @shaharsamocha7)


src/core/channel.rs line 126 at r4 (raw file):

Previously, shaharsamocha7 wrote…

Why not using the const that you defined there?

Done.


src/core/poly/circle/secure_poly.rs line 28 at r4 (raw file):

    /// Evaluates the polynomial at a point, given evaluations of its composing base field
    /// polynomials' evaluations at that point.

Done.

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:

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)

Copy link
Collaborator Author

spapinistarkware commented Mar 21, 2024

Merge activity

@spapinistarkware spapinistarkware changed the base branch from spapini/03-13-Use_only_canonic_domains to dev March 21, 2024 11:24
@spapinistarkware spapinistarkware merged commit c617804 into dev Mar 21, 2024
10 checks passed
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.

None yet

3 participants