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

Added LogupAtRow functionality to EvalAtRow. #875

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

Alon-Ti
Copy link
Contributor

@Alon-Ti Alon-Ti commented Nov 10, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Nov 10, 2024

@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2024

Codecov Report

Attention: Patch coverage is 81.03448% with 11 lines in your changes missing coverage. Please review.

Project coverage is 91.66%. Comparing base (64270dc) to head (cf4bb59).
Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
crates/prover/src/constraint_framework/mod.rs 71.79% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #875      +/-   ##
==========================================
- Coverage   91.68%   91.66%   -0.03%     
==========================================
  Files          93       93              
  Lines       12800    12857      +57     
  Branches    12800    12857      +57     
==========================================
+ Hits        11736    11785      +49     
- Misses        951      959       +8     
  Partials      113      113              

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

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace branch from f76e199 to f4aa5d7 Compare November 10, 2024 12:29
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: cf4bb59 Previous: f6214d1 Ratio
merkle throughput/simd merkle 32012073 ns/iter (± 547997) 14690867 ns/iter (± 434150) 2.18

This comment was automatically generated by workflow using github-action-benchmark.

CC: @shaharsamocha7

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 17 of 19 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 18 of 19 files reviewed, 6 unresolved discussions (waiting on @Alon-Ti and @ohad-starkware)


crates/prover/src/examples/blake/round/mod.rs line 34 at r2 (raw file):

    }
    fn evaluate<E: EvalAtRow>(&self, mut eval: E) -> E {
        let is_first = eval.get_preprocessed_column(PreprocessedColumn::IsFirst(self.log_size()));

why did you remove that? the logup define the use in it?

Code quote:

let is_first = eval.get_preprocessed_column(PreprocessedColumn::IsFirst(self.log_size()));

crates/prover/src/constraint_framework/mod.rs line 169 at r2 (raw file):

        }

        fn write_frac(&mut self, fraction: Fraction<Self::EF, Self::EF>) {

maybe this should be renamed to write_logup? write_logup_frac?
WDYT?

Code quote:

fn write_frac(&mut self, fraction: Fraction<Self::EF, Self::EF>) {

crates/prover/src/constraint_framework/mod.rs line 202 at r2 (raw file):

    fn get_alpha_powers(&self) -> &[EF];
    fn name(&self) -> &str;
}

should this code be here?

Code quote:

pub trait RelationType<F, EF>
where
    F: Clone,
    EF: Clone + Zero + From<F> + From<SecureField> + Mul<F, Output = EF> + Sub<EF, Output = EF>,
{
    fn combine(&self, values: &[F]) -> EF {
        values
            .iter()
            .zip(self.get_alpha_powers())
            .fold(EF::zero(), |acc, (value, power)| {
                acc + power.clone() * value.clone()
            })
            - self.get_z()
    }

    fn get_z(&self) -> EF;
    fn get_alpha_powers(&self) -> &[EF];
    fn name(&self) -> &str;
}

crates/prover/src/examples/xor/gkr_lookups/mle_eval.rs line 928 at r2 (raw file):

                is_second_eval,
            )
        });

?

Code quote:

        });

crates/prover/src/constraint_framework/logup.rs line 74 at r2 (raw file):

    pub fn dummy() -> Self {
        Self {
            interaction: 0,

I think it is better not to use real values here

Suggestion:

interaction: -1,

crates/prover/src/constraint_framework/interaction_gen.rs line 7 at r2 (raw file):

use crate::core::poly::BitReversedOrder;

pub struct InteractionTraceGenerator<'a> {}

Do we need this?

Code quote:

use crate::core::backend::simd::SimdBackend;
use crate::core::fields::m31::BaseField;
use crate::core::pcs::TreeVec;
use crate::core::poly::circle::CircleEvaluation;
use crate::core::poly::BitReversedOrder;

pub struct InteractionTraceGenerator<'a> {}

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace branch from f4aa5d7 to cf4bb59 Compare November 13, 2024 07:45
Copy link
Contributor Author

@Alon-Ti Alon-Ti 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: 8 of 19 files reviewed, 6 unresolved discussions (waiting on @ohad-starkware and @shaharsamocha7)


crates/prover/src/constraint_framework/logup.rs line 74 at r2 (raw file):

Previously, shaharsamocha7 wrote…

I think it is better not to use real values here

Done.


crates/prover/src/constraint_framework/mod.rs line 169 at r2 (raw file):

Previously, shaharsamocha7 wrote…

maybe this should be renamed to write_logup? write_logup_frac?
WDYT?

I'll rename them in the PR above where I decouple this from LogupAtRow functionality.


crates/prover/src/constraint_framework/mod.rs line 202 at r2 (raw file):

Previously, shaharsamocha7 wrote…

should this code be here?

It's not used in this PR, removed.


crates/prover/src/examples/blake/round/mod.rs line 34 at r2 (raw file):

Previously, shaharsamocha7 wrote…

why did you remove that? the logup define the use in it?

Yes, once the logup is in the eval, this becomes part of the init (especially now that it's a const column). See constraint_framework/mod.rs:157.


crates/prover/src/constraint_framework/interaction_gen.rs line 7 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Do we need this?

Sorry, spoilers :)


crates/prover/src/examples/xor/gkr_lookups/mle_eval.rs line 928 at r2 (raw file):

Previously, shaharsamocha7 wrote…

?

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 11 of 11 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ohad-starkware)

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