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

Stark continuous read-only memory example #940

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

ColoCarletti
Copy link
Contributor

@ColoCarletti ColoCarletti commented Nov 15, 2024

Add Stark example for continuous read-only memory constraints

  • New feature
  • Bug fix
  • Optimization

Checklist

  • Linked to Github Issue
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run

@ColoCarletti ColoCarletti marked this pull request as ready for review November 15, 2024 21:11
@ColoCarletti ColoCarletti requested a review from a team as a code owner November 15, 2024 21:11
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.04%. Comparing base (d016a73) to head (59c8b26).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #940      +/-   ##
==========================================
+ Coverage   70.99%   71.04%   +0.05%     
==========================================
  Files         153      153              
  Lines       32770    32770              
==========================================
+ Hits        23264    23283      +19     
+ Misses       9506     9487      -19     

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


🚨 Try these New Features:

// (a'_{i+1} - a'_i)(a'_{i+1} - a'_i - 1) = 0 where a' is the sorted address
let res = (a_sorted1 - a_sorted0) * (a_sorted1 - a_sorted0 - FieldElement::<F>::one());

transition_evaluations[self.constraint_idx()] = res;
Copy link
Contributor

Choose a reason for hiding this comment

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

you should check if the vector can hold the value at that position

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix in commit


let mut aux_col = Vec::new();
let num = z - (&a[0] + alpha * &v[0]);
let den = z - (&a_sorted[0] + alpha * &v_sorted[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

For learning purposes this is ok, but for performance reasons, it's best to compute all the denominators, due batch inverse and then compute

}
}

#[derive(Clone)]
Copy link
Contributor

Choose a reason for hiding this comment

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

this annotation should be placed after the documentation

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, done.

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.

6 participants