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

feat: range checker chip using a gate #27

Merged
merged 4 commits into from
May 23, 2024
Merged

Conversation

OsamaAlkhodairy
Copy link
Contributor

No description provided.

@OsamaAlkhodairy OsamaAlkhodairy changed the title feat: added another range checker chip that uses a gate instead of a preprocessed column feat: range checker chip using a gate May 21, 2024
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.

Seems the first row's constraint isn't right?

If so, let's add a negative test to make sure you can't make the counter column start from a nonzero counter.

chips/src/range_gate/trace.rs Outdated Show resolved Hide resolved
chips/src/range_gate/air.rs Outdated Show resolved Hide resolved
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.

Added a comment that might help remove panic in the negative test, but overall LGTM


let mut challenger = config::poseidon2::Challenger::new(perm.clone());

let result = catch_unwind(AssertUnwindSafe(|| {
Copy link
Contributor

Choose a reason for hiding this comment

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

was this issue here that the debug builder had an assert failing? you can turn off debug assert like this: https://github.com/axiom-crypto/afs-prototype/blob/fed9b82817325ef174c6a4a40056af7d89bef72d/stark-backend/tests/partitioned_sum_air/mod.rs#L88 to prevent the panic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, here I expect an assert to fail because the AIR constraints aren't met so I wanted to catch it (and then assert that there was an error)

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that I think the assert might only be coming from the debug builder, which can be turned off if you wanted

chips/tests/integration_test.rs Show resolved Hide resolved
@OsamaAlkhodairy OsamaAlkhodairy merged commit d384706 into main May 23, 2024
3 checks passed
@OsamaAlkhodairy OsamaAlkhodairy deleted the range_checker_gate branch May 23, 2024 15:49
luffykai pushed a commit that referenced this pull request Dec 13, 2024
* feat: added another range checker chip that uses a gate instead of a preprocessed column

* fix: fixed first row constraints and added negative test

* chore: using run_simple_test function for all tests
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