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

Add SumChip #42

Merged
merged 1 commit into from
Jun 4, 2024
Merged

Add SumChip #42

merged 1 commit into from
Jun 4, 2024

Conversation

zlangley
Copy link
Contributor

@zlangley zlangley commented Jun 3, 2024

No description provided.

@zlangley zlangley requested a review from jonathanpwang June 3, 2024 21:17
@zlangley
Copy link
Contributor Author

zlangley commented Jun 3, 2024

I believe this implements the V0 part of the onboarding project. Not sure if we want to merge this, but making PR for feedback.

when_first_row.assert_eq(local.partial_sum, local.input);

let mut when_transition = builder.when_transition();
when_transition.assert_eq(next.partial_sum, local.partial_sum + next.input);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we concerned about overflow?

Copy link
Contributor

Choose a reason for hiding this comment

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

good point: for this particular chip, we define sum to mean as field elements, but indeed if we specified some bit range then we would need to add overflow constraints

Copy link
Contributor

@jonathanpwang jonathanpwang left a comment

Choose a reason for hiding this comment

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

LGTM

We can merge it and then you can change it to V1 in the next PR

when_first_row.assert_eq(local.partial_sum, local.input);

let mut when_transition = builder.when_transition();
when_transition.assert_eq(next.partial_sum, local.partial_sum + next.input);
Copy link
Contributor

Choose a reason for hiding this comment

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

good point: for this particular chip, we define sum to mean as field elements, but indeed if we specified some bit range then we would need to add overflow constraints

@zlangley zlangley merged commit 6441923 into main Jun 4, 2024
3 checks passed
@zlangley zlangley deleted the sum-chip branch June 4, 2024 10:19
luffykai pushed a commit that referenced this pull request Dec 13, 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.

2 participants