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 expression degrees. #931

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Added expression degrees. #931

wants to merge 1 commit into from

Conversation

Alon-Ti
Copy link
Contributor

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

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Dec 10, 2024

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

@Alon-Ti Alon-Ti marked this pull request as ready for review December 10, 2024 13:35
@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.44%. Comparing base (8550b7d) to head (f835cb8).

Files with missing lines Patch % Lines
...tes/prover/src/constraint_framework/expr/degree.rs 83.33% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #931      +/-   ##
==========================================
- Coverage   91.48%   91.44%   -0.04%     
==========================================
  Files          98       99       +1     
  Lines       13733    13787      +54     
  Branches    13733    13787      +54     
==========================================
+ Hits        12563    12608      +45     
- Misses       1055     1064       +9     
  Partials      115      115              

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

@Alon-Ti Alon-Ti force-pushed the alont/expression-degree branch from bd78438 to f835cb8 Compare December 10, 2024 13:45
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: f835cb8 Previous: cd8b37b Ratio
merkle throughput/simd merkle 28569815 ns/iter (± 434865) 13712527 ns/iter (± 579195) 2.08

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.

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


crates/prover/src/constraint_framework/expr/degree.rs line 8 at r2 (raw file):

///        simplification.
///     2. If expressions p and q cancel out under some operation, this will not be accounted
///        for, so that (x^2 + 1) - (x^2 + x) will return degree 2.

You should mention that this is poly in the trace cells, right?

Code quote:

/// Finds a degree bound for an expressions.
/// Computes the actual degree with the following caveats:
///     1. The constant expression 0 receives degree 0 like all other constants rather than the
///        mathematically correcy -infinity. This means, for example, that expresisons of the
///        type 0 * expr will return degree deg expr. This should be mitigated by
///        simplification.
///     2. If expressions p and q cancel out under some operation, this will not be accounted
///        for, so that (x^2 + 1) - (x^2 + x) will return degree 2.

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

    exprs: HashMap<String, BaseExpr>,
    ext_exprs: HashMap<String, ExtExpr>,
}

Why this struct is here?
Also, why do we have a degree_bound function for this struct?
Isn't it enough to impl degree_bound for BaseExpr, ExtExpr and that's it?

Code quote:

/// A struct of named expressions that can be searched when determining the degree bound for an
/// expression that contains parameters.
pub struct NamedExprs {
    exprs: HashMap<String, BaseExpr>,
    ext_exprs: HashMap<String, ExtExpr>,
}

crates/prover/src/constraint_framework/expr/degree.rs line 81 at r2 (raw file):

    #[test]
    fn test_degree_bound() {
        let intermediate = (felt!(12) + col!(1, 1, 0)) * var!("a") * col!(1, 0, 0);

Remind me what var is? Is it counted as a constant?

Code quote:

var!("a")

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