Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Range gate optimization #218

Closed
1 task done
vezenovm opened this issue Apr 20, 2023 · 0 comments · Fixed by #219
Closed
1 task done

Range gate optimization #218

vezenovm opened this issue Apr 20, 2023 · 0 comments · Fixed by #219
Labels
enhancement New feature or request

Comments

@vezenovm
Copy link
Contributor

Problem

After this PR in barretenberg is merged (AztecProtocol/barretenberg#369) an inefficiency has been introduced. Whenever there is an overlapping range check on the same witness we have to add an arithmetic gate.

Proposed solution

We can avoid this additional arithmetic gate by optimizing out redundant range constraints. We can remove the less restrictive range checks and keep the most restrictive. For example, if we range check the value at witness index 90 with a bit size of 4 and 8 in two different constraints we can remove the range constraint with bit size of 8.

Alternatives considered

No response

Additional context

No response

Submission Checklist

  • Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
@vezenovm vezenovm added the enhancement New feature or request label Apr 20, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Apr 20, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant