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

Expression Evaluator. #861

Merged
merged 1 commit into from
Oct 20, 2024
Merged

Expression Evaluator. #861

merged 1 commit into from
Oct 20, 2024

Conversation

Alon-Ti
Copy link
Contributor

@Alon-Ti Alon-Ti commented Oct 20, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Oct 20, 2024

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

Join @Alon-Ti and the rest of your teammates on Graphite Graphite

@Alon-Ti Alon-Ti marked this pull request as ready for review October 20, 2024 15:42
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2024

Codecov Report

Attention: Patch coverage is 58.50340% with 61 lines in your changes missing coverage. Please review.

Project coverage is 91.89%. Comparing base (ce5b975) to head (888c6e4).

Files with missing lines Patch % Lines
crates/prover/src/constraint_framework/expr.rs 58.50% 59 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #861      +/-   ##
==========================================
- Coverage   92.29%   91.89%   -0.40%     
==========================================
  Files          91       92       +1     
  Lines       12439    12586     +147     
  Branches    12439    12586     +147     
==========================================
+ Hits        11480    11566      +86     
- Misses        851      910      +59     
- Partials      108      110       +2     

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

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.

:lgtm:

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti)


crates/prover/src/constraint_framework/expr.rs line 25 at r1 (raw file):

    // if a = SecureCol(a0, a1, a2, a3), b = SecureCol(b0, b1, b2, b3) then
    // a + b evaluates to Add(a, b) rather than
    // SecureCol(Add(a0, b0), Add(a1, b1), Add(a2, b2), Add(a3, b3))

Docstring

Suggestion:

    Col(ColumnExpr),
    /// An atomic secure column constructed from 4 expressions.
    /// Expressions on the secure column are not reduced, i.e,
    /// if `a = SecureCol(a0, a1, a2, a3), b = SecureCol(b0, b1, b2, b3)` then
    /// `a + b` evaluates to `Add(a, b)` rather than
    /// `SecureCol(Add(a0, b0), Add(a1, b1), Add(a2, b2), Add(a3, b3))`

crates/prover/src/constraint_framework/expr.rs line 83 at r1 (raw file):

        *self = Expr::Mul(Box::new(self.clone()), Box::new(rhs));
    }
}

Optional suggestion

Suggestion:

impl AddAssign for Expr {
    fn add_assign(&mut self, rhs: Self) {
        *self = self.clone() + rhs;
    }
}

impl MulAssign for Expr {
    fn mul_assign(&mut self, rhs: Self) {
        *self = self.clone() * rhs;
    }
}

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: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @andrewmilson)


crates/prover/src/constraint_framework/expr.rs line 25 at r1 (raw file):

Previously, andrewmilson (Andrew Milson) wrote…

Docstring

Done.


crates/prover/src/constraint_framework/expr.rs line 83 at r1 (raw file):

Previously, andrewmilson (Andrew Milson) wrote…

Optional suggestion

Done.

@Alon-Ti Alon-Ti merged commit 9cfd48a into dev Oct 20, 2024
17 of 18 checks passed
Copy link
Contributor Author

Alon-Ti commented Oct 20, 2024

Merge activity

  • Oct 20, 12:26 PM EDT: A user merged this pull request with Graphite.

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