Noir support via alternative design #7
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Description
Problem*
The initial implementation for Noir support used a very sparse lookup table which didn't seem to have any optimizations. Some experimentation showed that using a large if/else for the state transition has far better gatecount (2-3x less).
Other options:
[(Field, Field, Field); 74]and determining the next state by iterating over the array -> better performance than the sparse lookup table but not as good as the giant if elseSummary*
This PR implements
[a-z]it checks whether input character is within the rangea-z)A previous issue was also accepting (example)
alexalexfor regexalex$, because it wouldn't go into the correct state upon encountering the seconda. This works well in this implementation.Note that multiple accepting states are not supported, which is in line with zk-regex circom impl.
Additional Context
This can be tested for both raw & decomposed setting. This test suite can be used.
PR Checklist*
cargo fmton default settings.