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

Framework component #761

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Jul 28, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2024

Codecov Report

Attention: Patch coverage is 99.01961% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.20%. Comparing base (b06f87e) to head (a34eb4a).

Files Patch % Lines
...rates/prover/src/constraint_framework/component.rs 99.01% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #761      +/-   ##
==========================================
- Coverage   93.25%   93.20%   -0.06%     
==========================================
  Files          89       90       +1     
  Lines       11795    11897     +102     
  Branches    11795    11897     +102     
==========================================
+ Hits        11000    11089      +89     
- Misses        694      707      +13     
  Partials      101      101              

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

@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from 9982532 to a276f94 Compare July 28, 2024 07:43
@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from b40bca7 to 247a5f1 Compare July 28, 2024 12:18
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from a276f94 to d53d91f Compare July 28, 2024 12:18
@spapinistarkware spapinistarkware mentioned this pull request Jul 28, 2024
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 2 of 4 files at r1, all commit messages.
Reviewable status: 2 of 4 files reviewed, 6 unresolved discussions (waiting on @spapinistarkware)


.gitignore line 7 at r2 (raw file):

build
dist
target*

It's a folder, right?

Suggestion:

target/*

crates/prover/src/constraint_framework/component.rs line 20 at r2 (raw file):

use crate::core::{utils, InteractionElements, LookupValues};

pub trait FrameworkComponent {

Document
This framework supports components that allow only constraints inside the row right? (or lookup)
Also, it assumes that all the rows (for specific interaction) are of the same length, no?

Code quote:

pub trait FrameworkComponent {

crates/prover/src/constraint_framework/component.rs line 50 at r2 (raw file):

    ) -> crate::core::pcs::TreeVec<
        crate::core::ColumnVec<
            Vec<crate::core::circle::CirclePoint<crate::core::fields::qm31::SecureField>>,

In all of them

Suggestion:

SecureField

crates/prover/src/constraint_framework/component.rs line 65 at r2 (raw file):

                })
                .collect()
        })

You can use this:

pub fn shifted_mask_points(

Code quote:

        info.mask_offsets.map(|tree_mask| {
            tree_mask
                .iter()
                .map(|col_mask| {
                    col_mask
                        .iter()
                        .map(|off| point + trace_step.mul_signed(*off).into_ef())
                        .collect()
                })
                .collect()
        })

crates/prover/src/constraint_framework/component.rs line 100 at r2 (raw file):

        let trace: TreeVec<
            Vec<Cow<'_, CircleEvaluation<SimdBackend, BaseField, BitReversedOrder>>>,
        > = if eval_domain.log_size() != self.log_size() + LOG_BLOWUP_FACTOR {

I think you want it only in case that the eval_domain is bigger, no?

Suggestion:

if eval_domain.log_size() > self.log_size() + LOG_BLOWUP_FACTOR

crates/prover/src/constraint_framework/component.rs line 151 at r2 (raw file):

    fn lookup_values(&self, _trace: &ComponentTrace<'_, SimdBackend>) -> LookupValues {
        LookupValues::default()
    }

What's that, is it unimplemented?

Code quote:

    fn lookup_values(&self, _trace: &ComponentTrace<'_, SimdBackend>) -> LookupValues {
        LookupValues::default()
    }

@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from 247a5f1 to 05ef795 Compare July 28, 2024 12:47
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: 2 of 4 files reviewed, 6 unresolved discussions (waiting on @shaharsamocha7)


.gitignore line 7 at r2 (raw file):

Previously, shaharsamocha7 wrote…

It's a folder, right?

No, it's another target folder. I'm using targetavx for my avx compilations, so it won't interfere with the IDE.


crates/prover/src/constraint_framework/component.rs line 20 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Document
This framework supports components that allow only constraints inside the row right? (or lookup)
Also, it assumes that all the rows (for specific interaction) are of the same length, no?

Done.


crates/prover/src/constraint_framework/component.rs line 50 at r2 (raw file):

Previously, shaharsamocha7 wrote…

In all of them

Done.


crates/prover/src/constraint_framework/component.rs line 65 at r2 (raw file):

Previously, shaharsamocha7 wrote…

You can use this:

pub fn shifted_mask_points(

I'd have to createa a vector of domains though...


crates/prover/src/constraint_framework/component.rs line 100 at r2 (raw file):

Previously, shaharsamocha7 wrote…

I think you want it only in case that the eval_domain is bigger, no?

Theoretically, yes. But we need to do modifications to reuse the commitment evaluation in that case, which I don't want to write now. The way I wrote now, if , it's correct in that case, although, not as efficient is it could be.


crates/prover/src/constraint_framework/component.rs line 151 at r2 (raw file):

Previously, shaharsamocha7 wrote…

What's that, is it unimplemented?

Don't need lookup_values in this interface.

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


crates/prover/src/constraint_framework/component.rs line 65 at r2 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

I'd have to createa a vector of domains though...

should we change that function to get trace_step instead of domains?
Not necessarily for this pr


crates/prover/src/constraint_framework/component.rs line 100 at r2 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

Theoretically, yes. But we need to do modifications to reuse the commitment evaluation in that case, which I don't want to write now. The way I wrote now, if , it's correct in that case, although, not as efficient is it could be.

Can you add a TODO to consider to optimize that?


crates/prover/src/constraint_framework/component.rs line 25 at r3 (raw file):

/// Implementing this trait introduces implementations for [Component] and [ComponentProver] for the
/// SIMD backend.
/// Note that the constraint framework only support components with columns of the size size.

typo

Suggestion:

/// Note that the constraint framework only support components with columns of the same size.

@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from 9ae92ce to 86eb8cb Compare July 29, 2024 13:42
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from deaefad to e99fc2c Compare July 29, 2024 13:47
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, 3 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/constraint_framework/component.rs line 65 at r2 (raw file):

Previously, shaharsamocha7 wrote…

should we change that function to get trace_step instead of domains?
Not necessarily for this pr

Perhaps. It really depends on the concrete use cases of that function. For example, if we'd stop having any uses of it, we could delete it.


crates/prover/src/constraint_framework/component.rs line 100 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Can you add a TODO to consider to optimize that?

Done.


crates/prover/src/constraint_framework/component.rs line 25 at r3 (raw file):

Previously, shaharsamocha7 wrote…

typo

Done.

@spapinistarkware spapinistarkware mentioned this pull request Jul 29, 2024
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 r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)

@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from 86eb8cb to 051d90a Compare July 30, 2024 11:11
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from e99fc2c to c08ca54 Compare July 30, 2024 11:11
@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from 051d90a to 19c7760 Compare July 30, 2024 12:55
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from c08ca54 to 0a3a963 Compare July 30, 2024 12:56
@spapinistarkware spapinistarkware force-pushed the spapini/07-08-poseidon_with_logup branch from 19c7760 to 2150ceb Compare July 30, 2024 12:59
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from 0a3a963 to b931446 Compare July 30, 2024 12:59
Copy link
Contributor Author

spapinistarkware commented Jul 30, 2024

Merge activity

@spapinistarkware spapinistarkware changed the base branch from spapini/07-08-poseidon_with_logup to dev July 30, 2024 13:06
@spapinistarkware spapinistarkware force-pushed the spapini/07-28-framework_component branch from b931446 to a34eb4a Compare July 30, 2024 13:07
@spapinistarkware spapinistarkware merged commit 223cd84 into dev Jul 30, 2024
13 of 14 checks passed
This was referenced Jul 30, 2024
@spapinistarkware spapinistarkware mentioned this pull request Aug 7, 2024
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.

3 participants